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 <[email protected]> Cc: John Garry <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent b152f19 commit 8314312

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)