Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1579260
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] usb: misc: usbtest: remove redundant check on retval < 0 |
| Date | 2017-02-12 19:40 +0100 |
| Message-ID | <ta7e1-1hK-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
From: Colin Ian King <colin.king@canonical.com>
The check for retval being less than zero is always true since
retval equal to -EPIPE at that point. Replace the existing
conditional with just return retval.
Detected with CoverityScan, CID#114349 ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/usb/misc/usbtest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 3525626..17c0810 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -992,7 +992,7 @@ static int ch9_postconfig(struct usbtest_dev *dev)
dev_err(&iface->dev,
"hs dev qualifier --> %d\n",
retval);
- return (retval < 0) ? retval : -EDOM;
+ return retval;
}
/* usb2.0 but not high-speed capable; fine */
} else if (retval != sizeof(struct usb_qualifier_descriptor)) {
--
2.10.2
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] usb: misc: usbtest: remove redundant check on retval < 0 Colin King <colin.king@canonical.com> - 2017-02-12 19:40 +0100
Re: [PATCH] usb: misc: usbtest: remove redundant check on retval < 0 Peter Chen <hzpeterchen@gmail.com> - 2017-02-13 11:00 +0100
Re: [PATCH] usb: misc: usbtest: remove redundant check on retval < 0 Felipe Balbi <felipe.balbi@linux.intel.com> - 2017-02-13 11:50 +0100
Re: [PATCH] usb: misc: usbtest: remove redundant check on retval < 0 Alan Stern <stern@rowland.harvard.edu> - 2017-02-13 17:50 +0100
Re: [PATCH] usb: misc: usbtest: remove redundant check on retval < 0 Colin Ian King <colin.king@canonical.com> - 2017-02-13 17:50 +0100
csiph-web