public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Benjamin Romer <benjamin.romer@unisys.com>,
	David Kershner <david.kershner@unisys.com>,
	sparmaintainer@unisys.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert
Date: Wed, 3 Sep 2014 00:24:38 +0530	[thread overview]
Message-ID: <20140902185438.GA1688@fool> (raw)
In-Reply-To: <20140902182402.GA12744@kroah.com>

On Tue, Sep 02, 2014 at 11:24:02AM -0700, Greg Kroah-Hartman wrote:
> On Tue, Sep 02, 2014 at 11:46:35PM +0530, Sudip Mukherjee wrote:
> > From: Sudip Mukherjee <sudip@vectorindia.org>
> > 
> > removed unused variables
> > fixed sparse warning of context imbalance in 'do_locked_client_insert'
> >                          different lock contexts for basic block
> > 
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> > 
> > v1 of the patch of the patch just fixed the sparse warning.
> > On suggestion of Dan Carpenter v2 is the total rewrite of the function.
> > Two of the function arguments (interruptHandle,channelId) are also not used. Wanted to remove them as well , 
> > but then thought maybe the original author have planned for some use of those variables.
> > 
> >  drivers/staging/unisys/uislib/uisqueue.c | 37 ++++++++------------------------
> >  1 file changed, 9 insertions(+), 28 deletions(-)
> > 
> > diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c
> > index 63dbe7c..acfa46d 100644
> > --- a/drivers/staging/unisys/uislib/uisqueue.c
> > +++ b/drivers/staging/unisys/uislib/uisqueue.c
> > @@ -78,39 +78,20 @@ do_locked_client_insert(struct uisqueue_info *queueinfo,
> >  			u64 interruptHandle, u8 *channelId)
> >  {
> >  	unsigned long flags;
> > -	unsigned char queueWasEmpty;
> > -	unsigned int locked = 0;
> > -	unsigned int acquired = 0;
> >  	u8 rc = 0;
> >  
> >  	spin_lock_irqsave(lock, flags);
> > -	locked = 1;
> > -
> >  	if (!ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(queueinfo->chan, channelId, NULL))
> > -		goto Away;
> > -
> > -	acquired = 1;
> > -
> > -	queueWasEmpty = visor_signalqueue_empty(queueinfo->chan, whichqueue);
> > -	if (!visor_signal_insert(queueinfo->chan, whichqueue, pSignal))
> > -		goto Away;
> > -	ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId, NULL);
> > -	acquired = 0;
> > -
> > -	queueinfo->packets_sent++;
> > -
> > -	rc = 1;
> > -Away:
> > -	if (acquired) {
> > -		ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId,
> > -						NULL);
> > -		acquired = 0;
> > -	}
> > -	if (locked) {
> > -		spin_unlock_irqrestore((spinlock_t *) lock, flags);
> > -		locked = 0;
> > +		goto unlock;
> > +	visor_signalqueue_empty(queueinfo->chan, whichqueue);
> > +	/*visor_signal_insert() only return 0 or 1 */
> 
> Odd comment style (hint, you need a ' ' at the beginning...)
> 
> And why comment this at all?
> 
> thanks,
> 
> greg k-h

comment is actually not required. thought it will be easier to understant the code if the return values can be see.
I will delete the comment and send it again.

thanks
sudip

  reply	other threads:[~2014-09-02 18:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 18:16 [PATCH v2] staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert Sudip Mukherjee
2014-09-02 18:24 ` Greg Kroah-Hartman
2014-09-02 18:54   ` Sudip Mukherjee [this message]
2014-09-03  8:40 ` Dan Carpenter
2014-09-03  8:59   ` Sudip Mukherjee
2014-09-03  9:20     ` Dan Carpenter
2014-09-03 14:43     ` Sudip Mukherjee
2014-09-03 15:41       ` Dan Carpenter
2014-09-03 16:26         ` Sudip Mukherjee

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=20140902185438.GA1688@fool \
    --to=sudipm.mukherjee@gmail.com \
    --cc=benjamin.romer@unisys.com \
    --cc=david.kershner@unisys.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparmaintainer@unisys.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