[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b26499be-e8e1-5812-a134-dbeb58118124@kernel.org>
Date: Mon, 15 May 2023 07:53:20 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Yahu Gao <yahu.gao@...look.com>
Cc: linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
Yahu Gao <gaoyh12@...ovo.com>, Jiwei Sun <sunjw10@...ovo.com>
Subject: Re: [PATCH v2] ata: libata-core: Simplies if condition
On 4/28/23 10:53, Yahu Gao wrote:
> ping ...
>
> 在 2023/4/22 20:14, Yahu Gao 写道:
>> From: Yahu Gao <gaoyh12@...ovo.com>
>>
>> Replace conditions of avoid issuing [P]IDENTIFY to PMP.
Please be a little more descriptive. Something like:
Simplify the condition used in ata_dev_revalidate() to not issue identify
commands to port multiplier devices.
would be better.
>>
>> Reviewed-by: Jiwei Sun <sunjw10@...ovo.com>
Where does this review come from ? I have never seen an email for it. I cannot
accept this tag without seeing the email for it.
>> Signed-off-by: Yahu Gao <gaoyh12@...ovo.com>
>>
>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>> index 14c17c3bda4e..53f65d751189 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) &&
Please keep the above "ata_class_enabled(new_class) &&" condition:
if (ata_class_enabled(new_class) && new_class == ATA_DEV_PMP) {
While keeping this condition is logically not necessary, having it makes the
code easier to understand.
>> - new_class != ATA_DEV_ATA &&
>> - new_class != ATA_DEV_ATAPI &&
>> - new_class != ATA_DEV_ZAC &&
>> - new_class != ATA_DEV_SEMB) {
>> + if (new_class == ATA_DEV_PMP) {
>> ata_dev_info(dev, "class mismatch %u != %u\n",
>> dev->class, new_class);
>> rc = -ENODEV;
Powered by blists - more mailing lists