From nobody Mon Dec 1 22:36:16 2025 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 F004DD27E; Mon, 1 Dec 2025 06:01:20 +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=1764568882; cv=none; b=iDRpOqmHJV28Mfr1IawPcqddI11giF1Di3vgGFoy9Ie6Gl6VB5qsxOobLJSzx+m1MZUw5fsa2mxTyW9dpWD2C5rkaKfDzKl6geCBJpYCfwneEOVGYZt9deb9ol88ALyDyCtjK9T2wQOyuI5BJOiMPFZqTyGrFv5UUe43+fPLQCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764568882; c=relaxed/simple; bh=T+Mmi60qo9WFpMaRlOJ7SA5WEW1VTNerIajgJCZslAE=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=FzLUgyzL60QIqBVbvxQ7p49SYE2UzC/XVk5jCWjeSy0EwjWPOWqnATf8785uFrUlfx6+Ax/WDYXi12EzgzhKRlDd9kiS1aGQtjY9oFi1ooFbs7RqPf6IYn8aE6jZ5wQdubOg2UIRkLDbwLK+z2GCn+vXwQVqaG6mf5EbcHFf+KQ= 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=amlXytOA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NmfcFFy8; 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="amlXytOA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NmfcFFy8" Date: Mon, 01 Dec 2025 06:01:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1764568873; 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=tP70tBrGu/d1TXN8irDMdGBmtBWULOng3+CUyy+vKLE=; b=amlXytOAt33Srip0+sWNtLdyh4kZgWbcArMaxb/++WLdQPrO5N9ERGCS99kDvrzGMbAcTD 8vmjtJLAuIyK1OA4oCWfe1DNrYcC+aBMnkXgdnTzaLMyDQPyLU7gupvfUlG/HYulF5gFpA c5i11H6shePxHK1LcAGL4ivmPsmQs4Z7M0C1J9JHQHNGzUve5ovl2K/yNl/5CPtfci1WKZ nqiXc2Typ9BBLK56xrGemu8bCWg79HvEgINH7rcdnJFVQ1y5vM1mb+Mtp0Dt4lIBva21cA SEdaJnKH1qwpeNcXxvPy1zlifGpsxjG8Ijhq8IEogh2WoHcJgF+udkiiH8k+ZA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1764568873; 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=tP70tBrGu/d1TXN8irDMdGBmtBWULOng3+CUyy+vKLE=; b=NmfcFFy89jU2ZlNTxjp60qMOXOKVw4j3qCdbjqneE3gLoGrKrbdXW4nn8lGgNNcnmPvdZL gsAwK56cK+vlWWBA== From: "tip-bot2 for Vincent Mailhol" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce the risk of shadowing Cc: Vincent Mailhol , Sebastian Andrzej Siewior , "Peter Zijlstra (Intel)" , Ingo Molnar , Waiman Long , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20251127144140.215722-3-bigeasy@linutronix.de> References: <20251127144140.215722-3-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <176456887168.498.5797505081932873516.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: 719e357fc09c63238956eb7cd546627f9e050640 Gitweb: https://git.kernel.org/tip/719e357fc09c63238956eb7cd546627f9= e050640 Author: Vincent Mailhol AuthorDate: Thu, 27 Nov 2025 15:41:40 +01:00 Committer: Ingo Molnar CommitterDate: Mon, 01 Dec 2025 06:56:16 +01:00 locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce the risk of shadowing The Linux kernel coding style advises to avoid common variable names in function-like macros to reduce the risk of namespace collisions. Throughout local_lock_internal.h, several macros use the rather common variable names 'l' and 'tl'. This already resulted in an actual collision: the __local_lock_acquire() function like macro is currently shadowing the parameter 'l' of the: class_##_name##_t class_##_name##_constructor(_type *l) function factory from . Rename the variable 'l' to '__l' and the variable 'tl' to '__tl' throughout the file to fix the current namespace collision and to prevent future ones. [ bigeasy: Rebase, update all l and tl instances in macros ] Signed-off-by: Vincent Mailhol Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Acked-by: Waiman Long Link: https://patch.msgid.link/20251127144140.215722-3-bigeasy@linutronix.de --- include/linux/local_lock_internal.h | 62 ++++++++++++++-------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock= _internal.h index a4dc479..8f82b4e 100644 --- a/include/linux/local_lock_internal.h +++ b/include/linux/local_lock_internal.h @@ -99,18 +99,18 @@ do { \ =20 #define __local_lock_acquire(lock) \ do { \ - local_trylock_t *tl; \ - local_lock_t *l; \ + local_trylock_t *__tl; \ + local_lock_t *__l; \ \ - l =3D (local_lock_t *)(lock); \ - tl =3D (local_trylock_t *)l; \ + __l =3D (local_lock_t *)(lock); \ + __tl =3D (local_trylock_t *)__l; \ _Generic((lock), \ local_trylock_t *: ({ \ - lockdep_assert(tl->acquired =3D=3D 0); \ - WRITE_ONCE(tl->acquired, 1); \ + lockdep_assert(__tl->acquired =3D=3D 0); \ + WRITE_ONCE(__tl->acquired, 1); \ }), \ local_lock_t *: (void)0); \ - local_lock_acquire(l); \ + local_lock_acquire(__l); \ } while (0) =20 #define __local_lock(lock) \ @@ -133,36 +133,36 @@ do { \ =20 #define __local_trylock(lock) \ ({ \ - local_trylock_t *tl; \ + local_trylock_t *__tl; \ \ preempt_disable(); \ - tl =3D (lock); \ - if (READ_ONCE(tl->acquired)) { \ + __tl =3D (lock); \ + if (READ_ONCE(__tl->acquired)) { \ preempt_enable(); \ - tl =3D NULL; \ + __tl =3D NULL; \ } else { \ - WRITE_ONCE(tl->acquired, 1); \ + WRITE_ONCE(__tl->acquired, 1); \ local_trylock_acquire( \ - (local_lock_t *)tl); \ + (local_lock_t *)__tl); \ } \ - !!tl; \ + !!__tl; \ }) =20 #define __local_trylock_irqsave(lock, flags) \ ({ \ - local_trylock_t *tl; \ + local_trylock_t *__tl; \ \ local_irq_save(flags); \ - tl =3D (lock); \ - if (READ_ONCE(tl->acquired)) { \ + __tl =3D (lock); \ + if (READ_ONCE(__tl->acquired)) { \ local_irq_restore(flags); \ - tl =3D NULL; \ + __tl =3D NULL; \ } else { \ - WRITE_ONCE(tl->acquired, 1); \ + WRITE_ONCE(__tl->acquired, 1); \ local_trylock_acquire( \ - (local_lock_t *)tl); \ + (local_lock_t *)__tl); \ } \ - !!tl; \ + !!__tl; \ }) =20 /* preemption or migration must be disabled before calling __local_lock_is= _locked */ @@ -170,16 +170,16 @@ do { \ =20 #define __local_lock_release(lock) \ do { \ - local_trylock_t *tl; \ - local_lock_t *l; \ + local_trylock_t *__tl; \ + local_lock_t *__l; \ \ - l =3D (local_lock_t *)(lock); \ - tl =3D (local_trylock_t *)l; \ - local_lock_release(l); \ + __l =3D (local_lock_t *)(lock); \ + __tl =3D (local_trylock_t *)__l; \ + local_lock_release(__l); \ _Generic((lock), \ local_trylock_t *: ({ \ - lockdep_assert(tl->acquired =3D=3D 1); \ - WRITE_ONCE(tl->acquired, 0); \ + lockdep_assert(__tl->acquired =3D=3D 1); \ + WRITE_ONCE(__tl->acquired, 0); \ }), \ local_lock_t *: (void)0); \ } while (0) @@ -223,12 +223,12 @@ typedef spinlock_t local_trylock_t; #define INIT_LOCAL_LOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname)) #define INIT_LOCAL_TRYLOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname)) =20 -#define __local_lock_init(l) \ +#define __local_lock_init(__l) \ do { \ - local_spin_lock_init((l)); \ + local_spin_lock_init((__l)); \ } while (0) =20 -#define __local_trylock_init(l) __local_lock_init(l) +#define __local_trylock_init(__l) __local_lock_init(__l) =20 #define __local_lock(__lock) \ do { \