Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 849426c3 authored by Maxin B John's avatar Maxin B John Committed by Greg Kroah-Hartman
Browse files

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: default avatarMaxin B. John <maxin.john@gmail.com>
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 304b0b57
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1884,7 +1884,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) {
+1 −1
Original line number Diff line number Diff line
@@ -2285,7 +2285,7 @@ static int check_command(struct fsg_dev *fsg, int cmnd_size,
		fsg->lun = lun;		// Use LUN from the command

	/* Check the LUN */
	if (fsg->lun >= 0 && fsg->lun < fsg->nluns) {
	if (fsg->lun < fsg->nluns) {
		fsg->curlun = curlun = &fsg->luns[fsg->lun];
		if (fsg->cmnd[0] != REQUEST_SENSE) {
			curlun->sense_data = SS_NO_SENSE;