netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ipa: Remove redundant dev_err()
@ 2022-12-11 14:47 Kang Minchul
  2022-12-11 16:34 ` Heiner Kallweit
  0 siblings, 1 reply; 4+ messages in thread
From: Kang Minchul @ 2022-12-11 14:47 UTC (permalink / raw)
  To: Alex Elder, David S . Miller, Jakub Kicinski
  Cc: netdev, linux-kernel, Kang Minchul

Function dev_err() is redundant because platform_get_irq_byname()
already prints an error.

Signed-off-by: Kang Minchul <tegongkang@gmail.com>
---
 drivers/net/ipa/gsi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index 55226b264e3c..585cfd3f9ec0 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -1967,11 +1967,8 @@ int gsi_init(struct gsi *gsi, struct platform_device *pdev, bool prefetch,
 
 	/* Get the GSI IRQ and request for it to wake the system */
 	ret = platform_get_irq_byname(pdev, "gsi");
-	if (ret <= 0) {
-		dev_err(gsi->dev,
-			"DT error %d getting \"gsi\" IRQ property\n", ret);
+	if (ret <= 0)
 		return ret ? : -EINVAL;
-	}
 	irq = ret;
 
 	ret = request_irq(irq, gsi_isr, 0, "gsi", gsi);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ipa: Remove redundant dev_err()
  2022-12-11 14:47 [PATCH] net: ipa: Remove redundant dev_err() Kang Minchul
@ 2022-12-11 16:34 ` Heiner Kallweit
  2022-12-12  7:19   ` Kang Minchul
  2022-12-12 13:11   ` Alex Elder
  0 siblings, 2 replies; 4+ messages in thread
From: Heiner Kallweit @ 2022-12-11 16:34 UTC (permalink / raw)
  To: Kang Minchul, Alex Elder, David S . Miller, Jakub Kicinski
  Cc: netdev, linux-kernel

On 11.12.2022 15:47, Kang Minchul wrote:
> Function dev_err() is redundant because platform_get_irq_byname()
> already prints an error.
> 
> Signed-off-by: Kang Minchul <tegongkang@gmail.com>
> ---
>  drivers/net/ipa/gsi.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
> index 55226b264e3c..585cfd3f9ec0 100644
> --- a/drivers/net/ipa/gsi.c
> +++ b/drivers/net/ipa/gsi.c
> @@ -1967,11 +1967,8 @@ int gsi_init(struct gsi *gsi, struct platform_device *pdev, bool prefetch,
>  
>  	/* Get the GSI IRQ and request for it to wake the system */
>  	ret = platform_get_irq_byname(pdev, "gsi");
> -	if (ret <= 0) {
> -		dev_err(gsi->dev,
> -			"DT error %d getting \"gsi\" IRQ property\n", ret);
> +	if (ret <= 0)

According to the function description it can't return 0.
You can further simplify the code.
And you patch should be annotated net-next.

>  		return ret ? : -EINVAL;
> -	}
>  	irq = ret;
>  
>  	ret = request_irq(irq, gsi_isr, 0, "gsi", gsi);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ipa: Remove redundant dev_err()
  2022-12-11 16:34 ` Heiner Kallweit
@ 2022-12-12  7:19   ` Kang Minchul
  2022-12-12 13:11   ` Alex Elder
  1 sibling, 0 replies; 4+ messages in thread
From: Kang Minchul @ 2022-12-12  7:19 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Alex Elder, David S . Miller, Jakub Kicinski, netdev, linux-kernel

2022년 12월 12일 (월) 오전 1:34, Heiner Kallweit <hkallweit1@gmail.com>님이 작성:
>
> On 11.12.2022 15:47, Kang Minchul wrote:
> > Function dev_err() is redundant because platform_get_irq_byname()
> > already prints an error.
> >
> > Signed-off-by: Kang Minchul <tegongkang@gmail.com>
> > ---
> >  drivers/net/ipa/gsi.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
> > index 55226b264e3c..585cfd3f9ec0 100644
> > --- a/drivers/net/ipa/gsi.c
> > +++ b/drivers/net/ipa/gsi.c
> > @@ -1967,11 +1967,8 @@ int gsi_init(struct gsi *gsi, struct platform_device *pdev, bool prefetch,
> >
> >       /* Get the GSI IRQ and request for it to wake the system */
> >       ret = platform_get_irq_byname(pdev, "gsi");
> > -     if (ret <= 0) {
> > -             dev_err(gsi->dev,
> > -                     "DT error %d getting \"gsi\" IRQ property\n", ret);
> > +     if (ret <= 0)
>
> According to the function description it can't return 0.
> You can further simplify the code.
> And you patch should be annotated net-next.

Thanks for your feedback!
I just amended and sent v2.

Regards,
Kang Minchul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ipa: Remove redundant dev_err()
  2022-12-11 16:34 ` Heiner Kallweit
  2022-12-12  7:19   ` Kang Minchul
@ 2022-12-12 13:11   ` Alex Elder
  1 sibling, 0 replies; 4+ messages in thread
From: Alex Elder @ 2022-12-12 13:11 UTC (permalink / raw)
  To: Heiner Kallweit, Kang Minchul, Alex Elder, David S . Miller,
	Jakub Kicinski
  Cc: netdev, linux-kernel

On 12/11/22 10:34 AM, Heiner Kallweit wrote:
> On 11.12.2022 15:47, Kang Minchul wrote:
>> Function dev_err() is redundant because platform_get_irq_byname()
>> already prints an error.
>>
>> Signed-off-by: Kang Minchul <tegongkang@gmail.com>
>> ---
>>   drivers/net/ipa/gsi.c | 5 +----
>>   1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
>> index 55226b264e3c..585cfd3f9ec0 100644
>> --- a/drivers/net/ipa/gsi.c
>> +++ b/drivers/net/ipa/gsi.c
>> @@ -1967,11 +1967,8 @@ int gsi_init(struct gsi *gsi, struct platform_device *pdev, bool prefetch,
>>   
>>   	/* Get the GSI IRQ and request for it to wake the system */
>>   	ret = platform_get_irq_byname(pdev, "gsi");
>> -	if (ret <= 0) {
>> -		dev_err(gsi->dev,
>> -			"DT error %d getting \"gsi\" IRQ property\n", ret);
>> +	if (ret <= 0)
> 
> According to the function description it can't return 0.

That's great!  I explicitly checked for 0 because at the
time I couldn't *prove* that 0 was an invalid return, and
there was nothing obvious in the function saying so.  I
*thought* it was invalid but lacked the guidance in the
code to know for sure.

Here is the commit that fixed that:
   a85a6c86c25be driver core: platform: Clarify that IRQ 0 is invalid

And it turns out that this particular block of code got
moved but not modified after that comment commit:
   0b8d676108451 net: ipa: request GSI IRQ later

Anyway, I'm very pleased this can be simplified.

					-Alex

> You can further simplify the code.
> And you patch should be annotated net-next.
> 
>>   		return ret ? : -EINVAL;
>> -	}
>>   	irq = ret;
>>   
>>   	ret = request_irq(irq, gsi_isr, 0, "gsi", gsi);
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-12 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-11 14:47 [PATCH] net: ipa: Remove redundant dev_err() Kang Minchul
2022-12-11 16:34 ` Heiner Kallweit
2022-12-12  7:19   ` Kang Minchul
2022-12-12 13:11   ` Alex Elder

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).