netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3 0/2] net: Fix return value check for fixed_phy_register()
@ 2023-08-18  5:12 Ruan Jinjie
  2023-08-18  5:12 ` [PATCH net v3 1/2] net: bgmac: " Ruan Jinjie
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ruan Jinjie @ 2023-08-18  5:12 UTC (permalink / raw)
  To: rafal, bcm-kernel-feedback-list, davem, edumazet, kuba, pabeni,
	opendmb, florian.fainelli, pgynther, netdev
  Cc: ruanjinjie

The fixed_phy_register() function returns error pointers and never
returns NULL. Update the checks accordingly.

Changes in v3:
- Drop the error fix patch for fixed_phy_get_gpiod().
- Split the error code update code into another patch set as suggested.
- Update the commit title and message.

Ruan Jinjie (2):
  net: bgmac: Fix return value check for fixed_phy_register()
  net: bcmgenet: Fix return value check for fixed_phy_register()

 drivers/net/ethernet/broadcom/bgmac.c        | 2 +-
 drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.34.1


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

* [PATCH net v3 1/2] net: bgmac: Fix return value check for fixed_phy_register()
  2023-08-18  5:12 [PATCH net v3 0/2] net: Fix return value check for fixed_phy_register() Ruan Jinjie
@ 2023-08-18  5:12 ` Ruan Jinjie
  2023-08-18 18:57   ` Leon Romanovsky
  2023-08-18  5:12 ` [PATCH net v3 2/2] net: bcmgenet: " Ruan Jinjie
  2023-08-20 10:06 ` [PATCH net v3 0/2] net: " patchwork-bot+netdevbpf
  2 siblings, 1 reply; 7+ messages in thread
From: Ruan Jinjie @ 2023-08-18  5:12 UTC (permalink / raw)
  To: rafal, bcm-kernel-feedback-list, davem, edumazet, kuba, pabeni,
	opendmb, florian.fainelli, pgynther, netdev
  Cc: ruanjinjie

The fixed_phy_register() function returns error pointers and never
returns NULL. Update the checks accordingly.

Fixes: c25b23b8a387 ("bgmac: register fixed PHY for ARM BCM470X / BCM5301X chipsets")
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
v3:
- Split the err code update code into another patch set as suggested.
v2:
- Remove redundant NULL check and fix the return value.
- Update the commit title and message.
- Add the fix tag.
---
 drivers/net/ethernet/broadcom/bgmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 10c7c232cc4e..52ee3751187a 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1448,7 +1448,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
 	int err;
 
 	phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
-	if (!phy_dev || IS_ERR(phy_dev)) {
+	if (IS_ERR(phy_dev)) {
 		dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
 		return -ENODEV;
 	}
-- 
2.34.1


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

* [PATCH net v3 2/2] net: bcmgenet: Fix return value check for fixed_phy_register()
  2023-08-18  5:12 [PATCH net v3 0/2] net: Fix return value check for fixed_phy_register() Ruan Jinjie
  2023-08-18  5:12 ` [PATCH net v3 1/2] net: bgmac: " Ruan Jinjie
@ 2023-08-18  5:12 ` Ruan Jinjie
  2023-08-18 18:56   ` Leon Romanovsky
  2023-08-19  0:28   ` Doug Berger
  2023-08-20 10:06 ` [PATCH net v3 0/2] net: " patchwork-bot+netdevbpf
  2 siblings, 2 replies; 7+ messages in thread
From: Ruan Jinjie @ 2023-08-18  5:12 UTC (permalink / raw)
  To: rafal, bcm-kernel-feedback-list, davem, edumazet, kuba, pabeni,
	opendmb, florian.fainelli, pgynther, netdev
  Cc: ruanjinjie

The fixed_phy_register() function returns error pointers and never
returns NULL. Update the checks accordingly.

Fixes: b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree")
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
v3:
- Split the err code update code into another patch set as suggested.
v2:
- Remove redundant NULL check and fix the return value.
- Update the commit title and message.
- Add the fix tag.
---
 drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 0092e46c46f8..cc3afb605b1e 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -617,7 +617,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
 		};
 
 		phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
