From: Andrew Goodbody Date: Mon, 4 Aug 2025 15:11:38 +0000 (+0100) Subject: net: dwc_eth_xgmac_socfpga: Remove always true test X-Git-Tag: v2025.10-rc2~3^2~34 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28c06d67cf094fdea48e46bb01af2e9806ccd526;p=pandora-u-boot.git net: dwc_eth_xgmac_socfpga: Remove always true test 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 Reviewed-by: Tien Fong Chee --- diff --git a/drivers/net/dwc_eth_xgmac_socfpga.c b/drivers/net/dwc_eth_xgmac_socfpga.c index c89c8a188b7..f72f16b50ab 100644 --- a/drivers/net/dwc_eth_xgmac_socfpga.c +++ b/drivers/net/dwc_eth_xgmac_socfpga.c @@ -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; }