]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: dwc_eth_xgmac_socfpga: Remove always true test
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Mon, 4 Aug 2025 15:11:38 +0000 (16:11 +0100)
committerTien Fong Chee <tien.fong.chee@intel.com>
Fri, 8 Aug 2025 07:59:58 +0000 (15:59 +0800)
In dwxgmac_of_get_mac_mode there is a test for mac_mode which will
return if false. After this point mac_mode is guaranteed to be true so
there is no need to test for this. Remove that test.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
drivers/net/dwc_eth_xgmac_socfpga.c

index c89c8a188b78000b9afade106d3625ef309f8674..f72f16b50abbf68c09598a8504fef67a63c1c0fd 100644 (file)
@@ -39,11 +39,9 @@ phy_interface_t dwxgmac_of_get_mac_mode(struct udevice *dev)
        if (!mac_mode)
                return PHY_INTERFACE_MODE_NA;
 
-       if (mac_mode) {
-               for (i = 0; i < PHY_INTERFACE_MODE_MAX; i++) {
-                       if (!strcmp(mac_mode, phy_interface_strings[i]))
-                               return i;
-               }
+       for (i = 0; i < PHY_INTERFACE_MODE_MAX; i++) {
+               if (!strcmp(mac_mode, phy_interface_strings[i]))
+                       return i;
        }
        return PHY_INTERFACE_MODE_NA;
 }