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

From: Sebastian Andrzej Siewior

Date: Thu Aug 27 2026 - 07:11:04 EST


On 2026-08-17 21:03:54 [+0800], Zhan Xusheng wrote:
> From: Zhan Xusheng <zhanxusheng1024@xxxxxxxxx>
>
> From: Zhan Xusheng <zhanxusheng@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

> --- 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