linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: ipa: Remove superfluous error message around platform_get_irq()
@ 2021-06-10 14:01  Zhongjun Tan
  2021-06-10 21:11 ` David Miller
  2021-06-10 21:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From:  Zhongjun Tan @ 2021-06-10 14:01 UTC (permalink / raw)
  To: elder, davem, kuba; +Cc: netdev, linux-kernel, Tan Zhongjun

From: Tan Zhongjun <tanzhongjun@yulong.com>

The platform_get_irq() prints error message telling that interrupt is
missing,hence there is no need to duplicated that message in the
drivers.

Signed-off-by: Tan Zhongjun <tanzhongjun@yulong.com>
---
 drivers/net/ipa/ipa_smp2p.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c
index 34b68dc43886..93270e50b6b3 100644
--- a/drivers/net/ipa/ipa_smp2p.c
+++ b/drivers/net/ipa/ipa_smp2p.c
@@ -177,11 +177,8 @@ static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p, const char *name,
 	int ret;
 
 	ret = platform_get_irq_byname(smp2p->ipa->pdev, name);
-	if (ret <= 0) {
-		dev_err(dev, "DT error %d getting \"%s\" IRQ property\n",
-			ret, name);
+	if (ret <= 0)
 		return ret ? : -EINVAL;
-	}
 	irq = ret;
 
 	ret = request_threaded_irq(irq, NULL, handler, 0, name, smp2p);
-- 
2.17.1


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

* Re: [PATCH] soc: qcom: ipa: Remove superfluous error message around platform_get_irq()
  2021-06-10 14:01 [PATCH] soc: qcom: ipa: Remove superfluous error message around platform_get_irq()  Zhongjun Tan
@ 2021-06-10 21:11 ` David Miller
  2021-06-10 21:38   ` Alex Elder
  2021-06-10 21:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2021-06-10 21:11 UTC (permalink / raw)
  To: hbut_tan; +Cc: elder, kuba, netdev, linux-kernel, tanzhongjun

From:  Zhongjun Tan <hbut_tan@163.com>
Date: Thu, 10 Jun 2021 22:01:18 +0800

> diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c
> index 34b68dc43886..93270e50b6b3 100644
> --- a/drivers/net/ipa/ipa_smp2p.c
> +++ b/drivers/net/ipa/ipa_smp2p.c
> @@ -177,11 +177,8 @@ static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p, const char *name,
>  	int ret;
>  
>  	ret = platform_get_irq_byname(smp2p->ipa->pdev, name);
> -	if (ret <= 0) {
> -		dev_err(dev, "DT error %d getting \"%s\" IRQ property\n",
> -			ret, name);
> +	if (ret <= 0)
Applied, but this code still rejects an irq of zero which is a valid irq number.


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

* Re: [PATCH] soc: qcom: ipa: Remove superfluous error message around platform_get_irq()
  2021-06-10 14:01 [PATCH] soc: qcom: ipa: Remove superfluous error message around platform_get_irq()  Zhongjun Tan
  2021-06-10 21:11 ` David Miller
@ 2021-06-10 21:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-10 21:20 UTC (permalink / raw)
  To: Zhongjun Tan; +Cc: elder, davem, kuba, netdev, linux-kernel, tanzhongjun

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 10 Jun 2021 22:01:18 +0800 you wrote:
> From: Tan Zhongjun <tanzhongjun@yulong.com>
> 
> The platform_get_irq() prints error message telling that interrupt is
> missing,hence there is no need to duplicated that message in the
> drivers.
> 
> Signed-off-by: Tan Zhongjun <tanzhongjun@yulong.com>
> 
> [...]

