diff options
author | Kurt Kanzenbach <ly80toro@cip.cs.fau.de> | 2013-04-04 18:03:09 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-06 01:22:51 +0400 |
commit | 2183b77ece517fe4a17cae59d227d341b9d271c8 (patch) | |
tree | 743bee6675dd28e2d297db979e105b9f7377f8f6 | |
parent | 31398f6307d52fcb5aca6481fa4c84100aea97e3 (diff) | |
download | linux-2183b77ece517fe4a17cae59d227d341b9d271c8.tar.xz |
staging: usbip: removed unnecessary if-else-statements
In each if-else case "return" is called. This is why
these if-else-statements are useless. Removing them
improves understanding and readability.
Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de>
Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/usbip/stub_main.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/staging/usbip/stub_main.c b/drivers/staging/usbip/stub_main.c index 705a9e530a19..629bfcbcb9b0 100644 --- a/drivers/staging/usbip/stub_main.c +++ b/drivers/staging/usbip/stub_main.c @@ -167,22 +167,22 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf, strncpy(busid, buf + 4, BUSID_SIZE); if (!strncmp(buf, "add ", 4)) { - if (add_match_busid(busid) < 0) { + if (add_match_busid(busid) < 0) return -ENOMEM; - } else { - pr_debug("add busid %s\n", busid); - return count; - } - } else if (!strncmp(buf, "del ", 4)) { - if (del_match_busid(busid) < 0) { + + pr_debug("add busid %s\n", busid); + return count; + } + + if (!strncmp(buf, "del ", 4)) { + if (del_match_busid(busid) < 0) return -ENODEV; - } else { - pr_debug("del busid %s\n", busid); - return count; - } - } else { - return -EINVAL; + + pr_debug("del busid %s\n", busid); + return count; } + + return -EINVAL; } static DRIVER_ATTR(match_busid, S_IRUSR | S_IWUSR, show_match_busid, store_match_busid); |