[23/31] scsi: Move sense buffer pointer initialization into scsi_initialize_rq()
diff mbox

Message ID 20170524003420.5381-24-bart.vanassche@sandisk.com
State New
Headers show

Commit Message

Bart Van Assche May 24, 2017, 12:34 a.m. UTC
This patch is a preparation for the next patch that will zero
the struct scsi_request embedded in struct scsi_cmnd before
calling scsi_req_init().

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/scsi_lib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Hannes Reinecke May 24, 2017, 6:10 a.m. UTC | #1
On 05/24/2017 02:34 AM, Bart Van Assche wrote:
> This patch is a preparation for the next patch that will zero
> the struct scsi_request embedded in struct scsi_cmnd before
> calling scsi_req_init().
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.com>
> ---
>  drivers/scsi/scsi_lib.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes

Patch
diff mbox

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 359f824ab78c..10c6adb208dc 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1164,6 +1164,7 @@  static void scsi_initialize_rq(struct request *rq)
 	       sizeof(*cmd) - sizeof(cmd->req));
 	scsi_req_init(&cmd->req);
 	cmd->device = dev;
+	cmd->req.sense = cmd->sense_buffer;
 	cmd->sense_buffer = buf;
 	cmd->prot_sdb = prot;
 	INIT_DELAYED_WORK(&cmd->abort_work, scmd_eh_abort_handler);
@@ -2025,7 +2026,6 @@  static int scsi_init_request(struct blk_mq_tag_set *set, struct request *rq,
 						    GFP_KERNEL, numa_node);
 	if (!cmd->sense_buffer)
 		return -ENOMEM;
-	cmd->req.sense = cmd->sense_buffer;
 	return 0;
 }
 
@@ -2123,7 +2123,6 @@  static int scsi_init_rq(struct request_queue *q, struct request *rq, gfp_t gfp)
 						    NUMA_NO_NODE);
 	if (!cmd->sense_buffer)
 		goto fail;
-	cmd->req.sense = cmd->sense_buffer;
 
 	if (scsi_host_get_prot(shost) >= SHOST_DIX_TYPE0_PROTECTION) {
 		cmd->prot_sdb = kmem_cache_zalloc(scsi_sdb_cache, gfp);