[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2b2dfbf2-7d17-4576-b0fe-2e13d563cf47@acm.org>
Date: Wed, 22 Jan 2025 13:55:31 -0800
From: Bart Van Assche <bvanassche@....org>
To: Ivan Shapovalov <intelfx@...elfx.name>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
<morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
Pasha Tatashin <pasha.tatashin@...een.com>,
David Rientjes <rientjes@...gle.com>, David Hildenbrand <david@...hat.com>,
Vlastimil Babka <vbabka@...e.cz>, Joel Granados <joel.granados@...nel.org>,
Sourav Panda <souravpanda@...gle.com>, Kaiyang Zhao <kaiyang2@...cmu.edu>,
Johannes Weiner <hannes@...xchg.org>,
Konstantin Khlebnikov <koct9i@...il.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] mm/vmstat: Fix a W=1 clang compiler warning
On 1/21/25 5:57 PM, Ivan Shapovalov wrote:
>> Spose so. One always suspects that adding a typecast is a sign that we
>> screwed things up somehow. The relationship between enums lru_list and
>> node_stat_item is foggy, and I'm unsure whether this is the place to
>> make the transition it. Perhaps lru_list_name() should take an
>> `unsigned int' arg instead.
>
> All of these *_name() functions do seem to expect arguments in range of
> the corresponding enums, so perhaps keep those args typed as a form of
> self-documenting code, and do this instead?
>
> [ ... ]
Please take a look at
https://lore.kernel.org/linux-mm/8640d744-d182-474b-9059-204bcea47d1a@acm.org/.
I think the patch I posted on December 13
requires fewer changes and no type casts.
Thanks,
Bart.
Powered by blists - more mailing lists