From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
Hannes Reinecke <hare@suse.de>,
John Garry <john.g.garry@oracle.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Subject: [PATCH 3/3] scsi: core: Use scsi_cmd_priv() instead of open-coding it
Date: Tue, 24 Jun 2025 14:05:40 -0700 [thread overview]
Message-ID: <20250624210541.512910-4-bvanassche@acm.org> (raw)
In-Reply-To: <20250624210541.512910-1-bvanassche@acm.org>
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>
---
drivers/scsi/scsi_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 144c72f0737a..0c65ecfedfbd 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);
next prev parent reply other threads:[~2025-06-24 21:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 21:05 [PATCH 0/3] Improve const and reserved command handling Bart Van Assche
2025-06-24 21:05 ` [PATCH 1/3] scsi: core: Make scsi_cmd_to_rq() accept const arguments Bart Van Assche
2025-06-26 8:36 ` John Garry
2025-06-26 15:40 ` Bart Van Assche
2025-06-27 12:05 ` John Garry
2025-07-09 2:10 ` Martin K. Petersen
2025-06-24 21:05 ` [PATCH 2/3] scsi: core: Make scsi_cmd_priv() " Bart Van Assche
2025-06-27 12:08 ` John Garry
2025-06-27 20:58 ` Bart Van Assche
2025-06-24 21:05 ` Bart Van Assche [this message]
2025-06-26 8:34 ` [PATCH 3/3] scsi: core: Use scsi_cmd_priv() instead of open-coding it John Garry
2025-06-26 15:43 ` Bart Van Assche
2025-07-09 2:12 ` Martin K. Petersen
2025-06-25 16:06 ` [PATCH 0/3] Improve const and reserved command handling John Garry
2025-06-25 16:25 ` Bart Van Assche
2025-07-22 3:46 ` (subset) " Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250624210541.512910-4-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=hare@suse.de \
--cc=john.g.garry@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).