All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mm_init: Replace simple_strtoul with kstrtobool in set_hashdist
Date: Fri, 19 Dec 2025 08:48:40 +0200	[thread overview]
Message-ID: <aUT1SCTniYr7PA07@kernel.org> (raw)
In-Reply-To: <20251217110214.50807-1-thorsten.blum@linux.dev>

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@linux.dev>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
>  include/linux/memblock.h | 4 ++--
>  mm/mm_init.c             | 9 +++------
>  2 files changed, 5 insertions(+), 8 deletions(-)

-- 
Sincerely yours,
Mike.


      parent reply	other threads:[~2025-12-19  6:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-17 11:02 [PATCH] mm/mm_init: Replace simple_strtoul with kstrtobool in set_hashdist Thorsten Blum
2025-12-18 20:52 ` Matthew Wilcox
2025-12-19  6:48 ` Mike Rapoport [this message]

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=aUT1SCTniYr7PA07@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=thorsten.blum@linux.dev \
    /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.