diff options
author | Sudip Mukherjee <sudip@vectorindia.org> | 2014-09-03 14:59:21 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-08 13:20:17 -0700 |
commit | b440ddd531490361d7b508bcfddd67f525c7c250 (patch) | |
tree | 8bd0a9f6f2c50920e6a15dc025021888b6adcf4a /drivers/staging | |
parent | a9b3e8f30e33d3542b00edcf0641d031b80967cb (diff) |
staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert
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>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/unisys/uislib/uisqueue.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c index f52bca1d95b1..83f8761f4de3 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; } |