diff mbox series

[v3] ata: libata-core: Simplies if condition

Message ID OS3P286MB0632EC8F4BE2127EF092F59B9E789@OS3P286MB0632.JPNP286.PROD.OUTLOOK.COM
State New
Headers show
Series [v3] ata: libata-core: Simplies if condition | expand

Commit Message

Yahu Gao May 15, 2023, 2:36 a.m. UTC
From: Yahu Gao <gaoyh12@lenovo.com>

Simplify the condition used in ata_dev_revalidate() to not
issue identify commands to port multiplier devices.

Signed-off-by: Yahu Gao <gaoyh12@lenovo.com>
---
 drivers/ata/libata-core.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Changes since V1:
 1. Update the subject
 2. Add more descriptive
 3. Remove review-by without email
 4. keep "ata_class_enabled(new_class) &&" condition

Comments

Damien Le Moal May 18, 2023, 11:17 p.m. UTC | #1
On 5/15/23 11:36, Yahu Gao wrote:
> From: Yahu Gao <gaoyh12@lenovo.com>
> 
> Simplify the condition used in ata_dev_revalidate() to not
> issue identify commands to port multiplier devices.
> 
> Signed-off-by: Yahu Gao <gaoyh12@lenovo.com>

Applied to for-6.5 with a fixed up commit title (typo... please run
scripts/checkpatch.pl next time). Thanks !

> ---
>  drivers/ata/libata-core.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> Changes since V1:
>  1. Update the subject
>  2. Add more descriptive
>  3. Remove review-by without email
>  4. keep "ata_class_enabled(new_class) &&" condition
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 14c17c3bda4e..2c9472b00f17 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -3802,11 +3802,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
>  		return -ENODEV;
>  
>  	/* fail early if !ATA && !ATAPI to avoid issuing [P]IDENTIFY to PMP */
> -	if (ata_class_enabled(new_class) &&
> -	    new_class != ATA_DEV_ATA &&
> -	    new_class != ATA_DEV_ATAPI &&
> -	    new_class != ATA_DEV_ZAC &&
> -	    new_class != ATA_DEV_SEMB) {
> +	if (ata_class_enabled(new_class) && new_class == ATA_DEV_PMP) {
>  		ata_dev_info(dev, "class mismatch %u != %u\n",
>  			     dev->class, new_class);
>  		rc = -ENODEV;
diff mbox series

Patch

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 14c17c3bda4e..2c9472b00f17 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3802,11 +3802,7 @@  int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
 		return -ENODEV;
 
 	/* fail early if !ATA && !ATAPI to avoid issuing [P]IDENTIFY to PMP */
-	if (ata_class_enabled(new_class) &&
-	    new_class != ATA_DEV_ATA &&
-	    new_class != ATA_DEV_ATAPI &&
-	    new_class != ATA_DEV_ZAC &&
-	    new_class != ATA_DEV_SEMB) {
+	if (ata_class_enabled(new_class) && new_class == ATA_DEV_PMP) {
 		ata_dev_info(dev, "class mismatch %u != %u\n",
 			     dev->class, new_class);
 		rc = -ENODEV;