net: ks8851_mll: Remove unreachable code
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 5 Aug 2025 10:34:29 +0000 (11:34 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Mon, 18 Aug 2025 13:47:58 +0000 (15:47 +0200)
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@linaro.org>
drivers/net/ks8851_mll.c

index cc2e826..2c95615 100644 (file)
@@ -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;
 }