From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 14FA511CA9 for ; Wed, 3 Jun 2026 10:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780484191; cv=none; b=iDHBIvAh/1+1A0xq+3orsiyNr50Os72YM808hBQnf+V1UuN2y6nZCCkWGF6I9Dc6vJuhgNK57+OqPsN/lAl/QfnfXD40IEXsdxkmOLNjlunRH7P/7w80477TF2oBiKajuTnmN8Lk4hPDVdMnqRUHMmj2UFkazfm5kqSsN8/+fC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780484191; c=relaxed/simple; bh=hLfyCytEW1Cjm86tSIwfzPzYhREs5AaQjjD//cjXpWM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YuCOUd6/2oTNcnxi+YdPWnNJ/vsaPAiR0+aztc1ZiIc1Dj/WhEcsF77JKArj57vh2uqq+60K5cvTLBPx1gWJP5tCrbiYdtyIF2b9o7B7BiRIDRyXGaZRJAzs3Xd/RQzuJ0PPN1Clq3mPTCoKm10FVBLFS4GZb+tiFwZfwbowlX8= 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=IUNlPNO3; arc=none smtp.client-ip=192.198.163.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="IUNlPNO3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1780484190; x=1812020190; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hLfyCytEW1Cjm86tSIwfzPzYhREs5AaQjjD//cjXpWM=; b=IUNlPNO3CxpSsnV97tc2/oUihQbryhaLrRDjASh/7tAx9/yHilYzHXvO ytRl6v9jo9lZRbrN/xqKu51hVCTyPrlANCizGrOOj3x11UoXyjoEdZ/vs Cg3x9e4K6jiIryDRDXjbI9WDZKyKKjuiCGHWMRapstL/k8DJiDunSFanF vKiXHWZ2c0OELAwtOSsjX1qzXLXZAWlnsXGqF/8qMw2HT8G2c8fFe/anm sDGzZrwErcRGtWUYrg8b7XSWP04bv3EAbph7Vam+OBWJJrWP2UB4gu3tZ hd8hOgNSUj3vBshljEEWPlY5qSFN09GatZz/DDwm0F4XOn2xlxxccaIRB Q==; X-CSE-ConnectionGUID: yh74fnuCTvS1TKwnk9j0KQ== X-CSE-MsgGUID: +LIuOoelRy6eLP96rzDayw== X-IronPort-AV: E=McAfee;i="6800,10657,11805"; a="81145537" X-IronPort-AV: E=Sophos;i="6.24,185,1774335600"; d="scan'208";a="81145537" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2026 03:56:29 -0700 X-CSE-ConnectionGUID: ZY0EdR7xSn2yYKTfWWw5Hw== X-CSE-MsgGUID: fSnd/9lSTmypUDCfIOUUOA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,185,1774335600"; d="scan'208";a="237838206" Received: from pgcooper-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.244.116]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2026 03:56:27 -0700 Date: Wed, 3 Jun 2026 13:56:24 +0300 From: Andy Shevchenko To: David Laight Cc: Dmitry Antipov , Petr Mladek , linux-kernel@vger.kernel.org, Andrew Morton , Steven Rostedt , Rasmus Villemoes , Sergey Senozhatsky , rodrigo.alencar@analog.com, dlechner@baylibre.com, jic23@kernel.org Subject: Re: [PATCH v1 1/2] kstrtox: Make _parse_integer() take variadic arguments Message-ID: References: <20260602203706.103449-1-andriy.shevchenko@linux.intel.com> <20260602203706.103449-2-andriy.shevchenko@linux.intel.com> <20260603113750.71c93100@pumpkin> 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: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Wed, Jun 03, 2026 at 01:54:43PM +0300, Andy Shevchenko wrote: > On Wed, Jun 03, 2026 at 11:37:50AM +0100, David Laight wrote: > > On Tue, 2 Jun 2026 22:29:46 +0200 > > Andy Shevchenko wrote: > > > Instead of having different functions that just use default parameters, > > > combine those to use variadic arguments, so the user may call it using > > > the same name. > > > > Adding a default final parameter can be done generically: > > Only one? > > > #define one(v) v > > #define first(v, ...) v > > #define dflt(d, ...) first(__VA_OPT__(one(__VA_ARGS__) ,) d) > > > > int foo(int, int); > > #define foo(a, ...) foo(a, dflt(42, ## __VA_ARGS__)) > > > > See: https://godbolt.org/z/x5aao7reK > > I know, we support some GCC versions that do not provide it. > > 551d44200152 ("default_gfp(): avoid using the "newfangled" __VA_OPT__ trick") I stand corrected, it's all about sparse. Since this is the generic header, I would also avoid using VA_OPT even if it allows more than one optional argument. -- With Best Regards, Andy Shevchenko