[PATCH] locking/local_lock: remove unused __spinlock_nested_bh_init()

Zhan Xusheng posted 1 patch 1 month, 1 week ago
include/linux/local_lock_internal.h | 11 -----------
1 file changed, 11 deletions(-)
[PATCH] locking/local_lock: remove unused __spinlock_nested_bh_init()
Posted by Zhan Xusheng 1 month, 1 week ago
From: Zhan Xusheng <zhanxusheng1024@gmail.com>

From: Zhan Xusheng <zhanxusheng@xiaomi.com>

Added by commit c5bcab755822 ("locking/local_lock: Add local nested BH
locking infrastructure.") and unused since: there is no public wrapper for
it in local_lock.h and no caller, and 'spinlock_nested_bh' appears nowhere
else in the tree.

Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
 include/linux/local_lock_internal.h | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h
index 234be7f12c15..4cf947ffd02a 100644
--- a/include/linux/local_lock_internal.h
+++ b/include/linux/local_lock_internal.h
@@ -94,17 +94,6 @@ do {								\
 	__local_lock_init((local_lock_t *)lock);		\
 } while (0)
 
-#define __spinlock_nested_bh_init(lock)				\
-do {								\
-	static struct lock_class_key __key;			\
-								\
-	debug_check_no_locks_freed((void *)lock, sizeof(*lock));\
-	lockdep_init_map_type(&(lock)->dep_map, #lock, &__key,  \
-			      0, LD_WAIT_CONFIG, LD_WAIT_INV,	\
-			      LD_LOCK_NORMAL);			\
-	local_lock_debug_init(lock);				\
-} while (0)
-
 #define __local_lock_acquire(lock)					\
 	do {								\
 		local_trylock_t *__tl;					\
-- 
2.43.0
Re: [PATCH] locking/local_lock: remove unused __spinlock_nested_bh_init()
Posted by Sebastian Andrzej Siewior 1 month ago
On 2026-08-17 21:03:54 [+0800], Zhan Xusheng wrote:
> From: Zhan Xusheng <zhanxusheng1024@gmail.com>
> 
> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
> 
> Added by commit c5bcab755822 ("locking/local_lock: Add local nested BH
> locking infrastructure.") and unused since: there is no public wrapper for
> it in local_lock.h and no caller, and 'spinlock_nested_bh' appears nowhere
> else in the tree.
> 
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

> --- a/include/linux/local_lock_internal.h
> +++ b/include/linux/local_lock_internal.h
> @@ -94,17 +94,6 @@ do {								\
>  	__local_lock_init((local_lock_t *)lock);		\
>  } while (0)
>  
> -#define __spinlock_nested_bh_init(lock)				\
> -do {								\
> -	static struct lock_class_key __key;			\
> -								\
> -	debug_check_no_locks_freed((void *)lock, sizeof(*lock));\
> -	lockdep_init_map_type(&(lock)->dep_map, #lock, &__key,  \
> -			      0, LD_WAIT_CONFIG, LD_WAIT_INV,	\
> -			      LD_LOCK_NORMAL);			\
> -	local_lock_debug_init(lock);				\
> -} while (0)
> -

This must have been something in-between because it uses LD_LOCK_NORMAL
and it should have been LD_LOCK_PERCPU if intended for this.

>  #define __local_lock_acquire(lock)					\
>  	do {								\
>  		local_trylock_t *__tl;					\

Sebastian