Here is the summary with links:
  - soc: qcom: ipa: Remove superfluous error message around platform_get_irq()
    https://git.kernel.org/netdev/net-next/c/950fd045d76c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH] soc: qcom: ipa: Remove superfluous error message around platform_get_irq()
  2021-06-10 21:11 ` David Miller
@ 2021-06-10 21:38   ` Alex Elder
  2021-06-11  3:04     ` Zhongjun Tan
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Elder @ 2021-06-10 21:38 UTC (permalink / raw)
  To: David Miller, hbut_tan; +Cc: elder, kuba, netdev, linux-kernel, tanzhongjun

On 6/10/21 4:11 PM, David Miller wrote:
> From:  Zhongjun Tan <hbut_tan@163.com>
> Date: Thu, 10 Jun 2021 22:01:18 +0800
> 
>> diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c
>> index 34b68dc43886..93270e50b6b3 100644
>> --- a/drivers/net/ipa/ipa_smp2p.c
>> +++ b/drivers/net/ipa/ipa_smp2p.c
>> @@ -177,11 +177,8 @@ static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p, const char *name,
>>   	int ret;
>>   
>>   	ret = platform_get_irq_byname(smp2p->ipa->pdev, name);
>> -	if (ret <= 0) {
>> -		dev_err(dev, "DT error %d getting \"%s\" IRQ property\n",
>> -			ret, name);
>> +	if (ret <= 0)
> Applied, but this code still rejects an irq of zero which is a valid irq number.

It rejects IRQ 0 intentionally.  And if 0 is returned, there
will now be no message printed by the platform code.

As I recall, I looked for a *long* time to see whether IRQ 0
was a valid IRQ number in Linux.  One reason I even questioned
it is that NO_IRQ is defined with value 0 on some architectures
(though not for Arm).  I even asked Rob Herring about privately
it a few years back and he suggested I shouldn't allow 0.

Yes, it *looked* like IRQ 0 could be a valid return.  But I
decided it was safer to just reject it, on the assumption
that it's unlikely to be returned (I don't believe it is
or ever will be used as the IRQ for SMP2P).

If you are certain it's valid, and should be allowed, I
have no objection to changing that "<=" to be "<".

					-Alex

PS  A quick search found this oldie:
       https://yarchive.net/comp/linux/no_irq.html

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

* Re: [PATCH] soc: qcom: ipa: Remove superfluous error message around platform_get_irq()
  2021-06-10 21:38   ` Alex Elder
@ 2021-06-11  3:04     ` Zhongjun Tan
  0 siblings, 0 replies; 5+ messages in thread
From: Zhongjun Tan @ 2021-06-11  3:04 UTC (permalink / raw)
  To: Alex Elder; +Cc: David Miller, elder, kuba, netdev, linux-kernel, tanzhongjun

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB18030, Size: 1773 bytes --]

On Thu, 10 Jun 2021 16:38:43 -0500
Alex Elder <elder@ieee.org> wrote:

> On 6/10/21 4:11 PM, David Miller wrote:
> > From: 0„2Zhongjun Tan <hbut_tan@163.com>
> > Date: Thu, 10 Jun 2021 22:01:18 +0800
> >   
> >> diff --git a/drivers/net/ipa/ipa_smp2p.c
> >> b/drivers/net/ipa/ipa_smp2p.c index 34b68dc43886..93270e50b6b3
> >> 100644 --- a/drivers/net/ipa/ipa_smp2p.c
> >> +++ b/drivers/net/ipa/ipa_smp2p.c
> >> @@ -177,11 +177,8 @@ static int ipa_smp2p_irq_init(struct
> >> ipa_smp2p *smp2p, const char *name, int ret;
> >>   
> >>   	ret = platform_get_irq_byname(smp2p->ipa->pdev, name);
> >> -	if (ret <= 0) {
> >> -		dev_err(dev, "DT error %d getting \"%s\" IRQ
> >> property\n",
> >> -			ret, name);
> >> +	if (ret <= 0)  
> > Applied, but this code still rejects an irq of zero which is a
> > valid irq number.  
> 
> It rejects IRQ 0 intentionally.  And if 0 is returned, there
> will now be no message printed by the platform code.
> 
> As I recall, I looked for a *long* time to see whether IRQ 0
> was a valid IRQ number in Linux.  One reason I even questioned
> it is that NO_IRQ is defined with value 0 on some architectures
> (though not for Arm).  I even asked Rob Herring about privately
> it a few years back and he suggested I shouldn't allow 0.
> 
> Yes, it *looked* like IRQ 0 could be a valid return.  But I
> decided it was safer to just reject it, on the assumption
> that it's unlikely to be returned (I don't believe it is
> or ever will be used as the IRQ for SMP2P).
> 
> If you are certain it's valid, and should be allowed, I
> have no objection to changing that "<=" to be "<".
> 
> 					-Alex
> 
> PS  A quick search found this oldie:
>        https://yarchive.net/comp/linux/no_irq.html

I think so , It is better to change "<=" to be "<".


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

end of thread, other threads:[~2021-06-11  3:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 14:01 [PATCH] soc: qcom: ipa: Remove superfluous error message around platform_get_irq()  Zhongjun Tan
2021-06-10 21:11 ` David Miller
2021-06-10 21:38   ` Alex Elder
2021-06-11  3:04     ` Zhongjun Tan
2021-06-10 21:20 ` patchwork-bot+netdevbpf

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