* [bug report] dpaa2-eth: add MAC/PHY support through phylink
@ 2019-11-06 8:23 Dan Carpenter
2019-11-06 16:37 ` Ioana Ciornei
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-11-06 8:23 UTC (permalink / raw)
To: kernel-janitors
Hello Ioana Ciornei,
The patch 719479230893: "dpaa2-eth: add MAC/PHY support through
phylink" from Oct 31, 2019, leads to the following static checker
warning:
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c:55 dpaa2_mac_get_if_mode()
warn: always true condition '(if_mode >= 0) => (0-u32max >= 0)'
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
44 static int dpaa2_mac_get_if_mode(struct device_node *node,
45 struct dpmac_attr attr)
46 {
47 phy_interface_t if_mode;
48 int err;
49
50 err = of_get_phy_mode(node, &if_mode);
51 if (!err)
52 return if_mode;
53
54 if_mode = phy_mode(attr.eth_if);
55 if (if_mode >= 0)
^^^^^^^^^^^^
This enum is unsigned so the condition is always true.
56 return if_mode;
57
58 return -ENODEV;
59 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [bug report] dpaa2-eth: add MAC/PHY support through phylink
2019-11-06 8:23 [bug report] dpaa2-eth: add MAC/PHY support through phylink Dan Carpenter
@ 2019-11-06 16:37 ` Ioana Ciornei
0 siblings, 0 replies; 2+ messages in thread
From: Ioana Ciornei @ 2019-11-06 16:37 UTC (permalink / raw)
To: kernel-janitors
> Subject: [bug report] dpaa2-eth: add MAC/PHY support through phylink
>
> Hello Ioana Ciornei,
>
> The patch 719479230893: "dpaa2-eth: add MAC/PHY support through
> phylink" from Oct 31, 2019, leads to the following static checker
> warning:
>
> drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c:55
> dpaa2_mac_get_if_mode()
> warn: always true condition '(if_mode >= 0) => (0-u32max >= 0)'
>
> drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> 44 static int dpaa2_mac_get_if_mode(struct device_node *node,
> 45 struct dpmac_attr attr)
> 46 {
> 47 phy_interface_t if_mode;
> 48 int err;
> 49
> 50 err = of_get_phy_mode(node, &if_mode);
> 51 if (!err)
> 52 return if_mode;
> 53
> 54 if_mode = phy_mode(attr.eth_if);
> 55 if (if_mode >= 0)
> ^^^^^^^^^^^^
> This enum is unsigned so the condition is always true.
>
> 56 return if_mode;
> 57
> 58 return -ENODEV;
> 59 }
>
> regards,
> dan carpenter
Thanks for the bug report, will send a fix.
Ioana
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-06 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 8:23 [bug report] dpaa2-eth: add MAC/PHY support through phylink Dan Carpenter
2019-11-06 16:37 ` Ioana Ciornei
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.