From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 33E90380FF2 for ; Tue, 2 Jun 2026 20:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780432634; cv=none; b=OOjdQe/9X4JTAL1+UcIMoSJs2bjrpGdqFqm/X4A/EeZ3V3+4OU3FzSFKcoYCSVQTDaD4REmc4aRZPaCR8qTSyf2IwQUki5kSpelMjBjnJu1bTESJVkHmblGuYYsaigJ+DSPlqbcViMPKFkDuQw3DW2Q2S6gXfJOqVfs9lP0FZfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780432634; c=relaxed/simple; bh=6hKT7Ct26vjWqHaWg/XoVkQ9+S6Wqlg7huCc3q0xV9U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iyubxsn33f5Jnz+zj31qNAQmObEphwLTvswC3xho6u1UEicGFCeHA5jI4Y+ehfDtC40ldW/P4cjJofBFxRhFTogABYWNOxIqp+S5yJiqoyJtDntQmX4riYHUEQHyIOra9orpXAEztogu0G6PEglHdwlaAj0SUShbAVVvYNFersY= 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=hqfuER2o; arc=none smtp.client-ip=192.198.163.19 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="hqfuER2o" 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:mime-version: content-transfer-encoding; bh=6hKT7Ct26vjWqHaWg/XoVkQ9+S6Wqlg7huCc3q0xV9U=; b=hqfuER2outkA8+bDbvxukCFXivQYHH9gLKcW7Z1Yp7TBsBiy1vsAsq+9 Zvj2d9xEKQrvNc1Is6e7ZUqogV2VWcdwdIw09VINd/EG8+O9J4TbjUxE3 Xcp2fQdJH1aR6iP0KobpI/WtHaa+YvXQsSBwFhwJ1ioXcdei673BGdNuk 5EwMAw1PQygi4tPWD0hRwnQS8iYFZqJ57VS8dA2Rp1KTmGrYHSWR7Fqpu unuyxS4WELmLpSOeDudnv6nALp9hs1SR1p+ijIZVmnEP3DMWlk67SSLwg OM3ykA6E6jibR/kDe6NTcAltnLj/6LyzzGZF/0fZFOt2ar6CxyMrYEQL3 A==; X-CSE-ConnectionGUID: Wnn21w8tRViLPDwUzHc0aw== X-CSE-MsgGUID: DQ8tzGzSTbW10J5lndlVsA== X-IronPort-AV: E=McAfee;i="6800,10657,11805"; a="80261360" X-IronPort-AV: E=Sophos;i="6.24,183,1774335600"; d="scan'208";a="80261360" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2026 13:37:12 -0700 X-CSE-ConnectionGUID: cuLox6MPTYK4k7TG8UyWsg== X-CSE-MsgGUID: 9cwmLWZ+TU+hnZ2px7sQtQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,183,1774335600"; d="scan'208";a="237658490" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa009.fm.intel.com with ESMTP; 02 Jun 2026 13:37:10 -0700 Received: by black.igk.intel.com (Postfix, from userid 1003) id 195EB95; 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 0/2] kstrtox: make _parse_integer() flexible Date: Tue, 2 Jun 2026 22:29:45 +0200 Message-ID: <20260602203706.103449-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently every new wrapper on _parse_integer_limit() will need a new name to share with users while keeping some optional arguments to be initialised explicitly. Since there is an attempt to expand this more, I decided to suggest this mini series to avoid namespace pollution and unneeded churn in the future. To expand this API more, the possible future change may be: unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned long long *res, - size_t max_chars); + size_t max_chars, $new_opt_arg); #define _parse_integer0(s, base, res, ...) \ - _parse_integer_limit(s, base, res, INT_MAX); + _parse_integer_limit(s, base, res, INT_MAX, $new_opt_arg=$default); #define _parse_integer1(s, base, res, max_chars, ...) \ - _parse_integer_limit(s, base, res, max_chars); + _parse_integer_limit(s, base, res, max_chars, $new_opt_arg=$default); +#define _parse_integer2(s, base, res, max_chars, new_opt_arg, ...) \ + _parse_integer_limit(s, base, res, max_chars, new_opt_arg); So you got the idea. (It is roughly overloaded function in OOP.) Andy Shevchenko (2): kstrtox: Make _parse_integer() take variadic arguments vsprintf: Convert to use _parse_integer() instead of _parse_integer_limit() lib/kstrtox.c | 6 ------ lib/kstrtox.h | 12 +++++++++++- lib/vsprintf.c | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) -- 2.50.1