net: mvpp2: Cannot test unsigned variable to be negative
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 5 Aug 2025 14:18:18 +0000 (15:18 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Mon, 18 Aug 2025 13:47:57 +0000 (15:47 +0200)
In phy_info_parse all uses of the variable phyaddr are as an int so
declaring as u32 is not useful and prevents the test for an error return
from fdtdec_get_int ever detecting an error. Change phyaddr to be an
int.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/mvpp2.c

index b68d305..3a3510f 100644 (file)
@@ -4734,7 +4734,7 @@ static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
        int port_node = dev_of_offset(dev);
        int phy_node;
        u32 id;
-       u32 phyaddr = 0;
+       int phyaddr = 0;
        int fixed_link = 0;
        int ret;