[PATCH] net: ks8851_mll: Remove unreachable code

Andrew Goodbody andrew.goodbody at linaro.org
Tue Aug 5 12:34:29 CEST 2025


In ks8851_mll_detect_chip the if..else code detects the case of (val &
0xfff0) != CIDER_ID and returns if found. So testing for this again will
always fail and the code is unreachable. Just remove the test and code
block.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
 drivers/net/ks8851_mll.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
index cc2e826257a..2c956154d09 100644
--- a/drivers/net/ks8851_mll.c
+++ b/drivers/net/ks8851_mll.c
@@ -347,11 +347,6 @@ static int ks8851_mll_detect_chip(struct ks_net *ks)
 
 	debug("Read back KS8851 id 0x%x\n", val);
 
-	if ((val & 0xfff0) != CIDER_ID) {
-		printf(DRIVERNAME ": Unknown chip ID %04x\n", val);
-		return -1;
-	}
-
 	return 0;
 }
 

---
base-commit: 007610da2cca405ea7739fc120d90085be4b6ac2
change-id: 20250805-ks8851_mll-9d1ec3a42ce4

Best regards,
-- 
Andrew Goodbody <andrew.goodbody at linaro.org>



More information about the U-Boot mailing list