[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aURpoO27Yys40ph7@casper.infradead.org>
Date: Thu, 18 Dec 2025 20:52:48 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Mike Rapoport <rppt@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/mm_init: Replace simple_strtoul with kstrtobool in
set_hashdist
On Wed, Dec 17, 2025 at 12:02:13PM +0100, Thorsten Blum wrote:
> Use bool for 'hashdist' and replace simple_strtoul() with kstrtobool()
> for parsing the 'hashdist=' boot parameter. Unlike simple_strtoul(),
> which returns an unsigned long, kstrtobool() converts the string
> directly to bool and avoids implicit casting.
>
> Check the return value of kstrtobool() and reject invalid values. This
> adds error handling while preserving behavior for existing values, and
> removes use of the deprecated simple_strtoul() helper. The current code
> silently sets 'hashdist = 0' if parsing fails, instead of leaving the
> default value (HASHDIST_DEFAULT) unchanged.
>
> Additionally, kstrtobool() accepts common boolean strings such as "on"
> and "off".
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Powered by blists - more mailing lists