* [PATCH net] enetc: Fix a signedness bug in enetc_of_get_phy()
@ 2019-09-25 10:57 Dan Carpenter
2019-09-27 8:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-09-25 10:57 UTC (permalink / raw)
To: Claudiu Manoil; +Cc: David S. Miller, netdev, kernel-janitors
The "priv->if_mode" is type phy_interface_t which is an enum. In this
context GCC will treat the enum as an unsigned int so this error
handling is never triggered.
Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/freescale/enetc/enetc_pf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index 7d6513ff8507..b73421c3e25b 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
@@ -785,7 +785,7 @@ static int enetc_of_get_phy(struct enetc_ndev_priv *priv)
}
priv->if_mode = of_get_phy_mode(np);
- if (priv->if_mode < 0) {
+ if ((int)priv->if_mode < 0) {
dev_err(priv->dev, "missing phy type\n");
of_node_put(priv->phy_node);
if (of_phy_is_fixed_link(np))
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] enetc: Fix a signedness bug in enetc_of_get_phy()
2019-09-25 10:57 [PATCH net] enetc: Fix a signedness bug in enetc_of_get_phy() Dan Carpenter
@ 2019-09-27 8:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-09-27 8:04 UTC (permalink / raw)
To: dan.carpenter; +Cc: claudiu.manoil, netdev, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 25 Sep 2019 13:57:14 +0300
> The "priv->if_mode" is type phy_interface_t which is an enum. In this
> context GCC will treat the enum as an unsigned int so this error
> handling is never triggered.
>
> Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-27 8:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 10:57 [PATCH net] enetc: Fix a signedness bug in enetc_of_get_phy() Dan Carpenter
2019-09-27 8:04 ` 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).