* [PATCH net] net: stmmac: dwmac-meson8b: Fix signedness bug in probe
@ 2019-09-25 10:58 Dan Carpenter
2019-09-26 17:51 ` Martin Blumenstingl
2019-09-27 8:15 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-09-25 10:58 UTC (permalink / raw)
To: Giuseppe Cavallaro, Martin Blumenstingl
Cc: Alexandre Torgue, Jose Abreu, David S. Miller, Kevin Hilman,
Maxime Coquelin, netdev, linux-stm32, kernel-janitors
The "dwmac->phy_mode" is an enum and in this context GCC treats it as
an unsigned int so the error handling is never triggered.
Fixes: 566e82516253 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index 9cda29e4b89d..306da8f6b7d5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -339,7 +339,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
dwmac->dev = &pdev->dev;
dwmac->phy_mode = of_get_phy_mode(pdev->dev.of_node);
- if (dwmac->phy_mode < 0) {
+ if ((int)dwmac->phy_mode < 0) {
dev_err(&pdev->dev, "missing phy-mode property\n");
ret = -EINVAL;
goto err_remove_config_dt;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: stmmac: dwmac-meson8b: Fix signedness bug in probe
2019-09-25 10:58 [PATCH net] net: stmmac: dwmac-meson8b: Fix signedness bug in probe Dan Carpenter
@ 2019-09-26 17:51 ` Martin Blumenstingl
2019-09-27 8:15 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Martin Blumenstingl @ 2019-09-26 17:51 UTC (permalink / raw)
To: Dan Carpenter
Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
David S. Miller, Kevin Hilman, Maxime Coquelin, netdev,
linux-stm32, kernel-janitors, linux-amlogic
+Cc linux-amlogic mailing list
On Wed, Sep 25, 2019 at 12:59 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> The "dwmac->phy_mode" is an enum and in this context GCC treats it as
> an unsigned int so the error handling is never triggered.
>
> Fixes: 566e82516253 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
thank you for catching and fixing this!
Martin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: stmmac: dwmac-meson8b: Fix signedness bug in probe
2019-09-25 10:58 [PATCH net] net: stmmac: dwmac-meson8b: Fix signedness bug in probe Dan Carpenter
2019-09-26 17:51 ` Martin Blumenstingl
@ 2019-09-27 8:15 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-09-27 8:15 UTC (permalink / raw)
To: dan.carpenter
Cc: peppe.cavallaro, martin.blumenstingl, alexandre.torgue, joabreu,
khilman, mcoquelin.stm32, netdev, linux-stm32, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 25 Sep 2019 13:58:22 +0300
> The "dwmac->phy_mode" is an enum and in this context GCC treats it as
> an unsigned int so the error handling is never triggered.
>
> Fixes: 566e82516253 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-27 8:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 10:58 [PATCH net] net: stmmac: dwmac-meson8b: Fix signedness bug in probe Dan Carpenter
2019-09-26 17:51 ` Martin Blumenstingl
2019-09-27 8:15 ` David Miller
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).