From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: gregkh@linuxfoundation.org, wsa-dev@sang-engineering.com,
tj@kernel.org, bhaktipriya96@gmail.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Senna Tschudin <peter.senna@gmail.com>,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] usb: misc: remove unnecessary code
Date: Mon, 20 Feb 2017 17:28:46 -0600 [thread overview]
Message-ID: <20170220232846.GA5321@embeddedgus> (raw)
'val' is an unsigned variable, and less-than-zero comparison of an unsigned
variable is never true.
Addresses-Coverity-ID: 1230257
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/usb/misc/lvstest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/misc/lvstest.c b/drivers/usb/misc/lvstest.c
index c7c2104..6f37610 100644
--- a/drivers/usb/misc/lvstest.c
+++ b/drivers/usb/misc/lvstest.c
@@ -193,7 +193,7 @@ static ssize_t u2_timeout_store(struct device *dev,
return ret;
}
- if (val < 0 || val > 127)
+ if (val > 127)
return -EINVAL;
ret = lvs_rh_set_port_feature(hdev, lvs->portnum | (val << 8),
--
2.5.0
next reply other threads:[~2017-02-20 23:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 23:28 Gustavo A. R. Silva [this message]
2017-02-21 22:11 ` [PATCH] usb: misc: remove unnecessary code Peter Senna Tschudin
2017-02-22 5:35 ` Gustavo A. R. Silva
-- strict thread matches above, loose matches on Subject: below --
2017-02-16 21:25 Gustavo A. R. Silva
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=20170220232846.GA5321@embeddedgus \
--to=garsilva@embeddedor.com \
--cc=bhaktipriya96@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.senna@gmail.com \
--cc=tj@kernel.org \
--cc=wsa-dev@sang-engineering.com \
/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