* [PATCH v4] staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert
@ 2014-09-03 9:29 Sudip Mukherjee
2014-09-03 9:59 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2014-09-03 9:29 UTC (permalink / raw)
To: Benjamin Romer, David Kershner, Greg Kroah-Hartman
Cc: Sudip Mukherjee, sparmaintainer, devel, linux-kernel
1) removed unused variables
2) fixed sparse warning of context imbalance in 'do_locked_client_insert'
different lock contexts for basic block
3) removed the call to visor_signalqueue_empty() , this function is
checking whether a signal queue is empty, but the return value
of the function is not beeing used, so it is safe to remove.
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.
change from v2 to v3 : i messed up in writing a comment , which greg k-h pointed out.
The comment was actually not needed , so that has been removed.
change from v3 to v4 : call to visor_signalqueue_empty() was removed and
in the if condition comparison with 1 was removed.
drivers/staging/unisys/uislib/uisqueue.c | 37 ++++++--------------------------
1 file changed, 7 insertions(+), 30 deletions(-)
diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c
index f52bca1..83f8761 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -78,41 +78,18 @@ 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;
- spin_unlock_irqrestore(lock, flags);
- locked = 0;
-
- queueinfo->packets_sent++;
-
- rc = 1;
-Away:
- if (acquired) {
- ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId,
- NULL);
- acquired = 0;
+ goto unlock;
+ if (visor_signal_insert(queueinfo->chan, whichqueue, pSignal)) {
+ queueinfo->packets_sent++;
+ rc = 1;
}
- if (locked) {
- spin_unlock_irqrestore((spinlock_t *) lock, flags);
- locked = 0;
- }
-
+ ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId, NULL);
+unlock:
+ spin_unlock_irqrestore((spinlock_t *)lock, flags);
return rc;
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v4] staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert
2014-09-03 9:29 [PATCH v4] staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert Sudip Mukherjee
@ 2014-09-03 9:59 ` Dan Carpenter
2014-09-04 16:41 ` Sudip Mukherjee
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-09-03 9:59 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Benjamin Romer, David Kershner, Greg Kroah-Hartman, devel,
sparmaintainer, linux-kernel
On Wed, Sep 03, 2014 at 02:59:21PM +0530, Sudip Mukherjee wrote:
> 1) removed unused variables
> 2) fixed sparse warning of context imbalance in 'do_locked_client_insert'
> different lock contexts for basic block
> 3) removed the call to visor_signalqueue_empty() , this function is
> checking whether a signal queue is empty, but the return value
> of the function is not beeing used, so it is safe to remove.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Looks good. Thanks!
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert
2014-09-03 9:59 ` Dan Carpenter
@ 2014-09-04 16:41 ` Sudip Mukherjee
2014-09-04 20:25 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2014-09-04 16:41 UTC (permalink / raw)
To: Dan Carpenter
Cc: Sudip Mukherjee, Benjamin Romer, David Kershner,
Greg Kroah-Hartman, devel, sparmaintainer, linux-kernel
On Wed, Sep 03, 2014 at 12:59:50PM +0300, Dan Carpenter wrote:
> On Wed, Sep 03, 2014 at 02:59:21PM +0530, Sudip Mukherjee wrote:
> > 1) removed unused variables
> > 2) fixed sparse warning of context imbalance in 'do_locked_client_insert'
> > different lock contexts for basic block
> > 3) removed the call to visor_signalqueue_empty() , this function is
> > checking whether a signal queue is empty, but the return value
> > of the function is not beeing used, so it is safe to remove.
> >
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
>
> Looks good. Thanks!
>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> regards,
> dan carpenter
do i need to resend the patch after adding Reviewed-by to it ?
thanks
sudip
>
>
> --
> 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/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert
2014-09-04 16:41 ` Sudip Mukherjee
@ 2014-09-04 20:25 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-09-04 20:25 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Sudip Mukherjee, Benjamin Romer, David Kershner,
Greg Kroah-Hartman, devel, sparmaintainer, linux-kernel
On Thu, Sep 04, 2014 at 10:11:16PM +0530, Sudip Mukherjee wrote:
> On Wed, Sep 03, 2014 at 12:59:50PM +0300, Dan Carpenter wrote:
> > On Wed, Sep 03, 2014 at 02:59:21PM +0530, Sudip Mukherjee wrote:
> > > 1) removed unused variables
> > > 2) fixed sparse warning of context imbalance in 'do_locked_client_insert'
> > > different lock contexts for basic block
> > > 3) removed the call to visor_signalqueue_empty() , this function is
> > > checking whether a signal queue is empty, but the return value
> > > of the function is not beeing used, so it is safe to remove.
> > >
> > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> >
> > Looks good. Thanks!
> >
> > Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > regards,
> > dan carpenter
>
> do i need to resend the patch after adding Reviewed-by to it ?
>
No. Greg will reply (perhaps an automated message) when he gets to the
patch. Otherwise your job is done.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-09-04 20:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03 9:29 [PATCH v4] staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert Sudip Mukherjee
2014-09-03 9:59 ` Dan Carpenter
2014-09-04 16:41 ` Sudip Mukherjee
2014-09-04 20:25 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox