diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-05-24 05:54:57 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-06-03 06:09:39 +0300 |
commit | 62af0ee94bfb9e626ed73b5890fc68c6e1651843 (patch) | |
tree | 68c5d509e162a8578a26848160fba84757761256 /drivers/scsi/hosts.c | |
parent | 149d0e489e807f1e6dc265f975a793cea11ecbea (diff) | |
download | linux-62af0ee94bfb9e626ed73b5890fc68c6e1651843.tar.xz |
scsi: core: Change the type of the second argument of scsi_host_complete_all_commands()
Allow the compiler to verify the type of the second argument passed to
scsi_host_complete_all_commands().
Link: https://lore.kernel.org/r/20210524025457.11299-4-bvanassche@acm.org
Cc: Hannes Reinecke <hare@suse.com>
Cc: John Garry <john.garry@huawei.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 624e2582c3df..1387a56981f7 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -655,10 +655,11 @@ EXPORT_SYMBOL_GPL(scsi_flush_work); static bool complete_all_cmds_iter(struct request *rq, void *data, bool rsvd) { struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq); - int status = *(int *)data; + enum scsi_host_status status = *(enum scsi_host_status *)data; scsi_dma_unmap(scmd); - scmd->result = status << 16; + scmd->result = 0; + set_host_byte(scmd, status); scmd->scsi_done(scmd); return true; } @@ -673,7 +674,8 @@ static bool complete_all_cmds_iter(struct request *rq, void *data, bool rsvd) * caller to ensure that concurrent I/O submission and/or * completion is stopped when calling this function. */ -void scsi_host_complete_all_commands(struct Scsi_Host *shost, int status) +void scsi_host_complete_all_commands(struct Scsi_Host *shost, + enum scsi_host_status status) { blk_mq_tagset_busy_iter(&shost->tag_set, complete_all_cmds_iter, &status); |