All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe()
@ 2022-06-28 13:09 Peng Wu
  2022-06-29  9:27 ` Clément Léger
  2022-06-30  4:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Peng Wu @ 2022-06-28 13:09 UTC (permalink / raw)
  To: clement.leger, andrew, vivien.didelot, f.fainelli, olteanv,
	davem, edumazet, kuba, pabeni
  Cc: linux-renesas-soc, netdev, linux-kernel, liwei391, wupeng58

The devm_platform_ioremap_resource() function never returns NULL.
It returns error pointers.

Signed-off-by: Peng Wu <wupeng58@huawei.com>
Reported-by: Hulk Robot <hulkci@huawei.com>
---
 drivers/net/dsa/rzn1_a5psw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index 3e910da98ae2..5b14e2ba9b79 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -946,8 +946,8 @@ static int a5psw_probe(struct platform_device *pdev)
 	mutex_init(&a5psw->lk_lock);
 	spin_lock_init(&a5psw->reg_lock);
 	a5psw->base = devm_platform_ioremap_resource(pdev, 0);
-	if (!a5psw->base)
-		return -EINVAL;
+	if (IS_ERR(a5psw->base))
+		return PTR_ERR(a5psw->base);
 
 	ret = a5psw_pcs_get(a5psw);
 	if (ret)
-- 
2.17.1


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

* Re: [PATCH] net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe()
  2022-06-28 13:09 [PATCH] net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe() Peng Wu
@ 2022-06-29  9:27 ` Clément Léger
  2022-06-30  4:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Clément Léger @ 2022-06-29  9:27 UTC (permalink / raw)
  To: Peng Wu
  Cc: andrew, vivien.didelot, f.fainelli, olteanv, davem, edumazet,
	kuba, pabeni, linux-renesas-soc, netdev, linux-kernel, liwei391

Le Tue, 28 Jun 2022 13:09:20 +0000,
Peng Wu <wupeng58@huawei.com> a écrit :

> The devm_platform_ioremap_resource() function never returns NULL.
> It returns error pointers.
> 
> Signed-off-by: Peng Wu <wupeng58@huawei.com>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> ---
>  drivers/net/dsa/rzn1_a5psw.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
> index 3e910da98ae2..5b14e2ba9b79 100644
> --- a/drivers/net/dsa/rzn1_a5psw.c
> +++ b/drivers/net/dsa/rzn1_a5psw.c
> @@ -946,8 +946,8 @@ static int a5psw_probe(struct platform_device *pdev)
>  	mutex_init(&a5psw->lk_lock);
>  	spin_lock_init(&a5psw->reg_lock);
>  	a5psw->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (!a5psw->base)
> -		return -EINVAL;
> +	if (IS_ERR(a5psw->base))
> +		return PTR_ERR(a5psw->base);
>  
>  	ret = a5psw_pcs_get(a5psw);
>  	if (ret)

Thanks,

Reviewed-by: Clément Léger <clement.leger@bootlin.com>

-- 
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com

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

* Re: [PATCH] net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe()
  2022-06-28 13:09 [PATCH] net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe() Peng Wu
  2022-06-29  9:27 ` Clément Léger
@ 2022-06-30  4:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-30  4:10 UTC (permalink / raw)
  To: Peng Wu
  Cc: clement.leger, andrew, vivien.didelot, f.fainelli, olteanv,
	davem, edumazet, kuba, pabeni, linux-renesas-soc, netdev,
	linux-kernel, liwei391

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 28 Jun 2022 13:09:20 +0000 you wrote:
> The devm_platform_ioremap_resource() function never returns NULL.
> It returns error pointers.
> 
> Signed-off-by: Peng Wu <wupeng58@huawei.com>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> ---
>  drivers/net/dsa/rzn1_a5psw.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Here is the summary with links:
  - net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe()
    https://git.kernel.org/netdev/net-next/c/626af58bad58

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] 3+ messages in thread

end of thread, other threads:[~2022-06-30  4:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 13:09 [PATCH] net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe() Peng Wu
2022-06-29  9:27 ` Clément Léger
2022-06-30  4:10 ` patchwork-bot+netdevbpf

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.