summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys
diff options
context:
space:
mode:
authorBenjamin Romer2016-02-23 16:01:50 +0100
committerGreg Kroah-Hartman2016-02-26 07:40:52 +0100
commitf748f64f0605f5a236aee103b75ec48075d2c4fa (patch)
treef8f1371c3c0b6bc24e1bbec7172691aaad42879e /drivers/staging/unisys
parentstaging: unisys: fix return value for visorbus pci probe (diff)
downloadkernel-qcow2-linux-f748f64f0605f5a236aee103b75ec48075d2c4fa.tar.gz
kernel-qcow2-linux-f748f64f0605f5a236aee103b75ec48075d2c4fa.tar.xz
kernel-qcow2-linux-f748f64f0605f5a236aee103b75ec48075d2c4fa.zip
staging: unisys: remove goto in get_vbus_header_info
Remove the rc, the = -1, and all the goto mess here and just return directly with a meaningful error number. The caller only cares about success/failure right now, that needs to be addressed in a later patch series. Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys')
-rw-r--r--drivers/staging/unisys/visorbus/visorbus_main.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index c0badfa5a46f..0add9ffe68fd 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1058,23 +1058,21 @@ static int
get_vbus_header_info(struct visorchannel *chan,
struct spar_vbus_headerinfo *hdr_info)
{
- int rc = -1;
-
if (!SPAR_VBUS_CHANNEL_OK_CLIENT(visorchannel_get_header(chan)))
- goto away;
+ return -EINVAL;
+
if (visorchannel_read(chan, sizeof(struct channel_header), hdr_info,
sizeof(*hdr_info)) < 0) {
- goto away;
+ return -EIO;
}
if (hdr_info->struct_bytes < sizeof(struct spar_vbus_headerinfo))
- goto away;
+ return -EINVAL;
+
if (hdr_info->device_info_struct_bytes <
sizeof(struct ultra_vbus_deviceinfo)) {
- goto away;
+ return -EINVAL;
}
- rc = 0;
-away:
- return rc;
+ return 0;
}
/* Write the contents of <info> to the struct