public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, paulmck@linux.vnet.ibm.com
Subject: Re: + rcu-fix-sparse-shadowed-variable-warning.patch added to -mm tree
Date: Wed, 27 Aug 2008 20:51:31 -0700	[thread overview]
Message-ID: <1219895491.6069.4.camel@brick> (raw)
In-Reply-To: <20080828033123.GA19218@x200.localdomain>

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


      reply	other threads:[~2008-08-28  3:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200808280322.m7S3MOUg004835@imap1.linux-foundation.org>
2008-08-28  3:31 ` + rcu-fix-sparse-shadowed-variable-warning.patch added to -mm tree Alexey Dobriyan
2008-08-28  3:51   ` Harvey Harrison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1219895491.6069.4.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox