* [PATCH] include/linux/local_lock_internal.h: Make this header file again compatible with sparse
@ 2026-03-11 23:14 Bart Van Assche
2026-03-12 0:23 ` Marco Elver
2026-03-16 10:06 ` [tip: locking/urgent] " tip-bot2 for Bart Van Assche
0 siblings, 2 replies; 3+ messages in thread
From: Bart Van Assche @ 2026-03-11 23:14 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long, linux-kernel,
Marco Elver, Bart Van Assche, kernel test robot
There are two versions of the __this_cpu_local_lock() definitions in
include/linux/local_lock_internal.h: one version that relies on the
Clang overloading functionality and another version that does not.
Select the latter version when using sparse. This patch fixes the
following errors reported by sparse:
include/linux/local_lock_internal.h:331:40: sparse: sparse: multiple definitions for function '__this_cpu_local_lock'
include/linux/local_lock_internal.h:325:37: sparse: the previous one is here
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603062334.wgI5htP0-lkp@intel.com/
Fixes: d3febf16dee2 ("locking/local_lock: Support Clang's context analysis")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
include/linux/local_lock_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h
index eff711bf973f..234be7f12c15 100644
--- a/include/linux/local_lock_internal.h
+++ b/include/linux/local_lock_internal.h
@@ -315,7 +315,7 @@ do { \
#endif /* CONFIG_PREEMPT_RT */
-#if defined(WARN_CONTEXT_ANALYSIS)
+#if defined(WARN_CONTEXT_ANALYSIS) && !defined(__CHECKER__)
/*
* Because the compiler only knows about the base per-CPU variable, use this
* helper function to make the compiler think we lock/unlock the @base variable,
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] include/linux/local_lock_internal.h: Make this header file again compatible with sparse
2026-03-11 23:14 [PATCH] include/linux/local_lock_internal.h: Make this header file again compatible with sparse Bart Van Assche
@ 2026-03-12 0:23 ` Marco Elver
2026-03-16 10:06 ` [tip: locking/urgent] " tip-bot2 for Bart Van Assche
1 sibling, 0 replies; 3+ messages in thread
From: Marco Elver @ 2026-03-12 0:23 UTC (permalink / raw)
To: Bart Van Assche
Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng,
Waiman Long, linux-kernel, kernel test robot
On Thu, 12 Mar 2026 at 00:15, Bart Van Assche <bvanassche@acm.org> wrote:
>
> There are two versions of the __this_cpu_local_lock() definitions in
> include/linux/local_lock_internal.h: one version that relies on the
> Clang overloading functionality and another version that does not.
> Select the latter version when using sparse. This patch fixes the
> following errors reported by sparse:
>
> include/linux/local_lock_internal.h:331:40: sparse: sparse: multiple definitions for function '__this_cpu_local_lock'
> include/linux/local_lock_internal.h:325:37: sparse: the previous one is here
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202603062334.wgI5htP0-lkp@intel.com/
> Fixes: d3febf16dee2 ("locking/local_lock: Support Clang's context analysis")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Marco Elver <elver@google.com>
> ---
> include/linux/local_lock_internal.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h
> index eff711bf973f..234be7f12c15 100644
> --- a/include/linux/local_lock_internal.h
> +++ b/include/linux/local_lock_internal.h
> @@ -315,7 +315,7 @@ do { \
>
> #endif /* CONFIG_PREEMPT_RT */
>
> -#if defined(WARN_CONTEXT_ANALYSIS)
> +#if defined(WARN_CONTEXT_ANALYSIS) && !defined(__CHECKER__)
> /*
> * Because the compiler only knows about the base per-CPU variable, use this
> * helper function to make the compiler think we lock/unlock the @base variable,
^ permalink raw reply [flat|nested] 3+ messages in thread* [tip: locking/urgent] include/linux/local_lock_internal.h: Make this header file again compatible with sparse
2026-03-11 23:14 [PATCH] include/linux/local_lock_internal.h: Make this header file again compatible with sparse Bart Van Assche
2026-03-12 0:23 ` Marco Elver
@ 2026-03-16 10:06 ` tip-bot2 for Bart Van Assche
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Bart Van Assche @ 2026-03-16 10:06 UTC (permalink / raw)
To: linux-tip-commits
Cc: kernel test robot, Bart Van Assche, Peter Zijlstra (Intel),
Marco Elver, x86, linux-kernel
The following commit has been merged into the locking/urgent branch of tip:
Commit-ID: 14de1552a4e3fece78bb20314887e70888c9d448
Gitweb: https://git.kernel.org/tip/14de1552a4e3fece78bb20314887e70888c9d448
Author: Bart Van Assche <bvanassche@acm.org>
AuthorDate: Wed, 11 Mar 2026 16:14:55 -07:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 12 Mar 2026 11:29:11 +01:00
include/linux/local_lock_internal.h: Make this header file again compatible with sparse
There are two versions of the __this_cpu_local_lock() definitions in
include/linux/local_lock_internal.h: one version that relies on the
Clang overloading functionality and another version that does not.
Select the latter version when using sparse. This patch fixes the
following errors reported by sparse:
include/linux/local_lock_internal.h:331:40: sparse: sparse: multiple definitions for function '__this_cpu_local_lock'
include/linux/local_lock_internal.h:325:37: sparse: the previous one is here
Closes: https://lore.kernel.org/oe-kbuild-all/202603062334.wgI5htP0-lkp@intel.com/
Fixes: d3febf16dee2 ("locking/local_lock: Support Clang's context analysis")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Marco Elver <elver@google.com>
Link: https://patch.msgid.link/20260311231455.1961413-1-bvanassche@acm.org
---
include/linux/local_lock_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h
index eff711b..234be7f 100644
--- a/include/linux/local_lock_internal.h
+++ b/include/linux/local_lock_internal.h
@@ -315,7 +315,7 @@ do { \
#endif /* CONFIG_PREEMPT_RT */
-#if defined(WARN_CONTEXT_ANALYSIS)
+#if defined(WARN_CONTEXT_ANALYSIS) && !defined(__CHECKER__)
/*
* Because the compiler only knows about the base per-CPU variable, use this
* helper function to make the compiler think we lock/unlock the @base variable,
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-16 10:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-11 23:14 [PATCH] include/linux/local_lock_internal.h: Make this header file again compatible with sparse Bart Van Assche
2026-03-12 0:23 ` Marco Elver
2026-03-16 10:06 ` [tip: locking/urgent] " tip-bot2 for Bart Van Assche
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®