]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: unisys: visorhba: main path needs to flow down the left margin
authorTim Sell <Timothy.Sell@unisys.com>
Fri, 6 May 2016 17:11:22 +0000 (13:11 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2016 12:15:18 +0000 (14:15 +0200)
In del_scsipending_ent(), the error-path and main-path were switched, so
the error-path is handled like 'if (err) return;', and the main-path flows
down the left margin.  This also allowed us to remove the initialization of
"sent".

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorhba/visorhba_main.c

index 176bcc35ba0e6e5dd2814e229cea776d3ed70f33..7a2c48943b84300c05bfaf22d22026ac28942d91 100644 (file)
@@ -235,16 +235,17 @@ static void *del_scsipending_ent(struct visorhba_devdata *devdata,
                                 int del)
 {
        unsigned long flags;
-       void *sent = NULL;
+       void *sent;
 
-       if (del < MAX_PENDING_REQUESTS) {
-               spin_lock_irqsave(&devdata->privlock, flags);
-               sent = devdata->pending[del].sent;
+       if (del >= MAX_PENDING_REQUESTS)
+               return NULL;
 
-               devdata->pending[del].cmdtype = 0;
-               devdata->pending[del].sent = NULL;
-               spin_unlock_irqrestore(&devdata->privlock, flags);
-       }
+       spin_lock_irqsave(&devdata->privlock, flags);
+       sent = devdata->pending[del].sent;
+
+       devdata->pending[del].cmdtype = 0;
+       devdata->pending[del].sent = NULL;
+       spin_unlock_irqrestore(&devdata->privlock, flags);
 
        return sent;
 }