From: arvindY <arvind.yadav.cs@gmail.com>
To: Russell King - ARM Linux <linux@armlinux.org.uk>,
David Miller <davem@davemloft.net>
Cc: f.fainelli@gmail.com, netdev@vger.kernel.org,
michal.simek@xilinx.com, linux-kernel@vger.kernel.org,
opendmb@gmail.com, mkl@pengutronix.de,
linux-arm-kernel@lists.infradead.org,
Vladislav.Zakharov@synopsys.com, wg@grandegger.com
Subject: Re: [PATCH 03/10] net: ezchip: nps_enet: Fix platform_get_irq's error checking
Date: Mon, 4 Dec 2017 22:14:51 +0530 [thread overview]
Message-ID: <5A257B83.7000803@gmail.com> (raw)
In-Reply-To: <20171204164224.GU10595@n2100.armlinux.org.uk>
On Monday 04 December 2017 10:12 PM, Russell King - ARM Linux wrote:
> On Mon, Dec 04, 2017 at 11:34:48AM -0500, David Miller wrote:
>> From: Russell King - ARM Linux <linux@armlinux.org.uk>
>> Date: Mon, 4 Dec 2017 16:24:47 +0000
>>
>>> On Mon, Dec 04, 2017 at 11:20:49AM -0500, David Miller wrote:
>>>> From: Arvind Yadav <arvind.yadav.cs@gmail.com>
>>>> Date: Sun, 3 Dec 2017 00:56:15 +0530
>>>>
>>>>> 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 <arvind.yadav.cs@gmail.com>
>>>>> ---
>>>>> drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
>>>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c
>>>>> index 659f1ad..82dc6d0 100644
>>>>> --- a/drivers/net/ethernet/ezchip/nps_enet.c
>>>>> +++ b/drivers/net/ethernet/ezchip/nps_enet.c
>>>>> @@ -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."
next prev parent reply other threads:[~2017-12-04 16:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-02 19:26 [PATCH 00/10] Handle return value of platform_get_* Arvind Yadav
2017-12-02 19:26 ` [PATCH 01/10] net: bcmgenet: Fix platform_get_irq's error checking Arvind Yadav
2017-12-02 19:26 ` [PATCH 02/10] net: bcmgenet: free netdev on of_match_node() error Arvind Yadav
2017-12-05 1:05 ` Doug Berger
2017-12-02 19:26 ` [PATCH 03/10] net: ezchip: nps_enet: Fix platform_get_irq's error checking Arvind Yadav
2017-12-04 16:20 ` David Miller
2017-12-04 16:24 ` Russell King - ARM Linux
2017-12-04 16:34 ` David Miller
2017-12-04 16:42 ` Russell King - ARM Linux
2017-12-04 16:44 ` arvindY [this message]
2017-12-02 19:26 ` [PATCH 04/10] can: xilinx: Handle return value of platform_get_irq Arvind Yadav
2017-12-02 19:26 ` [PATCH 05/10] net: ethernet: i825xx: Fix platform_get_irq's error checking Arvind Yadav
2017-12-02 20:08 ` Sergei Shtylyov
2017-12-02 20:22 ` arvindY
2017-12-02 19:26 ` [PATCH 06/10] net: ethernet: natsemi: Handle return value of platform_get_irq Arvind Yadav
2017-12-02 19:26 ` [PATCH 07/10] net: ethernet: smsc: " Arvind Yadav
2017-12-02 20:06 ` Sergei Shtylyov
2017-12-02 19:26 ` [PATCH 08/10] net: fjes: Handle return value of platform_get_irq and platform_get_resource Arvind Yadav
2017-12-02 20:06 ` Sergei Shtylyov
2017-12-02 20:26 ` arvindY
2017-12-02 19:26 ` [PATCH 09/10] net: ethernet: korina: Handle return value of platform_get_irq_byname Arvind Yadav
2017-12-02 19:26 ` [PATCH 10/10] net: ethernet: cpmac: " Arvind Yadav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5A257B83.7000803@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=Vladislav.Zakharov@synopsys.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=michal.simek@xilinx.com \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).