From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 1549F37C930 for ; Wed, 3 Jun 2026 10:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780484085; cv=none; b=tSr3TkCRt9eBw+BGTtrAZkcOApoZpqF5wAUuim9GbamlURdwj7iFUzr6G+l7zvv4bNL4I+MevCWnfVdcv8j2O3Kt7aAGpwDqHWEe4a81AtguRi5MD8r4E+SBwmN9gPjfsugHfhtBAVLhUaNDWYwr4b2NHV5ZQzNz/xB7WnKiYXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780484085; c=relaxed/simple; bh=032aQRMdrd0HIVZEyXIBLaKlTC3IOzF29AKORnvLEy8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uiUir3C5e24s3lwaukgoIcYC4w97lG2YZxyZiK+jbxurXBXSQM0qH+7pHxTG6eS2OAaqLVqd7jnaFaIwP+AhI10cVXQxfhJ0ZIdyFiq1Z7dX7H6ORIKOFvvQJXBIWDbwa6JN32BfUeHb3TFaS4jZng6rjYV2Uhjhhg4u+auFa6g= 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=kQMOP3bD; arc=none smtp.client-ip=198.175.65.11 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="kQMOP3bD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1780484084; x=1812020084; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=032aQRMdrd0HIVZEyXIBLaKlTC3IOzF29AKORnvLEy8=; b=kQMOP3bDjwJJiEwsRFIYrCZMopAi2KnU2LF9vwWFjSym85yFSXHPZubA +4epalIP9gnH4PSHSN7AsLONH/wvoCIDX3kEAjvqe0/ITs1ac/kpjpeNB RLSZpKbd5qUdVEPA+adnSKK7wn3x/AmVHRuzOZh49of9kSZLivKFpranr Nh6txdFUjjtI+n1QC/5PlPbPr9+r1q/2/aOLnX7n5ZJoRxGZyPeZeFhGo eQoMmpEUTu038s0CIy+bS0/Fv44VX2sH8S+uOo84NwYcvO2gvf70WJzXG olZ9jU/e1qTHFg28X0t2LD+HQCTlKkslFIdaK/FZstqlX7kdBx/KCHLZu w==; X-CSE-ConnectionGUID: a3w4KVDHStewNfsvYevdEw== X-CSE-MsgGUID: wKeLz6WYSXeEiOFr1mh0sg== X-IronPort-AV: E=McAfee;i="6800,10657,11805"; a="91600060" X-IronPort-AV: E=Sophos;i="6.24,185,1774335600"; d="scan'208";a="91600060" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2026 03:54:44 -0700 X-CSE-ConnectionGUID: lfpjvxkwR2idPL/v/zxoIw== X-CSE-MsgGUID: kl5ejABJS1mGpVcyZ2cwYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,185,1774335600"; d="scan'208";a="241204307" Received: from pgcooper-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.244.116]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2026 03:54:41 -0700 Date: Wed, 3 Jun 2026 13:54:38 +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: <20260603113750.71c93100@pumpkin> 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 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") -- With Best Regards, Andy Shevchenko