aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorMaxin B John <maxin.john@gmail.com>2011-05-08 08:56:17 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-10 17:14:59 -0400
commit849426c3a430a6fb4613b0e5dbb81bcd6b10a075 (patch)
treebaf5dafdf261055fc60f3d0b508c2d3fea6605c0 /drivers/usb/gadget
parent304b0b572c66bcd89df13e856db16503609c1a24 (diff)
usb: gadget: Remove the LUN checks which are always true
Comparing an unsigned integer with greater than or equal to zero is always true. So, it is safe to remove similar checks from 'f_mass_storage.c' and 'file_storage.c' Signed-off-by: Maxin B. John <maxin.john@gmail.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c2
-rw-r--r--drivers/usb/gadget/file_storage.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index ad96be808b29..efb58f9f5aa9 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -1884,7 +1884,7 @@ static int check_command(struct fsg_common *common, int cmnd_size,
1884 common->lun, lun); 1884 common->lun, lun);
1885 1885
1886 /* Check the LUN */ 1886 /* Check the LUN */
1887 if (common->lun >= 0 && common->lun < common->nluns) { 1887 if (common->lun < common->nluns) {
1888 curlun = &common->luns[common->lun]; 1888 curlun = &common->luns[common->lun];
1889 common->curlun = curlun; 1889 common->curlun = curlun;
1890 if (common->cmnd[0] != REQUEST_SENSE) { 1890 if (common->cmnd[0] != REQUEST_SENSE) {
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index fcfc77c7ad70..0360f56221ea 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -2285,7 +2285,7 @@ static int check_command(struct fsg_dev *fsg, int cmnd_size,
2285 fsg->lun = lun; // Use LUN from the command 2285 fsg->lun = lun; // Use LUN from the command
2286 2286
2287 /* Check the LUN */ 2287 /* Check the LUN */
2288 if (fsg->lun >= 0 && fsg->lun < fsg->nluns) { 2288 if (fsg->lun < fsg->nluns) {
2289 fsg->curlun = curlun = &fsg->luns[fsg->lun]; 2289 fsg->curlun = curlun = &fsg->luns[fsg->lun];
2290 if (fsg->cmnd[0] != REQUEST_SENSE) { 2290 if (fsg->cmnd[0] != REQUEST_SENSE) {
2291 curlun->sense_data = SS_NO_SENSE; 2291 curlun->sense_data = SS_NO_SENSE;