-		if (!phydev || IS_ERR(phydev)) {
+		if (IS_ERR(phydev)) {
 			dev_err(kdev, "failed to register fixed PHY device\n");
 			return -ENODEV;
 		}
-- 
2.34.1


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

* Re: [PATCH net v3 2/2] net: bcmgenet: Fix return value check for fixed_phy_register()
  2023-08-18  5:12 ` [PATCH net v3 2/2] net: bcmgenet: " Ruan Jinjie
@ 2023-08-18 18:56   ` Leon Romanovsky
  2023-08-19  0:28   ` Doug Berger
  1 sibling, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2023-08-18 18:56 UTC (permalink / raw)
  To: Ruan Jinjie
  Cc: rafal, bcm-kernel-feedback-list, davem, edumazet, kuba, pabeni,
	opendmb, florian.fainelli, pgynther, netdev

On Fri, Aug 18, 2023 at 01:12:21PM +0800, Ruan Jinjie wrote:
> The fixed_phy_register() function returns error pointers and never
> returns NULL. Update the checks accordingly.
> 
> Fixes: b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree")
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
> v3:
> - Split the err code update code into another patch set as suggested.
> v2:
> - Remove redundant NULL check and fix the return value.
> - Update the commit title and message.
> - Add the fix tag.
> ---
>  drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

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

* Re: [PATCH net v3 1/2] net: bgmac: Fix return value check for fixed_phy_register()
  2023-08-18  5:12 ` [PATCH net v3 1/2] net: bgmac: " Ruan Jinjie
@ 2023-08-18 18:57   ` Leon Romanovsky
  0 siblings, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2023-08-18 18:57 UTC (permalink / raw)
  To: Ruan Jinjie
  Cc: rafal, bcm-kernel-feedback-list, davem, edumazet, kuba, pabeni,
	opendmb, florian.fainelli, pgynther, netdev

On Fri, Aug 18, 2023 at 01:12:20PM +0800, Ruan Jinjie wrote:
> The fixed_phy_register() function returns error pointers and never
> returns NULL. Update the checks accordingly.
> 
> Fixes: c25b23b8a387 ("bgmac: register fixed PHY for ARM BCM470X / BCM5301X chipsets")
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
> v3:
> - Split the err code update code into another patch set as suggested.
> v2:
> - Remove redundant NULL check and fix the return value.
> - Update the commit title and message.
> - Add the fix tag.
> ---
>  drivers/net/ethernet/broadcom/bgmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

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

* Re: [PATCH net v3 2/2] net: bcmgenet: Fix return value check for fixed_phy_register()
  2023-08-18  5:12 ` [PATCH net v3 2/2] net: bcmgenet: " Ruan Jinjie
  2023-08-18 18:56   ` Leon Romanovsky
@ 2023-08-19  0:28   ` Doug Berger
  1 sibling, 0 replies; 7+ messages in thread
From: Doug Berger @ 2023-08-19  0:28 UTC (permalink / raw)
  To: Ruan Jinjie, rafal, bcm-kernel-feedback-list, davem, edumazet,
	kuba, pabeni, florian.fainelli, pgynther, netdev

On 8/17/2023 10:12 PM, Ruan Jinjie wrote:
> The fixed_phy_register() function returns error pointers and never
> returns NULL. Update the checks accordingly.
> 
> Fixes: b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree")
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
> v3:
> - Split the err code update code into another patch set as suggested.
> v2:
> - Remove redundant NULL check and fix the return value.
> - Update the commit title and message.
> - Add the fix tag.
> ---
>   drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Doug Berger <opendmb@gmail.com>

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

* Re: [PATCH net v3 0/2] net: Fix return value check for fixed_phy_register()
  2023-08-18  5:12 [PATCH net v3 0/2] net: Fix return value check for fixed_phy_register() Ruan Jinjie
  2023-08-18  5:12 ` [PATCH net v3 1/2] net: bgmac: " Ruan Jinjie
  2023-08-18  5:12 ` [PATCH net v3 2/2] net: bcmgenet: " Ruan Jinjie
@ 2023-08-20 10:06 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-20 10:06 UTC (permalink / raw)
  To: Ruan Jinjie
  Cc: rafal, bcm-kernel-feedback-list, davem, edumazet, kuba, pabeni,
	opendmb, florian.fainelli, pgynther, netdev

Hello:

This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 18 Aug 2023 13:12:19 +0800 you wrote:
> The fixed_phy_register() function returns error pointers and never
> returns NULL. Update the checks accordingly.
> 
> Changes in v3:
> - Drop the error fix patch for fixed_phy_get_gpiod().
> - Split the error code update code into another patch set as suggested.
> - Update the commit title and message.
> 
> [...]

Here is the summary with links:
  - [net,v3,1/2] net: bgmac: Fix return value check for fixed_phy_register()
    https://git.kernel.org/netdev/net/c/23a14488ea58
  - [net,v3,2/2] net: bcmgenet: Fix return value check for fixed_phy_register()
    https://git.kernel.org/netdev/net/c/32bbe64a1386

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

end of thread, other threads:[~2023-08-20 10:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-18  5:12 [PATCH net v3 0/2] net: Fix return value check for fixed_phy_register() Ruan Jinjie
2023-08-18  5:12 ` [PATCH net v3 1/2] net: bgmac: " Ruan Jinjie
2023-08-18 18:57   ` Leon Romanovsky
2023-08-18  5:12 ` [PATCH net v3 2/2] net: bcmgenet: " Ruan Jinjie
2023-08-18 18:56   ` Leon Romanovsky
2023-08-19  0:28   ` Doug Berger
2023-08-20 10:06 ` [PATCH net v3 0/2] net: " patchwork-bot+netdevbpf

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).