From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lithops.sigma-star.at (mailout.nod.at [116.203.167.152]) (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 7C17C2F1FC9 for ; Thu, 7 May 2026 07:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.167.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778139458; cv=none; b=BHD9dVgQ6P6bZJkUNf/YzUKKOv0NjpYLE4+z9/3Ba0JzIvsjrqYGIEyweZAevNTue+xhnEWbThblAul8m0FBYLrzNb73hXMeoRtcjkXOCmoCAPRWe7Ugz74JALOucMbW5wdobH8uTnBr0rDkBA3KtAHCP6U9UIuypamvjDBdlY4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778139458; c=relaxed/simple; bh=9CKzLpKjABlxFbl7zSrY5itI02fV2GMP5O3GIgjd3Q8=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=EaBw5AbTIv+4xeDDI+RpyT+vX7403/5uRbAXphboWZzJbfu8hcSp/D1qU97uw4Jj6KrIV0K6YhacpCglCdZZ2tOdCupC+xIGbOjmjN53ujXTF939OHco4vqXvZEILw9k8eniyPC2ipjRW8kod2fF0vta5he4H4BcBASCrJn0Low= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at; spf=fail smtp.mailfrom=nod.at; arc=none smtp.client-ip=116.203.167.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nod.at Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 6364E298580; Thu, 7 May 2026 09:30:57 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id mcrtXndMeWBY; Thu, 7 May 2026 09:30:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id AF7F6298599; Thu, 7 May 2026 09:30:56 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Bom9-ahJ6Ly9; Thu, 7 May 2026 09:30:56 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 90161298580; Thu, 7 May 2026 09:30:56 +0200 (CEST) Date: Thu, 7 May 2026 09:30:56 +0200 (CEST) From: Richard Weinberger To: "haoyu.lu" Cc: Miquel Raynal , Vignesh Raghavendra , chengzhihao1 , linux-mtd , linux-kernel Message-ID: <713519488.1541.1778139056408.JavaMail.zimbra@nod.at> In-Reply-To: <20260507032308.16485-2-hechushiguitu666@gmail.com> References: <20260507032308.16485-1-hechushiguitu666@gmail.com> <20260507032308.16485-2-hechushiguitu666@gmail.com> Subject: Re: [PATCH 2/2] ubi: build: replace simple_strtoul with kstrtoul in bytes_str_to_int() 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=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF150 (Linux)/8.8.12_GA_3809) Thread-Topic: build: replace simple_strtoul with kstrtoul in bytes_str_to_int() Thread-Index: 0h1MJWAhwFwxoJ+/pjp6Sz58YMiUxg== ----- Urspr=C3=BCngliche Mail ----- > Von: "haoyu.lu" > An: "Miquel Raynal" , "richard" , "Vignesh Raghavendra" > CC: "chengzhihao1" , "linux-mtd" , "linux-kernel" > , "Haoyu Lu" > Gesendet: Donnerstag, 7. Mai 2026 05:23:08 > Betreff: [PATCH 2/2] ubi: build: replace simple_strtoul with kstrtoul in = bytes_str_to_int() > From: Haoyu Lu >=20 > Replace the deprecated simple_strtoul() with kstrtoul() in the > > bytes_str_to_int() helper function. Since kstrtoul() rejects trailing > non-numeric characters (such as the G/M/K suffixes), the numeric prefix > is first extracted with strspn() and then parsed separately before > handling the suffix. >=20 > This provides proper error handling through the kstrto* family while > preserving the existing suffix semantics for byte count parameters. >=20 > Note: the original simple_strtoul() with base=3D0 accepted hexadecimal > (0x prefix) and octal (0 prefix) formats, while kstrtoul() with base=3D10 > only supports decimal. This is not a practical concern since MTD byte > count parameters are always specified as decimal values in boot > parameters. >=20 > Signed-off-by: Haoyu Lu > --- > drivers/mtd/ubi/build.c | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) Your patch does not explain why this change is needed. >From what I can tell, it just makes the existing code more complex and fixes no real issues. Is simple_strtoul() really deprecated? If so, where? AFAICT, the documentation just mentions: "This function has caveats. Please use kstrtol instead." Do these these caveats hurt the current code? Thanks, //richard