From nobody Sun Jun 14 02:36:45 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 DDE053CF05F; Mon, 4 May 2026 13:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777899707; cv=none; b=IvALkIpnSOhsiI+tq0UBhsE6FBbEfjb71wyavp4dXJ7QSUQpvvDNxSiAp+Yy66OXcMpwZZznVWWoADj6qppqSy7TetKdldDCY8eV0ATKs/kjU2+X3ha2EzrjDLACeebA/glE0xSSdbQilUPeyX2FblVbBvFtpledR/vUVqIXJpQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777899707; c=relaxed/simple; bh=vkS2tV8oJ50OkjniB5FZTIbph5OatObyPLPJCtKKA+A=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=XNpb5ZcMtQIoHdlr7BPRvPGmeQMNuDOP1A40nD34hyxZjIM+Hd2MD6nXEcueZJryL+VcLEl5PbEWSYXEeUwFhzR3uhno4iB5HAwOUL4po2x3kIXGuoXv3FIdkM/Ln126r1s9X/pQN2FEzOE/1rcHWnzdB6j6yyR49/r5IUdPVNo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zqLzfY7j; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mZY/17R4; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zqLzfY7j"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mZY/17R4" Date: Mon, 04 May 2026 13:01:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777899704; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kAMKlaVsGoJPf43o1WwlK5NL1UORDuMXlMJuHMN5KkQ=; b=zqLzfY7jv9dFXNn6QxmA23FDs03KUYnntUEHv84Jsi/tXmweqjD+ghJfwrPfsEkpaTIzt5 gCIpBiBQIZ5y3C1WLUlKQFGHRvcgBCbDeB+z9X5dAqKiINkWFHJWTekChErHufnb6nUQxo aDhjbQz3iB97yG1nxNGiWZeZrSYVW+EIpyEK9lJoGx+Ml5oa5IKoPD8E38cg/IcxN4S6m2 vf8rhiubymnWFVRKbEFMs5NH46el34VP97X885WiABmqveyAovsxTm01vfespnxelHMMKV BZcc4zmGBMSRViRlUW+jKlEHfq5MnpUZels13aILEFJFBxzFz+wjFwE35bXFSA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777899704; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kAMKlaVsGoJPf43o1WwlK5NL1UORDuMXlMJuHMN5KkQ=; b=mZY/17R4rHioqHCUaxInQR9t2MEWYcCmMkfZ0YA+cMS1WVoADVyh3IiQV6S0VMhZBErJ53 wGSzRJ01XlCNg0AQ== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cleanups] x86/boot: Get rid of kstrtoull() Cc: "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177789970280.424702.15895745780191946820.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: 0c37d7aca413619b213d4d998f03379e6cf1ef54 Gitweb: https://git.kernel.org/tip/0c37d7aca413619b213d4d998f03379e6= cf1ef54 Author: Borislav Petkov (AMD) AuthorDate: Mon, 04 May 2026 14:26:13 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 04 May 2026 14:26:13 +02:00 x86/boot: Get rid of kstrtoull() Fold the '+' check in the single-underscore-prefixed version _kstrtoull() and remove the function. The arch/x86/boot/ namespace prefixes everything copied from kernel proper with "boot_" so that namespace clashes can be avoided. No functional changes. Signed-off-by: Borislav Petkov (AMD) --- arch/x86/boot/string.c | 30 +++++------------------------- arch/x86/boot/string.h | 1 - 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c index b25c6a9..ac0f900 100644 --- a/arch/x86/boot/string.c +++ b/arch/x86/boot/string.c @@ -289,6 +289,9 @@ static int _kstrtoull(const char *s, unsigned int base,= unsigned long long *res) unsigned long long _res; unsigned int rv; =20 + if (s[0] =3D=3D '+') + s++; + s =3D _parse_integer_fixup_radix(s, &base); rv =3D _parse_integer(s, base, &_res); if (rv & KSTRTOX_OVERFLOW) @@ -304,35 +307,12 @@ static int _kstrtoull(const char *s, unsigned int bas= e, unsigned long long *res) return 0; } =20 -/** - * kstrtoull - convert a string to an unsigned long long - * @s: The start of the string. The string must be null-terminated, and ma= y also - * include a single newline before its terminating null. The first charac= ter - * may also be a plus sign, but not a minus sign. - * @base: The number base to use. The maximum supported base is 16. If bas= e is - * given as 0, then the base of the string is automatically detected with= the - * conventional semantics - If it begins with 0x the number will be parse= d as a - * hexadecimal (case insensitive), if it otherwise begins with 0, it will= be - * parsed as an octal number. Otherwise it will be parsed as a decimal. - * @res: Where to write the result of the conversion on success. - * - * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error. - * Used as a replacement for the obsolete simple_strtoull. Return code must - * be checked. - */ -int kstrtoull(const char *s, unsigned int base, unsigned long long *res) -{ - if (s[0] =3D=3D '+') - s++; - return _kstrtoull(s, base, res); -} - static int _kstrtoul(const char *s, unsigned int base, unsigned long *res) { unsigned long long tmp; int rv; =20 - rv =3D kstrtoull(s, base, &tmp); + rv =3D _kstrtoull(s, base, &tmp); if (rv < 0) return rv; if (tmp !=3D (unsigned long)tmp) @@ -364,7 +344,7 @@ int boot_kstrtoul(const char *s, unsigned int base, uns= igned long *res) */ if (sizeof(unsigned long) =3D=3D sizeof(unsigned long long) && __alignof__(unsigned long) =3D=3D __alignof__(unsigned long long)) - return kstrtoull(s, base, (unsigned long long *)res); + return _kstrtoull(s, base, (unsigned long long *)res); else return _kstrtoul(s, base, res); } diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h index a5b05eb..4092bf2 100644 --- a/arch/x86/boot/string.h +++ b/arch/x86/boot/string.h @@ -28,6 +28,5 @@ extern unsigned long long simple_strtoull(const char *cp,= char **endp, unsigned int base); long simple_strtol(const char *cp, char **endp, unsigned int base); =20 -int kstrtoull(const char *s, unsigned int base, unsigned long long *res); int boot_kstrtoul(const char *s, unsigned int base, unsigned long *res); #endif /* BOOT_STRING_H */