* [PATCH] ata: remove redundant error print in rb532_pata_driver_probe
@ 2021-01-12 2:36 menglong8.dong
2021-01-12 11:15 ` Sergei Shtylyov
0 siblings, 1 reply; 6+ messages in thread
From: menglong8.dong @ 2021-01-12 2:36 UTC (permalink / raw)
To: axboe; +Cc: linux-ide, linux-kernel, Menglong Dong
From: Menglong Dong <dong.menglong@zte.com.cn>
Coccinelle reports a redundant error print in rb532_pata_driver_probe.
As 'platform_get_irq' already prints the error message, error print
here is redundant and can be removed.
Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
---
drivers/ata/pata_rb532_cf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
index 479c4b29b856..dcde84f571c4 100644
--- a/drivers/ata/pata_rb532_cf.c
+++ b/drivers/ata/pata_rb532_cf.c
@@ -115,10 +115,8 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
}
irq = platform_get_irq(pdev, 0);
- if (irq <= 0) {
- dev_err(&pdev->dev, "no IRQ resource found\n");
+ if (irq <= 0)
return -ENOENT;
- }
gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_IN);
if (IS_ERR(gpiod)) {
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ata: remove redundant error print in rb532_pata_driver_probe
2021-01-12 2:36 [PATCH] ata: remove redundant error print in rb532_pata_driver_probe menglong8.dong
@ 2021-01-12 11:15 ` Sergei Shtylyov
2021-01-13 14:04 ` Menglong Dong
2021-01-14 15:49 ` Sergei Shtylyov
0 siblings, 2 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2021-01-12 11:15 UTC (permalink / raw)
To: menglong8.dong, axboe; +Cc: linux-ide, linux-kernel, Menglong Dong
Hello!
On 1/12/21 5:36 AM, menglong8.dong@gmail.com wrote:
> From: Menglong Dong <dong.menglong@zte.com.cn>
>
> Coccinelle reports a redundant error print in rb532_pata_driver_probe.
> As 'platform_get_irq' already prints the error message, error print
> here is redundant and can be removed.
>
> Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
> ---
> drivers/ata/pata_rb532_cf.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
> index 479c4b29b856..dcde84f571c4 100644
> --- a/drivers/ata/pata_rb532_cf.c
> +++ b/drivers/ata/pata_rb532_cf.c
> @@ -115,10 +115,8 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
> }
>
> irq = platform_get_irq(pdev, 0);
> - if (irq <= 0) {
> - dev_err(&pdev->dev, "no IRQ resource found\n");
> + if (irq <= 0)
> return -ENOENT;
This still beaks the probe deferral. :-(
But that's another problem...
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ata: remove redundant error print in rb532_pata_driver_probe
2021-01-12 11:15 ` Sergei Shtylyov
@ 2021-01-13 14:04 ` Menglong Dong
2021-01-14 8:29 ` Sergei Shtylyov
2021-01-14 15:49 ` Sergei Shtylyov
1 sibling, 1 reply; 6+ messages in thread
From: Menglong Dong @ 2021-01-13 14:04 UTC (permalink / raw)
To: Sergei Shtylyov, axboe; +Cc: linux-ide, LKML, Menglong Dong
Hello, Sergei
On Tue, Jan 12, 2021 at 7:15 PM Sergei Shtylyov
<sergei.shtylyov@gmail.com> wrote:
>
> Hello!
>
> On 1/12/21 5:36 AM, menglong8.dong@gmail.com wrote:
>
[....]
> > irq = platform_get_irq(pdev, 0);
> > - if (irq <= 0) {
> > - dev_err(&pdev->dev, "no IRQ resource found\n");
> > + if (irq <= 0)
> > return -ENOENT;
>
> This still beaks the probe deferral. :-(
> But that's another problem...
>
> [...]
>
> MBR, Sergei
What does this 'MBR' mean? I am a novice~~~
So, is it better to replace 'platform_get_irq' with
'platform_get_irq_optional' here?
--
Best Regards
Menglong Dong
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ata: remove redundant error print in rb532_pata_driver_probe
2021-01-13 14:04 ` Menglong Dong
@ 2021-01-14 8:29 ` Sergei Shtylyov
2021-01-14 14:53 ` Menglong Dong
0 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2021-01-14 8:29 UTC (permalink / raw)
To: Menglong Dong, axboe; +Cc: linux-ide, LKML, Menglong Dong
Hello!
On 13.01.2021 17:04, Menglong Dong wrote:
[...]
>>> irq = platform_get_irq(pdev, 0);
>>> - if (irq <= 0) {
>>> - dev_err(&pdev->dev, "no IRQ resource found\n");
>>> + if (irq <= 0)
>>> return -ENOENT;
>>
>> This still beaks the probe deferral. :-(
>> But that's another problem...
>>
>> [...]
>>
>> MBR, Sergei
>
> What does this 'MBR' mean? I am a novice~~~
Generally speaking, Master Boot Record. But I also use it to send you My
Best Regards. :-)
> So, is it better to replace 'platform_get_irq' with
> 'platform_get_irq_optional' here?
No. You should stop overriding the result to -ENOENT and pass the result
up the call chain instead. In order to do it, you should only check for (irq < 0).
> --
> Best Regards
> Menglong Dong
MBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ata: remove redundant error print in rb532_pata_driver_probe
2021-01-14 8:29 ` Sergei Shtylyov
@ 2021-01-14 14:53 ` Menglong Dong
0 siblings, 0 replies; 6+ messages in thread
From: Menglong Dong @ 2021-01-14 14:53 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: axboe, linux-ide, LKML, Menglong Dong
On Thu, Jan 14, 2021 at 4:30 PM Sergei Shtylyov
<sergei.shtylyov@gmail.com> wrote:
[...]
> >
> > What does this 'MBR' mean? I am a novice~~~
>
> Generally speaking, Master Boot Record. But I also use it to send you My
> Best Regards. :-)
Haha~,
> > So, is it better to replace 'platform_get_irq' with
> > 'platform_get_irq_optional' here?
>
> No. You should stop overriding the result to -ENOENT and pass the result
> up the call chain instead. In order to do it, you should only check for (irq < 0).
Well, I didn't even notice this. It does seem to be another problem...
---
Best Regards
Menglong Dong
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ata: remove redundant error print in rb532_pata_driver_probe
2021-01-12 11:15 ` Sergei Shtylyov
2021-01-13 14:04 ` Menglong Dong
@ 2021-01-14 15:49 ` Sergei Shtylyov
1 sibling, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2021-01-14 15:49 UTC (permalink / raw)
To: menglong8.dong, axboe; +Cc: linux-ide, linux-kernel, Menglong Dong
On 1/12/21 2:15 PM, Sergei Shtylyov wrote:
[...]
>> From: Menglong Dong <dong.menglong@zte.com.cn>
>>
>> Coccinelle reports a redundant error print in rb532_pata_driver_probe.
>> As 'platform_get_irq' already prints the error message, error print
>> here is redundant and can be removed.
>>
>> Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
>> ---
>> drivers/ata/pata_rb532_cf.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
>> index 479c4b29b856..dcde84f571c4 100644
>> --- a/drivers/ata/pata_rb532_cf.c
>> +++ b/drivers/ata/pata_rb532_cf.c
>> @@ -115,10 +115,8 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
>> }
>>
>> irq = platform_get_irq(pdev, 0);
>> - if (irq <= 0) {
>> - dev_err(&pdev->dev, "no IRQ resource found\n");
>> + if (irq <= 0)
>> return -ENOENT;
>
> This still beaks the probe deferral. :-(
> But that's another problem...
BTW, your patch summary looks quite wrong -- we need the prefix to specify the patch locus,
like this:
pata_rb532_cf: remove redundant error printing in the probe() method
I.e. "ata: " may even be omitted (your choise though).
> [...]
MBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-01-14 15:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 2:36 [PATCH] ata: remove redundant error print in rb532_pata_driver_probe menglong8.dong
2021-01-12 11:15 ` Sergei Shtylyov
2021-01-13 14:04 ` Menglong Dong
2021-01-14 8:29 ` Sergei Shtylyov
2021-01-14 14:53 ` Menglong Dong
2021-01-14 15:49 ` Sergei Shtylyov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.