From nobody Sun Feb 8 22:50:34 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 468FF376484; Wed, 28 Jan 2026 19:51:18 +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=1769629879; cv=none; b=pT6TqRVtZcf0iUf+Rrpb18YKDcqm+hFdP+E7tpTxx4Q6Nxp98F4hg1UitX2rJQHnlBCbsfe21/IGIjpSwMxunHzWBAM5SbrNdL+Vpmf8kep7qt/gFbGRdcLwpS46N0V2jRGP4r7LTBKi6k4b8SDSD7bFuLb3Y6FSjxdlh0aEt+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769629879; c=relaxed/simple; bh=8+wuQByuSs/zlhocxDdq4277t26sSvBf8dUvM/PDsws=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=izVvjCEb8IaP5994Cgw/hqgMXPGksOL0cpN04758rHbXsoESb2pzHPrwrXgwnHXATqAObuEvxLydd8sfnGe2wAxDcMMXwBglejnFakocbFAyNoq0lB8ZSIoeFNOdrtQVsqeYyHnFgyj7dyjD1wd+GkNTjYCTcJiFYaVjf1leQzM= 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=fSCRac5x; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=32zeif+j; 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="fSCRac5x"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="32zeif+j" Date: Wed, 28 Jan 2026 19:51:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1769629876; 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: in-reply-to:in-reply-to:references:references; bh=eNWVnDts6rd2IWsOVMcpfQpGdB03jqdvRzqnYvk3ZkE=; b=fSCRac5xxazMd1Qj+EFUYAmvN8A7I87G/FdZ7oj9xLO6wgGtjQFNzB61SvDqVyztepCM/n ueVIsWNyFeP6eCpztGWOPpIXQ8f5342yv3UYJ08gvsQwtuQeGhqcIZKiFI2a/ahOi/bxxO UDdyIzcCWt+miDjpyOyZiKH+FaFkFaJ99E6MN78Vz8ii2Oho/7eGv1/klhFp28fGuPMxJF ruhrCG36PSolSovkS/KCcpHIVydFwAkH5iL6Hq5KiFVORrmm1oiijGv7BzoDZDJLi9MJb1 NfAfSJiKoeDYwNYnShwyu2xR5Hn/8NAPXRSigoUDMKv6vopx9xoxqKtUZK+axw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1769629876; 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: in-reply-to:in-reply-to:references:references; bh=eNWVnDts6rd2IWsOVMcpfQpGdB03jqdvRzqnYvk3ZkE=; b=32zeif+jmoHmtEz4bY/q23Cr5N3lI2I0zQuop6Nq0yGAD4CCUtHSXN4qH3ryV0D68rVsoB 992wlwF0XSnkRPCw== From: "tip-bot2 for Marco Elver" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] cleanup: Make __DEFINE_LOCK_GUARD handle commas in initializers Cc: kernel test robot , Marco Elver , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260119094029.1344361-2-elver@google.com> References: <20260119094029.1344361-2-elver@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <176962987569.2495410.4252123660824990120.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 locking/core branch of tip: Commit-ID: 3b9ed30344a866f6f96896b3ce64303b9074682b Gitweb: https://git.kernel.org/tip/3b9ed30344a866f6f96896b3ce64303b9= 074682b Author: Marco Elver AuthorDate: Mon, 19 Jan 2026 10:05:51 +01:00 Committer: Peter Zijlstra CommitterDate: Wed, 28 Jan 2026 20:45:24 +01:00 cleanup: Make __DEFINE_LOCK_GUARD handle commas in initializers Initialization macros can expand to structure initializers containing commas, which when used as a "lock" function resulted in errors such as: >> include/linux/spinlock.h:582:56: error: too many arguments provided to f= unction-like macro invocation 582 | DEFINE_LOCK_GUARD_1(raw_spinlock_init, raw_spinlock_t, raw_spin_= lock_init(_T->lock), /* */) | ^ include/linux/spinlock.h:113:17: note: expanded from macro 'raw_spin_loc= k_init' 113 | do { *(lock) =3D __RAW_SPIN_LOCK_UNLOCKED(lock); } while= (0) | ^ include/linux/spinlock_types_raw.h:70:19: note: expanded from macro '__R= AW_SPIN_LOCK_UNLOCKED' 70 | (raw_spinlock_t) __RAW_SPIN_LOCK_INITIALIZER(lockname) | ^ include/linux/spinlock_types_raw.h:67:34: note: expanded from macro '__R= AW_SPIN_LOCK_INITIALIZER' 67 | RAW_SPIN_DEP_MAP_INIT(lockname) } | ^ include/linux/cleanup.h:496:9: note: macro '__DEFINE_LOCK_GUARD_1' defin= ed here 496 | #define __DEFINE_LOCK_GUARD_1(_name, _type, _lock) = \ | ^ include/linux/spinlock.h:582:1: note: parentheses are required around ma= cro argument containing braced initializer list 582 | DEFINE_LOCK_GUARD_1(raw_spinlock_init, raw_spinlock_t, raw_spin_= lock_init(_T->lock), /* */) | ^ | ( include/linux/cleanup.h:558:60: note: expanded from macro 'DEFINE_LOCK_G= UARD_1' 558 | __DEFINE_UNLOCK_GUARD(_name, _type, _unlock, __VA_ARGS__) = \ | = ^ Make __DEFINE_LOCK_GUARD_0 and __DEFINE_LOCK_GUARD_1 variadic so that __VA_ARGS__ captures everything. Reported-by: kernel test robot Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260119094029.1344361-2-elver@google.com --- include/linux/cleanup.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/cleanup.h b/include/linux/cleanup.h index ee6df68..dbc4162 100644 --- a/include/linux/cleanup.h +++ b/include/linux/cleanup.h @@ -493,22 +493,22 @@ static __always_inline void class_##_name##_destructo= r(class_##_name##_t *_T) \ \ __DEFINE_GUARD_LOCK_PTR(_name, &_T->lock) =20 -#define __DEFINE_LOCK_GUARD_1(_name, _type, _lock) \ +#define __DEFINE_LOCK_GUARD_1(_name, _type, ...) \ static __always_inline class_##_name##_t class_##_name##_constructor(_type= *l) \ __no_context_analysis \ { \ class_##_name##_t _t =3D { .lock =3D l }, *_T =3D &_t; \ - _lock; \ + __VA_ARGS__; \ return _t; \ } =20 -#define __DEFINE_LOCK_GUARD_0(_name, _lock) \ +#define __DEFINE_LOCK_GUARD_0(_name, ...) \ static __always_inline class_##_name##_t class_##_name##_constructor(void)= \ __no_context_analysis \ { \ class_##_name##_t _t =3D { .lock =3D (void*)1 }, \ *_T __maybe_unused =3D &_t; \ - _lock; \ + __VA_ARGS__; \ return _t; \ } =20