* [PATCH v2] ata: libata-core: Simplies if condition
@ 2023-04-22 12:14 Yahu Gao
2023-05-14 22:54 ` Damien Le Moal
0 siblings, 1 reply; 6+ messages in thread
From: Yahu Gao @ 2023-04-22 12:14 UTC (permalink / raw)
To: dlemoal; +Cc: linux-ide, linux-kernel, yahu.gao
Changes V1->V2:
Update the patch title.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] ata: libata-core: Simplies if condition
[not found] <20230422121415.6276-1-yahu.gao@outlook.com>
@ 2023-04-22 12:14 ` Yahu Gao
2023-04-28 1:53 ` Yahu Gao
0 siblings, 1 reply; 6+ messages in thread
From: Yahu Gao @ 2023-04-22 12:14 UTC (permalink / raw)
To: dlemoal; +Cc: linux-ide, linux-kernel, yahu.gao, Yahu Gao, Jiwei Sun
From: Yahu Gao <gaoyh12@lenovo.com>
Replace conditions of avoid issuing [P]IDENTIFY to PMP.
Reviewed-by: Jiwei Sun <sunjw10@lenovo.com>
Signed-off-by: Yahu Gao <gaoyh12@lenovo.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) &&
- 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;
--
2.39.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ata: libata-core: Simplies if condition
2023-04-22 12:14 ` [PATCH v2] ata: libata-core: Simplies if condition Yahu Gao
@ 2023-04-28 1:53 ` Yahu Gao
2023-04-28 9:51 ` Damien Le Moal
2023-05-14 22:53 ` Damien Le Moal
0 siblings, 2 replies; 6+ messages in thread
From: Yahu Gao @ 2023-04-28 1:53 UTC (permalink / raw)
To: dlemoal; +Cc: linux-ide, linux-kernel, Yahu Gao, Jiwei Sun
ping ...
在 2023/4/22 20:14, Yahu Gao 写道:
> From: Yahu Gao <gaoyh12@lenovo.com>
>
> Replace conditions of avoid issuing [P]IDENTIFY to PMP.
>
> Reviewed-by: Jiwei Sun <sunjw10@lenovo.com>
> Signed-off-by: Yahu Gao <gaoyh12@lenovo.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) &&
> - 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;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ata: libata-core: Simplies if condition
2023-04-28 1:53 ` Yahu Gao
@ 2023-04-28 9:51 ` Damien Le Moal
2023-05-14 22:53 ` Damien Le Moal
1 sibling, 0 replies; 6+ messages in thread
From: Damien Le Moal @ 2023-04-28 9:51 UTC (permalink / raw)
To: Yahu Gao; +Cc: linux-ide, linux-kernel, Yahu Gao, Jiwei Sun
On 4/28/23 10:53, Yahu Gao wrote:
> ping ...
>
> 在 2023/4/22 20:14, Yahu Gao 写道:
>> From: Yahu Gao <gaoyh12@lenovo.com>
>>
>> Replace conditions of avoid issuing [P]IDENTIFY to PMP.
>>
>> Reviewed-by: Jiwei Sun <sunjw10@lenovo.com>
>> Signed-off-by: Yahu Gao <gaoyh12@lenovo.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) &&
>> - 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;
Merge window is on-going, so I will not queue this right now. Also I need to
check this as you remove the call to ata_class_enabled() and I am not 100%
convinced that it is correct.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ata: libata-core: Simplies if condition
2023-04-28 1:53 ` Yahu Gao
2023-04-28 9:51 ` Damien Le Moal
@ 2023-05-14 22:53 ` Damien Le Moal
1 sibling, 0 replies; 6+ messages in thread
From: Damien Le Moal @ 2023-05-14 22:53 UTC (permalink / raw)
To: Yahu Gao; +Cc: linux-ide, linux-kernel, Yahu Gao, Jiwei Sun
On 4/28/23 10:53, Yahu Gao wrote:
> ping ...
>
> 在 2023/4/22 20:14, Yahu Gao 写道:
>> From: Yahu Gao <gaoyh12@lenovo.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@lenovo.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@lenovo.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;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ata: libata-core: Simplies if condition
2023-04-22 12:14 Yahu Gao
@ 2023-05-14 22:54 ` Damien Le Moal
0 siblings, 0 replies; 6+ messages in thread
From: Damien Le Moal @ 2023-05-14 22:54 UTC (permalink / raw)
To: Yahu Gao; +Cc: linux-ide, linux-kernel
On 4/22/23 21:14, Yahu Gao wrote:
> Changes V1->V2:
> Update the patch title.
This is not the correct way of specifying a patch changelog. This should be
added in the email, between the "---" and the "diff --git a/drivers/ata/..."
lines after the commit message.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-05-14 22:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230422121415.6276-1-yahu.gao@outlook.com>
2023-04-22 12:14 ` [PATCH v2] ata: libata-core: Simplies if condition Yahu Gao
2023-04-28 1:53 ` Yahu Gao
2023-04-28 9:51 ` Damien Le Moal
2023-05-14 22:53 ` Damien Le Moal
2023-04-22 12:14 Yahu Gao
2023-05-14 22:54 ` Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).