All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] brcmfmac: fix error handling of irq_of_parse_and_map
@ 2014-11-14 22:12 Dmitry Torokhov
  2014-11-16 13:02   ` Arend van Spriel
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2014-11-14 22:12 UTC (permalink / raw)
  To: John W. Linville
  Cc: Brett Rudley, Arend van Spriel, Franky (Zhenhui) Lin,
	Hante Meuleman, Pieter-Paul Giesberts, linux-wireless,
	brcm80211-dev-list, netdev, linux-kernel

Return value of irq_of_parse_and_map() is unsigned int, with 0
indicating failure, so testing for negative result never works.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
---

Not tested, found by casual code inspection.

 drivers/net/wireless/brcm80211/brcmfmac/of.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c
index eb3fce82..c824570 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/of.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c
@@ -40,8 +40,8 @@ void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev)
 		return;
 
 	irq = irq_of_parse_and_map(np, 0);
-	if (irq < 0) {
-		brcmf_err("interrupt could not be mapped: err=%d\n", irq);
+	if (!irq) {
+		brcmf_err("interrupt could not be mapped\n");
 		devm_kfree(dev, sdiodev->pdata);
 		return;
 	}
-- 
2.1.0.rc2.206.gedb03e5


-- 
Dmitry

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

* Re: [PATCH] brcmfmac: fix error handling of irq_of_parse_and_map
  2014-11-14 22:12 [PATCH] brcmfmac: fix error handling of irq_of_parse_and_map Dmitry Torokhov
@ 2014-11-16 13:02   ` Arend van Spriel
  0 siblings, 0 replies; 3+ messages in thread
From: Arend van Spriel @ 2014-11-16 13:02 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: John W. Linville, Brett Rudley, Franky (Zhenhui) Lin,
	Hante Meuleman, Pieter-Paul Giesberts, linux-wireless,
	brcm80211-dev-list, netdev, linux-kernel, Hans de Goede

On 11/14/14 23:12, Dmitry Torokhov wrote:
> Return value of irq_of_parse_and_map() is unsigned int, with 0
> indicating failure, so testing for negative result never works.

Whoops, that is bad. Thanks for catching this. It probably needs to go 
to stable as well for 3.17 kernel.

+Cc: stable@vger.kernel.org # v3.17
+Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Dmitry Torokhov<dtor@chromium.org>
> ---
>
> Not tested, found by casual code inspection.
>
>   drivers/net/wireless/brcm80211/brcmfmac/of.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c
> index eb3fce82..c824570 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/of.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c
> @@ -40,8 +40,8 @@ void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev)
>   		return;
>
>   	irq = irq_of_parse_and_map(np, 0);
> -	if (irq<  0) {
> -		brcmf_err("interrupt could not be mapped: err=%d\n", irq);
> +	if (!irq) {
> +		brcmf_err("interrupt could not be mapped\n");
>   		devm_kfree(dev, sdiodev->pdata);
>   		return;
>   	}


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

* Re: [PATCH] brcmfmac: fix error handling of irq_of_parse_and_map
@ 2014-11-16 13:02   ` Arend van Spriel
  0 siblings, 0 replies; 3+ messages in thread
From: Arend van Spriel @ 2014-11-16 13:02 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: John W. Linville, Brett Rudley, Franky (Zhenhui) Lin,
	Hante Meuleman, Pieter-Paul Giesberts,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Hans de Goede

On 11/14/14 23:12, Dmitry Torokhov wrote:
> Return value of irq_of_parse_and_map() is unsigned int, with 0
> indicating failure, so testing for negative result never works.

Whoops, that is bad. Thanks for catching this. It probably needs to go 
to stable as well for 3.17 kernel.

+Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org # v3.17
+Acked-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Dmitry Torokhov<dtor-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>
> Not tested, found by casual code inspection.
>
>   drivers/net/wireless/brcm80211/brcmfmac/of.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c
> index eb3fce82..c824570 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/of.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c
> @@ -40,8 +40,8 @@ void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev)
>   		return;
>
>   	irq = irq_of_parse_and_map(np, 0);
> -	if (irq<  0) {
> -		brcmf_err("interrupt could not be mapped: err=%d\n", irq);
> +	if (!irq) {
> +		brcmf_err("interrupt could not be mapped\n");
>   		devm_kfree(dev, sdiodev->pdata);
>   		return;
>   	}

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-11-16 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-14 22:12 [PATCH] brcmfmac: fix error handling of irq_of_parse_and_map Dmitry Torokhov
2014-11-16 13:02 ` Arend van Spriel
2014-11-16 13:02   ` Arend van Spriel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.