linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Bart Van Assche <bvanassche@acm.org>,
	linux-mm@kvack.org,  Ivan Shapovalov <intelfx@intelfx.name>,
	Vlastimil Babka <vbabka@suse.cz>,
	 David Laight <david.laight@aculab.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	 David Rientjes <rientjes@google.com>,
	David Hildenbrand <david@redhat.com>,
	 Kaiyang Zhao <kaiyang2@cs.cmu.edu>,
	Joel Granados <joel.granados@kernel.org>,
	 Sourav Panda <souravpanda@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH] mm: Fix clang W=1 compiler warnings
Date: Fri, 7 Feb 2025 19:49:19 -0800	[thread overview]
Message-ID: <CAHk-=whe1UZUGKbtaaRV7CfS=sGtB2ouYAriryZ6bscE+5AFhA@mail.gmail.com> (raw)
In-Reply-To: <20250208033351.GB3305705@ax162>

On Fri, 7 Feb 2025 at 19:33, Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Fri, Feb 07, 2025 at 07:11:08PM -0800, Linus Torvalds wrote:
> >
> > But not having clang-19, I can't see if this is a case of "this is so
> > rare that let's just avoid it", or "this is the case that causes the
> > most noise for every file build, but there are lots of other cases of
> > this".
>
> The diff to hide some of the really common ones:
>
> https://github.com/ClangBuiltLinux/linux/issues/2002#issuecomment-1970004069

Oh, ok, that's already more than I would have liked to see, and I do
think that the patch is not only bigger than I'd like, it makes the
code actively worse with adding random casts just to shut the compiler
up.

That is, of course, something that C++ people think is a good thing,
since they are used to their traditional NULL casting idiocy. But in
C, we have actual taste and grace.

So no, that warning is no good for the kernel.

> The build log with that:
>
> https://gist.github.com/nathanchance/971e5abeba504d3017cd6ed4517bbda6
>
> I looked at a number of them and none of them really seemed like bugs to
> me.

Yeah, those seem like more of the same: the kernel doing sane things,
using enum's the way they are meant to be used, and the compiler
warning is just simply plain wrong.

I will take your patch to move it to W=2.

Thanks,
                   Linus


  reply	other threads:[~2025-02-08  3:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31 19:12 Bart Van Assche
2025-02-03 13:32 ` Vlastimil Babka
2025-02-08  0:49 ` Jakub Kicinski
2025-02-08  1:01   ` Linus Torvalds
2025-02-08  1:38     ` Jakub Kicinski
2025-02-08  2:18       ` Nathan Chancellor
2025-02-08  3:11       ` Linus Torvalds
2025-02-08  3:33         ` Nathan Chancellor
2025-02-08  3:49           ` Linus Torvalds [this message]
2025-02-08  4:24             ` Linus Torvalds
2025-02-10 18:33               ` Jakub Kicinski
2025-02-08  2:55     ` Bart Van Assche
2025-02-08  3:22       ` Linus Torvalds
2025-02-08  3:30         ` Bart Van Assche
2025-02-08 10:28 ` Matthew Wilcox
2025-02-11 14:34   ` Vlastimil Babka
2025-02-11 18:48     ` Bart Van Assche
2025-02-11 19:25       ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHk-=whe1UZUGKbtaaRV7CfS=sGtB2ouYAriryZ6bscE+5AFhA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=bvanassche@acm.org \
    --cc=david.laight@aculab.com \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=intelfx@intelfx.name \
    --cc=joel.granados@kernel.org \
    --cc=kaiyang2@cs.cmu.edu \
    --cc=kuba@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=rientjes@google.com \
    --cc=souravpanda@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox