Skip to content

Commit

Permalink
staging: usbip: removed unnecessary if-else-statements
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kurt Kanzenbach authored and Greg Kroah-Hartman committed Apr 5, 2013
1 parent 31398f6 commit 2183b77
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions drivers/staging/usbip/stub_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2183b77

Please sign in to comment.