Skip to content

Commit 8314312

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: core: Use scsi_cmd_priv() instead of open-coding it
Improve code readability without modifying the behavior of the code. Cc: Hannes Reinecke <hare@suse.de> Cc: John Garry <john.g.garry@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20250624210541.512910-4-bvanassche@acm.org Reviewed-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent b152f19 commit 8314312

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/scsi/scsi_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
18431843
* a function to initialize that data.
18441844
*/
18451845
if (shost->hostt->cmd_size && !shost->hostt->init_cmd_priv)
1846-
memset(cmd + 1, 0, shost->hostt->cmd_size);
1846+
memset(scsi_cmd_priv(cmd), 0, shost->hostt->cmd_size);
18471847

18481848
if (!(req->rq_flags & RQF_DONTPREP)) {
18491849
ret = scsi_prepare_cmd(req);

0 commit comments

Comments
 (0)