All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: remove reduntant assignment when alloc sdev
@ 2021-06-21  3:45 Ed Tsai
  2021-06-21 17:21 ` Bart Van Assche
  0 siblings, 1 reply; 4+ messages in thread
From: Ed Tsai @ 2021-06-21  3:45 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, Ed Tsai

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@mediatek.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;
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: remove reduntant assignment when alloc sdev
  2021-06-21  3:45 [PATCH] scsi: remove reduntant assignment when alloc sdev Ed Tsai
@ 2021-06-21 17:21 ` Bart Van Assche
  2021-06-22  1:27   ` Ed Tsai
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2021-06-21 17:21 UTC (permalink / raw)
  To: Ed Tsai, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

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@mediatek.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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: remove reduntant assignment when alloc sdev
  2021-06-21 17:21 ` Bart Van Assche
@ 2021-06-22  1:27   ` Ed Tsai
  2021-06-22  2:47     ` Bart Van Assche
  0 siblings, 1 reply; 4+ messages in thread
From: Ed Tsai @ 2021-06-22  1:27 UTC (permalink / raw)
  To: Bart Van Assche, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

On Tue, 2021-06-22 at 01:21 +0800, Bart Van Assche wrote:
> 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@mediatek.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.

have planned to re-submit it?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: remove reduntant assignment when alloc sdev
  2021-06-22  1:27   ` Ed Tsai
@ 2021-06-22  2:47     ` Bart Van Assche
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2021-06-22  2:47 UTC (permalink / raw)
  To: Ed Tsai, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

On 6/21/21 6:27 PM, Ed Tsai wrote:
> have planned to re-submit it?

That patch has just been resubmitted. I have Cc-ed you.

Thanks,

Bart.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-22  2:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21  3:45 [PATCH] scsi: remove reduntant assignment when alloc sdev Ed Tsai
2021-06-21 17:21 ` Bart Van Assche
2021-06-22  1:27   ` Ed Tsai
2021-06-22  2:47     ` Bart Van Assche

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.