From 825157aedabc2b4c0cb3152012b00ea0bdcd6fac Mon Sep 17 00:00:00 2001 From: Tim Sell Date: Fri, 6 May 2016 13:11:22 -0400 Subject: [PATCH] staging: unisys: visorhba: main path needs to flow down the left margin 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 Signed-off-by: David Kershner Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorhba/visorhba_main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 176bcc35ba0e..7a2c48943b84 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -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; } -- 2.39.5