From: Bart Van Assche Date: Tue, 24 Jun 2025 21:05:40 +0000 (-0700) Subject: scsi: core: Use scsi_cmd_priv() instead of open-coding it X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8314312c5286e53045a6c37128ea9ddd9cd5e217;p=thirdparty%2Fkernel%2Flinux.git scsi: core: Use scsi_cmd_priv() instead of open-coding it Improve code readability without modifying the behavior of the code. Cc: Hannes Reinecke Cc: John Garry Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20250624210541.512910-4-bvanassche@acm.org Reviewed-by: John Garry Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 144c72f0737a1..0c65ecfedfbd6 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -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);