All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: 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>,
	Nathan Chancellor <nathan@kernel.org>,
	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, Nathan Chancellor <nathan@kernel.org>
Subject: Re: [PATCH] mm: Fix clang W=1 compiler warnings
Date: Fri, 7 Feb 2025 17:38:13 -0800	[thread overview]
Message-ID: <20250207173813.5081ba76@kernel.org> (raw)
In-Reply-To: <CAHk-=wiCJow8C+_fJvZ77taCf0oN0_X7NOR-BaECT2jV0Q-F9g@mail.gmail.com>

On Fri, 7 Feb 2025 17:01:00 -0800 Linus Torvalds wrote:
> On Fri, 7 Feb 2025 at 16:49, Jakub Kicinski <kuba@kernel.org> wrote:
> > Could we possibly please still consider taking this in for 6.14? :(
> > Since the warning comes from vmstat.h pretty much every object file
> > generates this warning. clang 19 is getting more widely used now,
> > its making it hard to see new warnings.  
> 
> So:
> 
>  - I build the kernel with clang, but I don't have clang-19, so it's
> kind of pointless sending patches that DO NOT EVEN EXPLAIN WHAT THE
> WARNINGS ARE.
> 
>  - and even if you explain *WHAT* the warnings are, please also
> explain *WHY* they are valid and should be cared about.
> 
> Because honestly, W=1 is literally meant for "warnings that aren't
> necessarily valid". That's why they aren't on by default.
> 
> So no, I'm certainly not applying unexplained random patches that
> don't bother to explain the what or the why. Not for 6.14, not ever.

I thought I'd ask.. :) FWIW this for every single object:

  CC      net/core/request_sock.o
In file included from ../net/core/request_sock.c:14:
In file included from ../include/linux/tcp.h:17:
In file included from ../include/linux/skbuff.h:17:
In file included from ../include/linux/bvec.h:10:
In file included from ../include/linux/highmem.h:8:
In file included from ../include/linux/cacheflush.h:5:
In file included from ../arch/x86/include/asm/cacheflush.h:5:
In file included from ../include/linux/mm.h:2224:
../include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
  504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
      |                            ~~~~~~~~~~~~~~~~~~~~~ ^
  505 |                            item];
      |                            ~~~~
../include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
  511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
      |                            ~~~~~~~~~~~~~~~~~~~~~ ^
  512 |                            NR_VM_NUMA_EVENT_ITEMS +
      |                            ~~~~~~~~~~~~~~~~~~~~~~
../include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
  524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
      |                            ~~~~~~~~~~~~~~~~~~~~~ ^
  525 |                            NR_VM_NUMA_EVENT_ITEMS +
      |                            ~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.

> Fix the patch. Explain the problem. And possibly just disable the warning.

That'd be great. Nathan, would that be okay with you?

  reply	other threads:[~2025-02-08  1:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31 19:12 [PATCH] mm: Fix clang W=1 compiler warnings 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 [this message]
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
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=20250207173813.5081ba76@kernel.org \
    --to=kuba@kernel.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=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=torvalds@linux-foundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.