lkml.org 
[lkml]   [2017]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] usb: misc: usbtest: remove redundant check on retval < 0
Date

Hi,

Colin King <colin.king@canonical.com> writes:
> 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;

you're changing return value here, are you sure there's nothing else
depending on this error?

--
balbi
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-02-13 11:46    [W:0.066 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site