diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-06-10 05:30:17 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-06-10 05:30:17 -0300 |
commit | d635711daa98be86d4c7fd01499c34f566b54ccb (patch) | |
tree | aa5cc3760a27c3d57146498cb82fa549547de06c /drivers/staging/rts5208/rtsx_scsi.c | |
parent | c91265cd0efb83778f015b4d4b1129bd2cfd075e (diff) |
Linux-libre 4.6.2-gnu
Diffstat (limited to 'drivers/staging/rts5208/rtsx_scsi.c')
-rw-r--r-- | drivers/staging/rts5208/rtsx_scsi.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c index 60871f302..d2031044e 100644 --- a/drivers/staging/rts5208/rtsx_scsi.c +++ b/drivers/staging/rts5208/rtsx_scsi.c @@ -507,7 +507,7 @@ static int inquiry(struct scsi_cmnd *srb, struct rtsx_chip *chip) } buf = vmalloc(scsi_bufflen(srb)); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -644,7 +644,7 @@ static int request_sense(struct scsi_cmnd *srb, struct rtsx_chip *chip) } buf = vmalloc(scsi_bufflen(srb)); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -792,7 +792,7 @@ static int mode_sense(struct scsi_cmnd *srb, struct rtsx_chip *chip) #endif buf = kmalloc(dataSize, GFP_KERNEL); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -1017,7 +1017,7 @@ static int read_format_capacity(struct scsi_cmnd *srb, struct rtsx_chip *chip) buf_len = (scsi_bufflen(srb) > 12) ? 0x14 : 12; buf = kmalloc(buf_len, GFP_KERNEL); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -1096,7 +1096,7 @@ static int read_capacity(struct scsi_cmnd *srb, struct rtsx_chip *chip) } buf = kmalloc(8, GFP_KERNEL); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -1206,7 +1206,7 @@ static int write_eeprom(struct scsi_cmnd *srb, struct rtsx_chip *chip) len = (unsigned short)min_t(unsigned int, scsi_bufflen(srb), len); buf = vmalloc(len); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -1315,7 +1315,7 @@ static int write_mem(struct scsi_cmnd *srb, struct rtsx_chip *chip) len = (unsigned short)min_t(unsigned int, scsi_bufflen(srb), len); buf = vmalloc(len); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -1410,7 +1410,7 @@ static int trace_msg_cmd(struct scsi_cmnd *srb, struct rtsx_chip *chip) clear = srb->cmnd[2]; buf = vmalloc(scsi_bufflen(srb)); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -1931,20 +1931,15 @@ static int rw_mem_cmd_buf(struct scsi_cmnd *srb, struct rtsx_chip *chip) static int suit_cmd(struct scsi_cmnd *srb, struct rtsx_chip *chip) { - int result; - switch (srb->cmnd[3]) { case INIT_BATCHCMD: case ADD_BATCHCMD: case SEND_BATCHCMD: case GET_BATCHRSP: - result = rw_mem_cmd_buf(srb, chip); - break; + return rw_mem_cmd_buf(srb, chip); default: - result = TRANSPORT_ERROR; + return TRANSPORT_ERROR; } - - return result; } static int read_phy_register(struct scsi_cmnd *srb, struct rtsx_chip *chip) @@ -2035,7 +2030,7 @@ static int write_phy_register(struct scsi_cmnd *srb, struct rtsx_chip *chip) len); buf = vmalloc(len); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -2191,7 +2186,7 @@ static int write_eeprom2(struct scsi_cmnd *srb, struct rtsx_chip *chip) len = (unsigned short)min_t(unsigned int, scsi_bufflen(srb), len); buf = vmalloc(len); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } @@ -2295,7 +2290,7 @@ static int write_efuse(struct scsi_cmnd *srb, struct rtsx_chip *chip) len = (u8)min_t(unsigned int, scsi_bufflen(srb), len); buf = vmalloc(len); - if (buf == NULL) { + if (!buf) { rtsx_trace(chip); return TRANSPORT_ERROR; } |