diff options
author | 2021-08-30 14:56:06 +0200 | |
---|---|---|
committer | 2021-08-30 14:56:06 +0200 | |
commit | 71af75b6929458d85f63c0649dc26d6f4c19729e (patch) | |
tree | c05c57903424d8270f6b6f3ec3493791fdba4e5c /drivers/scsi/scsi_debug.c | |
parent | lib/test_scanf: Handle n_bits == 0 in random tests (diff) | |
parent | printk/index: Fix -Wunused-function warning (diff) | |
download | wireguard-linux-71af75b6929458d85f63c0649dc26d6f4c19729e.tar.xz wireguard-linux-71af75b6929458d85f63c0649dc26d6f4c19729e.zip |
Merge branch 'for-5.15-printk-index' into for-linus
Diffstat (limited to '')
-rw-r--r-- | drivers/scsi/scsi_debug.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index a5d1633b5bd8..5b3a20a140f9 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -851,10 +851,10 @@ static struct device_driver sdebug_driverfs_driver = { }; static const int check_condition_result = - (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + SAM_STAT_CHECK_CONDITION; static const int illegal_condition_result = - (DRIVER_SENSE << 24) | (DID_ABORT << 16) | SAM_STAT_CHECK_CONDITION; + (DID_ABORT << 16) | SAM_STAT_CHECK_CONDITION; static const int device_qfull_result = (DID_OK << 16) | SAM_STAT_TASK_SET_FULL; @@ -931,7 +931,7 @@ static void mk_sense_invalid_fld(struct scsi_cmnd *scp, } asc = c_d ? INVALID_FIELD_IN_CDB : INVALID_FIELD_IN_PARAM_LIST; memset(sbuff, 0, SCSI_SENSE_BUFFERSIZE); - scsi_build_sense_buffer(sdebug_dsense, sbuff, ILLEGAL_REQUEST, asc, 0); + scsi_build_sense(scp, sdebug_dsense, ILLEGAL_REQUEST, asc, 0); memset(sks, 0, sizeof(sks)); sks[0] = 0x80; if (c_d) @@ -957,17 +957,14 @@ static void mk_sense_invalid_fld(struct scsi_cmnd *scp, static void mk_sense_buffer(struct scsi_cmnd *scp, int key, int asc, int asq) { - unsigned char *sbuff; - - sbuff = scp->sense_buffer; - if (!sbuff) { + if (!scp->sense_buffer) { sdev_printk(KERN_ERR, scp->device, "%s: sense_buffer is NULL\n", __func__); return; } - memset(sbuff, 0, SCSI_SENSE_BUFFERSIZE); + memset(scp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); - scsi_build_sense_buffer(sdebug_dsense, sbuff, key, asc, asq); + scsi_build_sense(scp, sdebug_dsense, key, asc, asq); if (sdebug_verbose) sdev_printk(KERN_INFO, scp->device, @@ -7684,11 +7681,6 @@ static int sdebug_driver_remove(struct device *dev) sdbg_host = to_sdebug_host(dev); - if (!sdbg_host) { - pr_err("Unable to locate host info\n"); - return -ENODEV; - } - scsi_remove_host(sdbg_host->shost); list_for_each_entry_safe(sdbg_devinfo, tmp, &sdbg_host->dev_info_list, |