From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6CC21A267 for ; Fri, 19 Dec 2025 06:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766126927; cv=none; b=RHQZj0YKJTqrNH3C6Vd/Nt/vqfG1xEoJpQc9RgzFhFqJAoZGDcm72LwMpyZ1VKuSpMA+RpfKAdNQquII/7EqwReLkp8Tbo6M9zblZwIJQOnpGs/vglcIw/OJE12kAmi1lKPcWyiY7h0kY782AHTqK791dYUWGK8GEwhl/XZLZ0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766126927; c=relaxed/simple; bh=/ySOtmeMRDp4N9rbZ2NlzdqHyHV/b+UP5NXd1nymqo8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=awdUZLI9xQmd/j0AXsu3B+Gur8wbCzaHs2G5XpV3NE1gZh6lPvs8yPwwwWV/On09xdVsj9XPz3sZP3aWMX8j2cAO3BRa0BV6qdnJ2AhD9xo7w2ESCeloEcE7I+nX6FJM+ibG0h7xg3h4P5uhCSrlzXsxRfbxQNDDZZdFRoo9E9s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JelpeCHz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JelpeCHz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F4B1C4CEF1; Fri, 19 Dec 2025 06:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766126926; bh=/ySOtmeMRDp4N9rbZ2NlzdqHyHV/b+UP5NXd1nymqo8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JelpeCHzi74fL/WhpTjc54Vx0PrM6nNhvgo+NU9h8a7SXlcx592szoj8iwAjACiiD BSNadqpOMXh0OHj3wWfJaEWH5xLQCiMjL8zrG+Izx1mk73zGFi7mJoJys2O1sYQbjK +3h2V2RAYCx6NNrsQkGwQUXbzG4txMsBiiaQMbe3qOXefDtg5CcYUY/GoEDQTorn7X UMnPjeCJawrpP53K7M7MVd7sMVWIsBufV0oxHyo0D3Hh/CuONcpqgkfODzwnYsZz1a ADhVohJluwwR5lGKHl4xWn0nLrZOyWnTT1eqD3K2s6HgS8n53zQOjOPmT9+j0/6sWa 9l6dxl1xuJwfQ== Date: Fri, 19 Dec 2025 08:48:40 +0200 From: Mike Rapoport To: Thorsten Blum Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/mm_init: Replace simple_strtoul with kstrtobool in set_hashdist Message-ID: References: <20251217110214.50807-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Reviewed-by: Mike Rapoport (Microsoft) > --- > include/linux/memblock.h | 4 ++-- > mm/mm_init.c | 9 +++------ > 2 files changed, 5 insertions(+), 8 deletions(-) -- Sincerely yours, Mike.