mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Bart Van Assche" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Bart Van Assche <bvanassche@acm.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>, Marco Elver <elver@google.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/urgent] bit_spinlock: Fix the __bitlock() macro definition
Date: Sun, 22 Nov 2026 22:49:07 -0000	[thread overview]
Message-ID: <179538774700.92412.9964965073064559135.tip-bot2@tip-bot2> (raw)
In-Reply-To: <38cdec9322fa710f84c018e0b318894c6234c411.1795043161.git.bvanassche@acm.org>

The following commit has been merged into the locking/urgent branch of tip:

Commit-ID:     389327330cfe23adce88b55ee78c0d21fed9957e
Gitweb:        https://git.kernel.org/tip/389327330cfe23adce88b55ee78c0d21fed9957e
Author:        Bart Van Assche <bvanassche@acm.org>
AuthorDate:    Wed, 18 Nov 2026 15:09:57 -08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Sun, 22 Nov 2026 15:59:42 +01:00

bit_spinlock: Fix the __bitlock() macro definition

Surround the 'bitnum' argument and the entire __bitlock() macro expansion
with parentheses because 'bitnum' could be an expression that includes an
operator with a lower precedence than the addition operator (e.g. the
exclusive-or operator) and to prevent operator precedence issues in
callers.

Fixes: eb7d96a13bf4 ("bit_spinlock: Support Clang's context analysis")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Marco Elver <elver@google.com>
Link: https://patch.msgid.link/38cdec9322fa710f84c018e0b318894c6234c411.1795043161.git.bvanassche@acm.org
---
 include/linux/bit_spinlock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
index 7869a6e..c31d4f4 100644
--- a/include/linux/bit_spinlock.h
+++ b/include/linux/bit_spinlock.h
@@ -17,7 +17,7 @@
  * static analysis can use.
  */
 context_lock_struct(__context_bitlock) { };
-#define __bitlock(bitnum, addr) (struct __context_bitlock *)(bitnum + (addr))
+#define __bitlock(bitnum, addr) ((struct __context_bitlock *)((bitnum) + (addr)))
 
 /*
  *  bit-based spin_lock()

  reply	other threads:[~2026-11-22 22:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 23:09 [PATCH v4 0/3] Fix three Clang context analysis issues Bart Van Assche
2026-11-18 23:09 ` [PATCH v4 1/3] bit_spinlock: Fix the __bitlock() definition Bart Van Assche
2026-11-22 22:49   ` tip-bot2 for Bart Van Assche [this message]
2026-11-23  9:44   ` [tip: locking/urgent] bit_spinlock: Fix the __bitlock() macro definition tip-bot2 for Bart Van Assche
2026-11-18 23:09 ` [PATCH v4 2/3] cleanup: Disable context analysis for __free() helpers Bart Van Assche
2026-11-22 22:49   ` [tip: locking/urgent] " tip-bot2 for Bart Van Assche
2026-11-23  9:44   ` tip-bot2 for Bart Van Assche
2026-11-18 23:09 ` [PATCH v4 3/3] srcu: Make the srcu_dereference_check() reader lock check conditional Bart Van Assche
2026-11-18 23:47   ` Paul E. McKenney
2026-11-22 22:49   ` [tip: locking/urgent] " tip-bot2 for Bart Van Assche
2026-11-23  9:44   ` tip-bot2 for Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179538774700.92412.9964965073064559135.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bvanassche@acm.org \
    --cc=elver@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®