mbox series

[0/7,v2] net: Fix platform_get_irq's error checking

Message ID 1512409703-20881-1-git-send-email-arvind.yadav.cs@gmail.com
Headers show
Series net: Fix platform_get_irq's error checking | expand

Message

Arvind Yadav Dec. 4, 2017, 5:48 p.m. UTC
The platform_get_irq() function returns negative number if an error
occurs, Zero if No irq is found and positive number if irq gets successful.
platform_get_irq() error checking for only zero is not correct.

Removed Other 3 patch which is not related to this series.

Arvind Yadav (7):
  [PATCH 1/7 v2] net: bcmgenet: Fix platform_get_irq's error checking
  [PATCH 2/7 v2] net: ezchip: nps_enet: Fix platform_get_irq's error checking
  [PATCH 3/7 v2] can: xilinx: Fix platform_get_irq's error checking
  [PATCH 4/7 v2] net: ethernet: i825xx: Fix platform_get_irq's error checking
  [PATCH 5/7 v2] net: ethernet: natsemi: Fix platform_get_irq's error checking
  [PATCH 6/7 v2] net: ethernet: smsc: Fix platform_get_irq's error checking
  [PATCH 7/7 v2] net: fjes: Fix platform_get_irq's error checking

 drivers/net/can/xilinx_can.c                   | 4 ++++
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
 drivers/net/ethernet/ezchip/nps_enet.c         | 4 ++--
 drivers/net/ethernet/i825xx/sni_82596.c        | 3 ++-
 drivers/net/ethernet/natsemi/jazzsonic.c       | 5 +++++
 drivers/net/ethernet/smsc/smc911x.c            | 5 +++++
 drivers/net/fjes/fjes_main.c                   | 5 +++++
 7 files changed, 24 insertions(+), 4 deletions(-)

Comments

Sergei Shtylyov Dec. 5, 2017, 9:54 a.m. UTC | #1
On 12/4/2017 8:48 PM, Arvind Yadav wrote:

> The platform_get_irq() function returns negative number if an error
> occurs, Zero if No irq is found and positive number if irq gets successful.

    No, returning 0 is not a failure indication anymore. It used to be but not 
any longer...

> platform_get_irq() error checking for only zero is not correct.

[...]

MBR, Sergei
Sergei Shtylyov Dec. 5, 2017, 9:57 a.m. UTC | #2
On 12/5/2017 12:54 PM, Sergei Shtylyov wrote:

>> The platform_get_irq() function returns negative number if an error
>> occurs, Zero if No irq is found and positive number if irq gets successful.
> 
>     No, returning 0 is not a failure indication anymore! It used to be but not 
> any longer...

    And I fixed this function exactly to avoid overly complex error checks 
(which you're trying to propose here).

>> platform_get_irq() error checking for only zero is not correct.
> 
> [...]

MBR, Sergei
Arvind Yadav Dec. 5, 2017, 10:02 a.m. UTC | #3
Hi Sergei,


On Tuesday 05 December 2017 03:27 PM, Sergei Shtylyov wrote:
> On 12/5/2017 12:54 PM, Sergei Shtylyov wrote:
>
>>> The platform_get_irq() function returns negative number if an error
>>> occurs, Zero if No irq is found and positive number if irq gets 
>>> successful.
>>
>>     No, returning 0 is not a failure indication anymore! It used to 
>> be but not any longer...
>
>    And I fixed this function exactly to avoid overly complex error 
> checks (which you're trying to propose here).
>
Thanks for your comment. yes you are right. Now It'll not return 0. It 
will return irq and error as negative.
I will not add a check for 0.
>>> platform_get_irq() error checking for only zero is not correct.
>>
>> [...]
>
> MBR, Sergei
Thank you,
~arvind