diff mbox series

[v2,3/3] ata: libata-scsi: Use ata_ncq_supported in ata_scsi_dev_config()

Message ID 20230605105244.1045490-4-dlemoal@kernel.org
State New
Headers show
Series Cleanups and improvements | expand

Commit Message

Damien Le Moal June 5, 2023, 10:52 a.m. UTC
In ata_scsi_dev_config(), instead of hard-coding the test to check if
an ATA device supports NCQ by looking at the ATA_DFLAG_NCQ flag, use
ata_ncq_supported().

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 drivers/ata/libata-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Thumshirn June 5, 2023, 11 a.m. UTC | #1
On 05.06.23 12:53, Damien Le Moal wrote:
> In ata_scsi_dev_config(), instead of hard-coding the test to check if
> an ATA device supports NCQ by looking at the ATA_DFLAG_NCQ flag, use
> ata_ncq_supported().
> 
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/ata/libata-scsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index 7bb12deab70c..9e79998e3958 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -1122,7 +1122,7 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
>  	if (dev->flags & ATA_DFLAG_AN)
>  		set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
>  
> -	if (dev->flags & ATA_DFLAG_NCQ)
> +	if (ata_ncq_supported(dev))
>  		depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
>  	depth = min(ATA_MAX_QUEUE, depth);
>  	scsi_change_queue_depth(sdev, depth);
John Garry June 5, 2023, 12:32 p.m. UTC | #2
On 05/06/2023 11:52, Damien Le Moal wrote:
> In ata_scsi_dev_config(), instead of hard-coding the test to check if
> an ATA device supports NCQ by looking at the ATA_DFLAG_NCQ flag, use
> ata_ncq_supported().
> 
> Signed-off-by: Damien Le Moal<dlemoal@kernel.org>
> Reviewed-by: Hannes Reinecke<hare@suse.de>
> ---

Reviewed-by: John Garry <john.g.garry@oracle.com>
Johannes Thumshirn June 5, 2023, 12:40 p.m. UTC | #3
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 7bb12deab70c..9e79998e3958 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1122,7 +1122,7 @@  int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
 	if (dev->flags & ATA_DFLAG_AN)
 		set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
 
-	if (dev->flags & ATA_DFLAG_NCQ)
+	if (ata_ncq_supported(dev))
 		depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
 	depth = min(ATA_MAX_QUEUE, depth);
 	scsi_change_queue_depth(sdev, depth);