From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 7D3D62E7645 for ; Thu, 18 Dec 2025 20:52:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766091175; cv=none; b=aSFmVPXLJAnOU2Y5rZQ8ykDp42B9z1fEkdF6VHjGg2oEMlLHyCDKoA/nbQXLkR1lB9PBz0fu0Sk97MeJMo42tKVTUPMSbTaEqOkLsCkAU0aERZSpwHYufKb3NLY2CfxyRPWw+GLxS5FOKJkGDCRk3/JoJshCgl8B1zF6Y1yYC3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766091175; c=relaxed/simple; bh=EQ6mCeQlUbsRJuBy/2qdxeKan5gDejmwKAXrS6qYSdk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gZJC1Ok2AM3xFu5w5YhzQPqjEayLYg+U5R2AMTvvZwPBbyYvfzErdxavy42Gv5TZH4I9ChAa35SZ2Hh29tNiv5rWG7vYFt0yYk1PS81SOZnKFFVXVlKngOIwDTnU3m4lErh7qwNBfAbRsUhchiRW6YgcCd5V9bStPUoqcehYEuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=NC3NkNKE; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NC3NkNKE" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UMqge3Wm+VgxLTio4FdN8OAle0L311HBGFZuKMtmTVI=; b=NC3NkNKEqvSl+1+wnRQ3dT1Ccy yLv0g9PFBKHZJIJs/ccOu/TtJ+ODpZdnt8Y5O3S3yC0ud6D268K9zbO7S+aHRxni5yrR7mZDShYlH Jc8YqUbuyMTN3Pyu5qSTolnIMyROB6C+0rNAsbroio4UnZrKp4mUi0kpCkLHOsNhFkTZwrsGV7KIX 5XRnmMd3cwDRp0iU21ny5Pvzo8aq1pkpljdKrmFbdz7VKjAzwVufKY7PANl42kChD5ZTA7df2yzas GyHiUgdNMGBNxkURETEH0Sf4nX1WRcpeC8djYxgwv1q73bUzviHxWb12n1wjg3Lrug0hY5MlsyR+V U7NEpsBw==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1vWKzQ-00000006cUq-2uRN; Thu, 18 Dec 2025 20:52:48 +0000 Date: Thu, 18 Dec 2025 20:52:48 +0000 From: Matthew Wilcox To: Thorsten Blum Cc: Mike Rapoport , 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: Matthew Wilcox (Oracle)