[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74D5BC8AD7E5511A+13242b55-13e5-463a-9422-f863d58b6af6@uniontech.com>
Date: Wed, 7 May 2025 12:06:11 +0800
From: WangYuli <wangyuli@...ontech.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, yuzhao@...gle.com,
stevensd@...omium.org, kaleshsingh@...gle.com, zhanjun@...ontech.com,
niecheng1@...ontech.com, guanwentao@...ontech.com,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH] mm: vmscan: Avoid signedness error for GCC 5.4
Hi Andrew Morton,
On 2025/5/7 07:24, Andrew Morton wrote:
> On Wed, 7 May 2025 00:02:38 +0800 WangYuli <wangyuli@...ontech.com> wrote:
>
> Make `tier' unsigned? After all, negative tier numbers are nonsensical.
That point is well taken.
However, I've noticed that variables named "tier" seem to be commonly
defined as int rather than unsigned int throughout the mm subsystem, and
perhaps even the wider kernel code.
I was wondering if changing just this one instance might feel a little
inconsistent?
Perhaps a possible approach for now could be to change this line to for
(i = tier % MAX_NR_TIERS; i <= min_t(int, tier, MAX_NR_TIERS - 1); i++)
{, which would allow us to keep the signed int type for the tier
variable itself.
Regarding the potential for a more comprehensive change in the future to
redefine all these "tier" variables and related ones as unsigned int, I
would be very grateful for your guidance on whether that's a direction
we should consider.
But actually, whether it's signed or not likely won't affect its normal
operation...
Thanks,
--
WangYuli
Download attachment "OpenPGP_0xC5DA1F3046F40BEE.asc" of type "application/pgp-keys" (633 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)
Powered by blists - more mailing lists