Re: [PATCH] mm/vmstat: Fix a W=1 clang compiler warning

From: Bart Van Assche
Date: Wed Jan 22 2025 - 16:55:54 EST


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@xxxxxxx/. I think the patch I posted on December 13
requires fewer changes and no type casts.

Thanks,

Bart.