Re: + rcu-fix-sparse-shadowed-variable-warning.patch added to -mm tree

This is a discussion on Re: + rcu-fix-sparse-shadowed-variable-warning.patch added to -mm tree within the Kernel forums, part of the Help category; > --- a/kernel/rcuclassic.c~rcu-fix-sparse-shadowed-variable-warning > +++ a/kernel/rcuclassic.c > @@ -561,15 +561,15 @@ static void __rcu_process_callbacks(stru > local_irq_restore(flags); > > if (rcu_batch_after(rdp->batch, rcp->pending)) { > - unsigned long flags; > + unsigned ...

Go Back   Unix Linux Forum > Unix > Linux > Help > Kernel

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 11:40 PM
Default Re: + rcu-fix-sparse-shadowed-variable-warning.patch added to -mm tree

> --- a/kernel/rcuclassic.c~rcu-fix-sparse-shadowed-variable-warning
> +++ a/kernel/rcuclassic.c
> @@ -561,15 +561,15 @@ static void __rcu_process_callbacks(stru
> local_irq_restore(flags);
>
> if (rcu_batch_after(rdp->batch, rcp->pending)) {
> - unsigned long flags;
> + unsigned long flags2;
>
> /* and start it/schedule start if it's a new batch */
> - spin_lock_irqsave(&rcp->lock, flags);
> + spin_lock_irqsave(&rcp->lock, flags2);
> if (rcu_batch_after(rdp->batch, rcp->pending)) {
> rcp->pending = rdp->batch;
> rcu_start_batch(rcp);
> }
> - spin_unlock_irqrestore(&rcp->lock, flags);
> + spin_unlock_irqrestore(&rcp->lock, flags2);
> }
> }


Bzzzrt... just remove second variable.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Reply With Quote
  #2  
Old 08-28-2008, 12:00 AM
Default Re: + rcu-fix-sparse-shadowed-variable-warning.patch added to -mm tree

On Thu, 2008-08-28 at 07:31 +0400, Alexey Dobriyan wrote:
> > --- a/kernel/rcuclassic.c~rcu-fix-sparse-shadowed-variable-warning
> > +++ a/kernel/rcuclassic.c
> > @@ -561,15 +561,15 @@ static void __rcu_process_callbacks(stru
> > local_irq_restore(flags);
> >
> > if (rcu_batch_after(rdp->batch, rcp->pending)) {
> > - unsigned long flags;
> > + unsigned long flags2;
> >
> > /* and start it/schedule start if it's a new batch */
> > - spin_lock_irqsave(&rcp->lock, flags);
> > + spin_lock_irqsave(&rcp->lock, flags2);
> > if (rcu_batch_after(rdp->batch, rcp->pending)) {
> > rcp->pending = rdp->batch;
> > rcu_start_batch(rcp);
> > }
> > - spin_unlock_irqrestore(&rcp->lock, flags);
> > + spin_unlock_irqrestore(&rcp->lock, flags2);
> > }
> > }

>
> Bzzzrt... just remove second variable.
>


>From my original e-mail:


It would be safe in this case to just remove the second declaration of flags
and reuse it as it is outside the local_irq_save/restore pair. I did it
this
way in case there are future changes that might mix up the use of flags.

Feel free to just remove the second flags declaration if you'd rather do
it
that way.

Cheers,

Harvey

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 01:31 AM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger