Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354627
b: refs/heads/master
c: 98f3a1b
h: refs/heads/master
i:
  354625: 1e33f0c
  354623: ef70e29
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and Felipe Balbi committed Jan 10, 2013
1 parent 0393247 commit d882acd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b642435333b23ab01d526bd854d118704434fc88
refs/heads/master: 98f3a1b90795d7216de0d56157868d174317f91a
8 changes: 4 additions & 4 deletions trunk/drivers/usb/gadget/f_mass_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ static int check_command(struct fsg_common *common, int cmnd_size,
int needs_medium, const char *name)
{
int i;
int lun = common->cmnd[1] >> 5;
unsigned int lun = common->cmnd[1] >> 5;
static const char dirletter[4] = {'u', 'o', 'i', 'n'};
char hdlen[20];
struct fsg_lun *curlun;
Expand Down Expand Up @@ -1757,7 +1757,7 @@ static int check_command(struct fsg_common *common, int cmnd_size,

/* Check that the LUN values are consistent */
if (common->lun != lun)
DBG(common, "using LUN %d from CBW, not LUN %d from CDB\n",
DBG(common, "using LUN %u from CBW, not LUN %u from CDB\n",
common->lun, lun);

/* Check the LUN */
Expand All @@ -1777,7 +1777,7 @@ static int check_command(struct fsg_common *common, int cmnd_size,
*/
if (common->cmnd[0] != INQUIRY &&
common->cmnd[0] != REQUEST_SENSE) {
DBG(common, "unsupported LUN %d\n", common->lun);
DBG(common, "unsupported LUN %u\n", common->lun);
return -EINVAL;
}
}
Expand Down Expand Up @@ -2169,7 +2169,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
if (common->data_size == 0)
common->data_dir = DATA_DIR_NONE;
common->lun = cbw->Lun;
if (common->lun >= 0 && common->lun < common->nluns)
if (common->lun < common->nluns)
common->curlun = &common->luns[common->lun];
else
common->curlun = NULL;
Expand Down

0 comments on commit d882acd

Please sign in to comment.