* [PATCH v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
@ 2022-01-15 17:49 ` trix
0 siblings, 0 replies; 6+ messages in thread
From: trix @ 2022-01-15 17:49 UTC (permalink / raw)
To: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
nathan, ndesaulniers, opensource
Cc: netdev, linux-arm-kernel, linux-mediatek, linux-kernel, llvm, Tom Rix
From: Tom Rix <trix@redhat.com>
Clang static analysis reports this problem
mtk_eth_soc.c:394:7: warning: Branch condition evaluates
to a garbage value
if (err)
^~~
err is not initialized and only conditionally set.
So intitialize err.
Fixes: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII")
Signed-off-by: Tom Rix <trix@redhat.com>
---
v2: change to initializing
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index b67b4323cff08..f02d07ec5ccbf 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -267,7 +267,7 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
phylink_config);
struct mtk_eth *eth = mac->hw;
u32 mcr_cur, mcr_new, sid, i;
- int val, ge_mode, err;
+ int val, ge_mode, err = 0;
/* MT76x8 has no hardware settings between for the MAC */
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
--
2.26.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
@ 2022-01-15 17:49 ` trix
0 siblings, 0 replies; 6+ messages in thread
From: trix @ 2022-01-15 17:49 UTC (permalink / raw)
To: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
nathan, ndesaulniers, opensource
Cc: netdev, linux-arm-kernel, linux-mediatek, linux-kernel, llvm, Tom Rix
From: Tom Rix <trix@redhat.com>
Clang static analysis reports this problem
mtk_eth_soc.c:394:7: warning: Branch condition evaluates
to a garbage value
if (err)
^~~
err is not initialized and only conditionally set.
So intitialize err.
Fixes: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII")
Signed-off-by: Tom Rix <trix@redhat.com>
---
v2: change to initializing
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index b67b4323cff08..f02d07ec5ccbf 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -267,7 +267,7 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
phylink_config);
struct mtk_eth *eth = mac->hw;
u32 mcr_cur, mcr_new, sid, i;
- int val, ge_mode, err;
+ int val, ge_mode, err = 0;
/* MT76x8 has no hardware settings between for the MAC */
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
--
2.26.3
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
@ 2022-01-15 17:49 ` trix
0 siblings, 0 replies; 6+ messages in thread
From: trix @ 2022-01-15 17:49 UTC (permalink / raw)
To: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
nathan, ndesaulniers, opensource
Cc: netdev, linux-arm-kernel, linux-mediatek, linux-kernel, llvm, Tom Rix
From: Tom Rix <trix@redhat.com>
Clang static analysis reports this problem
mtk_eth_soc.c:394:7: warning: Branch condition evaluates
to a garbage value
if (err)
^~~
err is not initialized and only conditionally set.
So intitialize err.
Fixes: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII")
Signed-off-by: Tom Rix <trix@redhat.com>
---
v2: change to initializing
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index b67b4323cff08..f02d07ec5ccbf 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -267,7 +267,7 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
phylink_config);
struct mtk_eth *eth = mac->hw;
u32 mcr_cur, mcr_new, sid, i;
- int val, ge_mode, err;
+ int val, ge_mode, err = 0;
/* MT76x8 has no hardware settings between for the MAC */
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
--
2.26.3
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
2022-01-15 17:49 ` trix
(?)
@ 2022-01-15 22:40 ` patchwork-bot+netdevbpf
-1 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-15 22:40 UTC (permalink / raw)
To: Tom Rix
Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
nathan, ndesaulniers, opensource, netdev, linux-arm-kernel,
linux-mediatek, linux-kernel, llvm
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Sat, 15 Jan 2022 09:49:18 -0800 you wrote:
> From: Tom Rix <trix@redhat.com>
>
> Clang static analysis reports this problem
> mtk_eth_soc.c:394:7: warning: Branch condition evaluates
> to a garbage value
> if (err)
> ^~~
>
> [...]
Here is the summary with links:
- [v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
https://git.kernel.org/netdev/net/c/214b3369ab9b
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] 6+ messages in thread
* Re: [PATCH v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
@ 2022-01-15 22:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-15 22:40 UTC (permalink / raw)
To: Tom Rix
Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
nathan, ndesaulniers, opensource, netdev, linux-arm-kernel,
linux-mediatek, linux-kernel, llvm
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Sat, 15 Jan 2022 09:49:18 -0800 you wrote:
> From: Tom Rix <trix@redhat.com>
>
> Clang static analysis reports this problem
> mtk_eth_soc.c:394:7: warning: Branch condition evaluates
> to a garbage value
> if (err)
> ^~~
>
> [...]
Here is the summary with links:
- [v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
https://git.kernel.org/netdev/net/c/214b3369ab9b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
@ 2022-01-15 22:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-15 22:40 UTC (permalink / raw)
To: Tom Rix
Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
nathan, ndesaulniers, opensource, netdev, linux-arm-kernel,
linux-mediatek, linux-kernel, llvm
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Sat, 15 Jan 2022 09:49:18 -0800 you wrote:
> From: Tom Rix <trix@redhat.com>
>
> Clang static analysis reports this problem
> mtk_eth_soc.c:394:7: warning: Branch condition evaluates
> to a garbage value
> if (err)
> ^~~
>
> [...]
Here is the summary with links:
- [v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
https://git.kernel.org/netdev/net/c/214b3369ab9b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-01-15 22:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 17:49 [PATCH v2] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config() trix
2022-01-15 17:49 ` trix
2022-01-15 17:49 ` trix
2022-01-15 22:40 ` patchwork-bot+netdevbpf
2022-01-15 22:40 ` patchwork-bot+netdevbpf
2022-01-15 22:40 ` 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.