The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/can/xilinx_can.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -1111,6 +1111,10 @@ static int xcan_probe(struct platform_device *pdev)/* Get IRQ for the device */ndev->irq=platform_get_irq(pdev,0);+if(ndev->irq<=0){+ret=ndev->irq?ndev->irq:-ENODEV;+gotoerr_free;+}ndev->flags|=IFF_ECHO;/* We support local echo */platform_set_drvdata(pdev,ndev);
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/natsemi/jazzsonic.c | 5 +++++
1 file changed, 5 insertions(+)
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/smsc/smc911x.c | 5 +++++
1 file changed, 5 insertions(+)
platform_get_irq_byname() can fail here and we must check its return
value.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/korina.c | 9 +++++++++
1 file changed, 9 insertions(+)
platform_get_irq_byname() can fail here and we must check its return
value
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/ti/cpmac.c | 4 ++++
1 file changed, 4 insertions(+)
platform_get_irq() and platform_get_resource() can fail here and
we must check its return value.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/fjes/fjes_main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/i825xx/sni_82596.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -120,9 +120,10 @@ static int sni_82596_probe(struct platform_device *dev)netdevice->dev_addr[5]=readb(eth_addr+0x06);iounmap(eth_addr);-if(!netdevice->irq){+if(netdevice->irq<=0){printk(KERN_ERR"%s: IRQ not found for i82596 at 0x%lx\n",__FILE__,netdevice->base_addr);+retval=netdevice->irq?netdevice->irq:-ENODEV;gotoprobe_failed;}
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct. And remove unnecessary check for free_netdev().
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
@@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev)/* Get IRQ number */priv->irq=platform_get_irq(pdev,0);-if(!priv->irq){+if(priv->irq<=0){dev_err(dev,"failed to retrieve <irq Rx-Tx> value from device tree\n");-err=-ENODEV;+err=priv->irq?priv->irq:-ENODEV;gotoout_netdev;}
From: Sergei Shtylyov <hidden> Date: 2017-12-02 20:06:15
Hello!
On 12/02/2017 10:26 PM, Arvind Yadav wrote:
quoted hunk
platform_get_irq() and platform_get_resource() can fail here and
we must check its return value.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/fjes/fjes_main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
From: Sergei Shtylyov <hidden> Date: 2017-12-02 20:07:01
On 12/02/2017 10:26 PM, Arvind Yadav wrote:
quoted hunk
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/smsc/smc911x.c | 5 +++++
1 file changed, 5 insertions(+)
From: Sergei Shtylyov <hidden> Date: 2017-12-02 20:08:52
Hello.
On 12/02/2017 10:26 PM, Arvind Yadav wrote:
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.
The why you consider returning 0 a sign of failure?
@@ -120,9 +120,10 @@ static int sni_82596_probe(struct platform_device *dev)netdevice->dev_addr[5]=readb(eth_addr+0x06);iounmap(eth_addr);-if(!netdevice->irq){+if(netdevice->irq<=0){printk(KERN_ERR"%s: IRQ not found for i82596 at 0x%lx\n",__FILE__,netdevice->base_addr);+retval=netdevice->irq?netdevice->irq:-ENODEV;gotoprobe_failed;}
Hi Sergei,
On Sunday 03 December 2017 01:38 AM, Sergei Shtylyov wrote:
Hello.
On 12/02/2017 10:26 PM, Arvind Yadav wrote:
quoted
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.
The why you consider returning 0 a sign of failure?
Here, Returning 0 is a problem. Because IRQ0 is always a problem.
This function is for getting an IRQ for a device. So we should check for
0 also.
@@ -120,9 +120,10 @@ static int sni_82596_probe(struct platform_device *dev)netdevice->dev_addr[5]=readb(eth_addr+0x06);iounmap(eth_addr);-if(!netdevice->irq){+if(netdevice->irq<=0){printk(KERN_ERR"%s: IRQ not found for i82596 at 0x%lx\n",__FILE__,netdevice->base_addr);+retval=netdevice->irq?netdevice->irq:-ENODEV;gotoprobe_failed;}
Hi Sergei,
On Sunday 03 December 2017 01:36 AM, Sergei Shtylyov wrote:
Hello!
On 12/02/2017 10:26 PM, Arvind Yadav wrote:
quoted
platform_get_irq() and platform_get_resource() can fail here and
we must check its return value.
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/fjes/fjes_main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct. And remove unnecessary check for free_netdev().
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
@@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev)/* Get IRQ number */priv->irq=platform_get_irq(pdev,0);-if(!priv->irq){+if(priv->irq<=0){dev_err(dev,"failed to retrieve <irq Rx-Tx> value from device tree\n");-err=-ENODEV;+err=priv->irq?priv->irq:-ENODEV;
If platform_get_irq() returns "zero or positive number on success" then this
test is wrong and should be "if (priv->irq < 0)"
Also, this series is a mix of different kinds of changes.
Please separate out the platform IRQ error checking and just submit exactly
those changes as a patch series.
The other bug fixes should be submitted outside of those changes since they
are unrelated.
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct. And remove unnecessary check for free_netdev().
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
@@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev)/* Get IRQ number */priv->irq=platform_get_irq(pdev,0);-if(!priv->irq){+if(priv->irq<=0){dev_err(dev,"failed to retrieve <irq Rx-Tx> value from device tree\n");-err=-ENODEV;+err=priv->irq?priv->irq:-ENODEV;
If platform_get_irq() returns "zero or positive number on success" then this
test is wrong and should be "if (priv->irq < 0)"
Also, this series is a mix of different kinds of changes.
Please separate out the platform IRQ error checking and just submit exactly
those changes as a patch series.
The other bug fixes should be submitted outside of those changes since they
are unrelated.
The issue of whether IRQ 0 is valid or not has been covered several times
by Linus, and the result is that it is deemed by Linus that IRQ 0 is not
a valid interrupt.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct. And remove unnecessary check for free_netdev().
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
@@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev)/* Get IRQ number */priv->irq=platform_get_irq(pdev,0);-if(!priv->irq){+if(priv->irq<=0){dev_err(dev,"failed to retrieve <irq Rx-Tx> value from device tree\n");-err=-ENODEV;+err=priv->irq?priv->irq:-ENODEV;
If platform_get_irq() returns "zero or positive number on success" then this
test is wrong and should be "if (priv->irq < 0)"
Also, this series is a mix of different kinds of changes.
Please separate out the platform IRQ error checking and just submit exactly
those changes as a patch series.
The other bug fixes should be submitted outside of those changes since they
are unrelated.
The issue of whether IRQ 0 is valid or not has been covered several times
by Linus, and the result is that it is deemed by Linus that IRQ 0 is not
a valid interrupt.
Then either platform_get_irq() as defined or this commit message (or both)
are wrong.
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct. And remove unnecessary check for free_netdev().
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
@@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev)/* Get IRQ number */priv->irq=platform_get_irq(pdev,0);-if(!priv->irq){+if(priv->irq<=0){dev_err(dev,"failed to retrieve <irq Rx-Tx> value from device tree\n");-err=-ENODEV;+err=priv->irq?priv->irq:-ENODEV;
If platform_get_irq() returns "zero or positive number on success" then this
test is wrong and should be "if (priv->irq < 0)"
Also, this series is a mix of different kinds of changes.
Please separate out the platform IRQ error checking and just submit exactly
those changes as a patch series.
The other bug fixes should be submitted outside of those changes since they
are unrelated.
The issue of whether IRQ 0 is valid or not has been covered several times
by Linus, and the result is that it is deemed by Linus that IRQ 0 is not
a valid interrupt.
Then either platform_get_irq() as defined or this commit message (or both)
are wrong.
Indeed, the commit message is wrong, and that's already been pointed out
in previous patch sets.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct. And remove unnecessary check for free_netdev().
Signed-off-by: Arvind Yadav <redacted>
---
drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
@@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev)/* Get IRQ number */priv->irq=platform_get_irq(pdev,0);-if(!priv->irq){+if(priv->irq<=0){dev_err(dev,"failed to retrieve <irq Rx-Tx> value from device tree\n");-err=-ENODEV;+err=priv->irq?priv->irq:-ENODEV;
If platform_get_irq() returns "zero or positive number on success" then this
test is wrong and should be "if (priv->irq < 0)"
Also, this series is a mix of different kinds of changes.
Please separate out the platform IRQ error checking and just submit exactly
those changes as a patch series.
The other bug fixes should be submitted outside of those changes since they
are unrelated.
The issue of whether IRQ 0 is valid or not has been covered several times
by Linus, and the result is that it is deemed by Linus that IRQ 0 is not
a valid interrupt.
Then either platform_get_irq() as defined or this commit message (or both)
are wrong.
Indeed, the commit message is wrong, and that's already been pointed out
in previous patch sets.
I will change commit message. Commit message will be
" The platform_get_irq() function returns negative if an
error occurs, Zero if No irq found and positive number
on get irq successful. platform_get_irq() error checking for
only zero is not correct."