Re: locking/local_lock, mm: sparse warnings about shadowed variable
From: Andrew Morton
Date: Wed Jun 11 2025 - 18:33:57 EST
On Wed, 11 Jun 2025 11:20:16 -0700 Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote:
> > diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h
> > index 8d5ac16a9b17..075338f270d0 100644
> > --- a/include/linux/local_lock_internal.h
> > +++ b/include/linux/local_lock_internal.h
> > @@ -97,17 +97,17 @@ do { \
> > #define __local_lock_acquire(lock) \
> > do { \
> > local_trylock_t *tl; \
> > - local_lock_t *l; \
> > + local_lock_t *ll; \
>
> I wouldn't bother messing with the code because of sparse.
> Compilers don't warn here.
There's some value in not cluttering up the sparse output in this
fashion. sparse does often find things which we choose to fix.