Re: [PATCH] driver core: platform: Fix wrong comment

From: Randy Dunlap
Date: Sat Dec 25 2021 - 11:51:13 EST




On 12/25/21 08:47, Andy Shevchenko wrote:
> On Sat, Dec 25, 2021 at 2:02 AM Jiasheng Jiang <jiasheng@xxxxxxxxxxx> wrote:
>>
>> I notice that there is a 'WARN(ret == 0, "0 is an invalid IRQ
>> number\n");' before 'return ret;', which means that it is possible to
>> return 0 if fails.
>> Therefore, it might be better to correct the wrong comment.
>> And also there is reply sent by Damien Le Moal because I submitted a
>> patch to remove the non-zero check of the platform_get_irq() previously.
>> Damien Le Moal said that the comment for platform_get_irq() is wrond
>> because it can actually return 0.
>> Moreover, platform_get_irq() returns platform_get_irq_optional().
>> As a conclusion, the comments of the platform_get_irq() and
>> platform_get_irq_optional() should be fixed.
>> Not only that, the comments of platform_get_irq_byname() and
>> platform_get_irq_byname_optional() have the same error.
>> This time I only submit one as an example.
>> If the patch is right, I will submit another version to fix all.
>> But, I also notice that the 'return 0' is removed intentionally in the
>> fixed tag.
>> I am not sure which one is right.
>> Anyway, the success IRQ number should be 'postive' other than
>> 'non-zero'.
>> So the comment should be corrected.
>> Here is the mail from Damien Le Moal.
>
> ...
>
>> Fixes: c2f3f755f5c7 ("Revert "driver core: platform: Make platform_get_irq_optional() optional"")
>
> How can it be a Revert?

That's the "title" of that commit:


commit c2f3f755f5c7
Author: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Date: Wed Apr 7 11:47:56 2021 +0200

Revert "driver core: platform: Make platform_get_irq_optional() optional"

--
~Randy