scsi: remove reduntant assignment when alloc sdev
PATCH 1/1 scsi: remove reduntant assignment when alloc sdev
sdev->reqeust_queue and its queuedata have been set up in scsi_mq_alloc_queue(). No need to do that again.
--- drivers/scsi/scsi_scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/scsi_scan.c +1 -3
@@ -266,8 +266,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,*/ sdev->borken =1 ; - sdev->request_queue =scsi_mq_alloc_queue (sdev); -if (!sdev->request_queue) { +if (!scsi_mq_alloc_queue (sdev)) {/* release fn is set up in scsi_sysfs_device_initialise, so * have to free and put manually here */ put_device (&starget->dev);
@@ -275,7 +274,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, goto out; }WARN_ON_ONCE (!blk_get_queue (sdev->request_queue)); - sdev->request_queue->queuedata = sdev; depth = sdev->host->cmd_per_lun ?:1 ;
Signature · 1 line
2.18.0
Quoted 23 lines · Ed Tsai
sdev->reqeust_queueand its queuedata have been set up inscsi_mq_alloc_queue(). No need to do that again.Signed-off-by Ed Tsai <[email protected]>--- drivers/scsi/scsi_scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/scsi/scsi_scan.c +1
-2@@ -266,8 +266,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,*/ sdev->borken =1 ; - sdev->request_queue =scsi_mq_alloc_queue (sdev); -if (!sdev->request_queue) { +if (!scsi_mq_alloc_queue (sdev)) {/* release fn is set up in scsi_sysfs_device_initialise, so * have to free and put manually here */ put_device (&starget->dev);
drivers/scsi/scsi_scan.c static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, · line 278
Quoted 6 lines
drivers/scsi/scsi_scan.c +0
-1@@ -275,7 +274,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, goto out; }WARN_ON_ONCE (!blk_get_queue (sdev->request_queue)); - sdev->request_queue->queuedata = sdev; depth = sdev->host->cmd_per_lun ?:1 ;
Since scsi_mq_alloc_queue() only has one caller, please inline scsi_mq_alloc_queue() instead of making this change. See also
https://lore.kernel.org/linux-scsi/[email protected]/
Thanks,
Bart.
Quoted 32 lines · Bart Van Assche
Quoted 31 lines · Ed Tsai
sdev->reqeust_queueand its queuedata have been set up inscsi_mq_alloc_queue(). No need to do that again.Signed-off-by Ed Tsai <[email protected]>--- drivers/scsi/scsi_scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/scsi/scsi_scan.c +1
-2@@ -266,8 +266,7 @@ static struct scsi_device*scsi_alloc_sdev(struct scsi_target *starget, */ sdev->borken =1 ; - sdev->request_queue =scsi_mq_alloc_queue (sdev); -if (!sdev->request_queue) { +if (!scsi_mq_alloc_queue (sdev)) {/* release fn is set up in
scsi_sysfs_device_initialise, sodrivers/scsi/scsi_scan.c +0
-1* have to free and put manually here */ put_device (&starget->dev);@@ -275,7 +274,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, goto out; } WARN_ON_ONCE(!blk_get_queue(sdev->request_queue)); - sdev->request_queue->queuedata = sdev;
Quoted 5 lines
drivers/scsi/scsi_scan.c static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, · line 278
Quoted 1 line
drivers/scsi/scsi_scan.c +0
-0depth = sdev->host->cmd_per_lun ?:1 ;Since
scsi_mq_alloc_queue()only has one caller, please inlinescsi_mq_alloc_queue()instead of making this change. See also
https://lore.kernel.org/linux-scsi/[email protected]/
Quoted 4 lines
Thanks,
Bart.
have planned to re-submit it?
Quoted 1 line · Ed Tsai
have planned to re-submit it?
That patch has just been resubmitted. I have Cc-ed you.
Thanks,
Bart.