[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e1d5f1f-b51e-8f1a-d052-d6debed116e6@acm.org>
Date: Mon, 21 Jun 2021 10:21:42 -0700
From: Bart Van Assche <bvanassche@....org>
To: Ed Tsai <ed.tsai@...iatek.com>, jejb@...ux.ibm.com,
martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: remove reduntant assignment when alloc sdev
On 6/20/21 8:45 PM, Ed Tsai wrote:
> sdev->reqeust_queue and its queuedata have been set up in
> scsi_mq_alloc_queue(). No need to do that again.
>
> Signed-off-by: Ed Tsai <ed.tsai@...iatek.com>
> ---
> drivers/scsi/scsi_scan.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 12f54571b83e..82c1792f1de2 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -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;
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/20201123031749.14912-5-bvanassche@acm.org/
Thanks,
Bart.
Powered by blists - more mailing lists