[PATCH 63/69] staging: unisys: virthba: Fix "else not useful after return" warning
Benjamin Romer
benjamin.romer at unisys.com
Fri Dec 5 22:09:38 UTC 2014
From: Ken Depro <kenneth.depro at unisys.com>
This patch fixes a warning generated during the checkpatch script that stated
"else not useful after return". I modified the code to return a designated
status at the end of the function, and replaced the return statement in the
"else if" to set the status accordingly.
Signed-off-by: Ken Depro <kenneth.depro at unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer at unisys.com>
---
drivers/staging/unisys/virthba/virthba.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c
index b78156d..612239e 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -1573,6 +1573,8 @@ virthba_serverdown_complete(struct work_struct *work)
static int
virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state)
{
+ int stat = 1;
+
struct virthba_info *virthbainfo =
(struct virthba_info *)((struct Scsi_Host *)virtpcidev->scsi.
scsihost)->hostdata;
@@ -1587,12 +1589,12 @@ virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state)
&virthbainfo->serverdown_completion);
} else if (virthbainfo->serverchangingstate) {
pr_err("Server already processing change state message\n");
- return 0;
+ stat = 0;
} else {
pr_err("Server already down, but another server down message received.");
}
- return 1;
+ return stat;
}
/*****************************************************/
--
2.1.0
More information about the devel
mailing list