From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 3068D37F742 for ; Tue, 2 Jun 2026 20:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780432635; cv=none; b=sy2X7of72yVFpI2xi0Zsc7w+nf2FtdU/CZxJ/yQint1VcrU7WWPn2Nyo/evT99sj/H4fLLJt7DPz+MsW0Ox1txJsN44ZLjpeDZK4moSBDHpASpYcKaxyoWh9lq85/KO/W297sGSlFutQQ+PbsX7qwH5aoawCW9PC00no5hC/DBg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780432635; c=relaxed/simple; bh=HL0z7gxJYesR2g6T6tinyieUGKKjFVCsKLGvIxwVjuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nWmAA4x0rYJu+dKUuHYD9gL591W5p/2AN0dKVnqC1q47uWVh/HrLINoBEdYRwzVr050K2jvSvaMqrkw1TcjJ1Pqtaj3ZKxkMX7r0NvUTfjH2eErSAS4ru9dMHXt1Wj0CRVuoiwZLBD8IBa5GsYrwt30x1n+Ytxuxmy+VeeIlkP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kf/BCziU; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kf/BCziU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1780432633; x=1811968633; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HL0z7gxJYesR2g6T6tinyieUGKKjFVCsKLGvIxwVjuU=; b=kf/BCziUAngiowYwIY0lmr+G1Q9f6ajgN8YmL0FdvxqEHQ0Roev+F0FZ QUFvH9SHQEZeX7q6OaaWa/HnGIiU3k0AUKuHXr3jFe+6DmjoSV6tZRK+1 isfayF8WuwApGb99Z8njn3lFnrjh3jjDI7YKE1fOV5oK1Y1NokVtmyL4A jEoJC2IXl4wTqgzbAYVJzXA+gZyWjGJm7G/7BMlvrdZdfxA6uhxinJ7Av 7i1QXpjmOGSYBNNcoEWPZ/0nHOWcv3jCqBB7StTMxwaCFBN7G2jtn3y9b TGjXM7CYYEpHimfSniYXKj1PZls1Gg208cyfW40JiRLcj/b0CMa4PuUEC g==; X-CSE-ConnectionGUID: RleGhqJST/G/hfnCR89Kkg== X-CSE-MsgGUID: 3juDMZFAQGOkeSZX02CSMA== X-IronPort-AV: E=McAfee;i="6800,10657,11805"; a="81227219" X-IronPort-AV: E=Sophos;i="6.24,183,1774335600"; d="scan'208";a="81227219" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2026 13:37:13 -0700 X-CSE-ConnectionGUID: azZBPNs+Sdq6TykSHadqQw== X-CSE-MsgGUID: l+uANhteR+2IRo1vVhe3Xg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,183,1774335600"; d="scan'208";a="248940436" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa005.jf.intel.com with ESMTP; 02 Jun 2026 13:37:10 -0700 Received: by black.igk.intel.com (Postfix, from userid 1003) id 21C5699; Tue, 02 Jun 2026 22:37:09 +0200 (CEST) From: Andy Shevchenko To: Dmitry Antipov , Andy Shevchenko , Petr Mladek , linux-kernel@vger.kernel.org Cc: Andrew Morton , Steven Rostedt , Rasmus Villemoes , Sergey Senozhatsky , rodrigo.alencar@analog.com, dlechner@baylibre.com, jic23@kernel.org Subject: [PATCH v1 2/2] vsprintf: Convert to use _parse_integer() instead of _parse_integer_limit() Date: Tue, 2 Jun 2026 22:29:47 +0200 Message-ID: <20260602203706.103449-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260602203706.103449-1-andriy.shevchenko@linux.intel.com> References: <20260602203706.103449-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use _parse_integer() that allows optional arguments to be explicitly initialised. Signed-off-by: Andy Shevchenko --- lib/kstrtox.h | 3 +++ lib/vsprintf.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/kstrtox.h b/lib/kstrtox.h index 6c7ca3b67429..4299b1f92133 100644 --- a/lib/kstrtox.h +++ b/lib/kstrtox.h @@ -12,6 +12,9 @@ unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned lon #define _parse_integer0(s, base, res, ...) \ _parse_integer_limit(s, base, res, INT_MAX); +#define _parse_integer1(s, base, res, max_chars, ...) \ + _parse_integer_limit(s, base, res, max_chars); + #define _parse_integer(s, base, res, ...) \ CONCATENATE(_parse_integer, COUNT_ARGS(__VA_ARGS__))(s, base, res, __VA_ARGS__) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index a3017bc58986..1389b50266bf 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -86,7 +86,7 @@ static unsigned long long simple_strntoull(const char *startp, char **endp, unsi cp = _parse_integer_fixup_radix(startp, &base); prefix_chars = cp - startp; if (prefix_chars < max_chars) { - rv = _parse_integer_limit(cp, base, &result, max_chars - prefix_chars); + rv = _parse_integer(cp, base, &result, max_chars - prefix_chars); /* FIXME */ cp += (rv & ~KSTRTOX_OVERFLOW); } else { -- 2.50.1