Commit 8314312c authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen
Browse files

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: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20250624210541.512910-4-bvanassche@acm.org


Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b152f199
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1843,7 +1843,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
	 * a function to initialize that data.
	 */
	if (shost->hostt->cmd_size && !shost->hostt->init_cmd_priv)
		memset(cmd + 1, 0, shost->hostt->cmd_size);
		memset(scsi_cmd_priv(cmd), 0, shost->hostt->cmd_size);

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