From: Peter Chen <hzpeterchen@gmail.com>
To: Colin King <colin.king@canonical.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Felipe Balbi <felipe.balbi@linux.intel.com>,
Peter Chen <peter.chen@nxp.com>,
Alan Stern <stern@rowland.harvard.edu>,
Mathias Nyman <mathias.nyman@linux.intel.com>,
Lu Baolu <baolu.lu@linux.intel.com>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: misc: usbtest: remove redundant check on retval < 0
Date: Mon, 13 Feb 2017 09:49:59 +0000 [thread overview]
Message-ID: <20170213094959.GA1483@b29397-desktop> (raw)
In-Reply-To: <20170212183518.22528-1-colin.king@canonical.com>
On Sun, Feb 12, 2017 at 06:35:18PM +0000, Colin King wrote:
> 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)) {
Reviewed-by: Peter Chen <peter.chen@nxp.com>
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2017-02-13 9:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-12 18:35 [PATCH] usb: misc: usbtest: remove redundant check on retval < 0 Colin King
2017-02-13 9:49 ` Peter Chen [this message]
2017-02-13 10:45 ` Felipe Balbi
2017-02-13 16:44 ` Colin Ian King
2017-02-13 16:45 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170213094959.GA1483@b29397-desktop \
--to=hzpeterchen@gmail.com \
--cc=baolu.lu@linux.intel.com \
--cc=chunfeng.yun@mediatek.com \
--cc=colin.king@canonical.com \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=peter.chen@nxp.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox