From: Maxin John <maxin.john@gmail.com>
To: m.nazarewicz@samsung.com
Cc: gregkh@suse.de, stern@rowland.harvard.edu, mina86@mina86.com,
m-sonasath@ti.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, roger.quadros@nokia.com
Subject: [PATCH] usb: gadget: f_mass_storage: Remove the LUN check which is always true
Date: Wed, 4 May 2011 15:16:05 +0100 [thread overview]
Message-ID: <BANLkTik9e5it5vTMxvFUnZGpoO8N0ida8Q@mail.gmail.com> (raw)
Hi,
Since comparing an unsigned int (common->lun) greater than or equal
to zero is always true, I think it is safe to remove this check.
Please let me know your comments.
Thanks to Coverity for pointing this out.
Signed-off-by: Maxin B. John <maxin.john@gmail.com>
---
diff --git a/drivers/usb/gadget/f_mass_storage.c
b/drivers/usb/gadget/f_mass_storage.c
index 6d8e533..cade79e 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -1910,7 +1910,7 @@ static int check_command(struct fsg_common
*common, int cmnd_size,
common->lun, lun);
/* Check the LUN */
- if (common->lun >= 0 && common->lun < common->nluns) {
+ if (common->lun < common->nluns) {
curlun = &common->luns[common->lun];
common->curlun = curlun;
if (common->cmnd[0] != REQUEST_SENSE) {
next reply other threads:[~2011-05-04 14:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 14:16 Maxin John [this message]
2011-05-04 14:27 ` Michal Nazarewicz
2011-05-04 15:04 ` Maxin John
2011-05-04 15:41 ` Michal Nazarewicz
2011-05-04 16:02 ` Alan Stern
2011-05-07 1:09 ` Greg KH
2011-05-07 9:27 ` Maxin John
2011-05-07 15:43 ` Greg KH
2011-05-08 11:51 ` Maxin John
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=BANLkTik9e5it5vTMxvFUnZGpoO8N0ida8Q@mail.gmail.com \
--to=maxin.john@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m-sonasath@ti.com \
--cc=m.nazarewicz@samsung.com \
--cc=mina86@mina86.com \
--cc=roger.quadros@nokia.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
all inboxes | Powered by JetHome®