net: ks8851: Make ks8851_read_selftest() return void
authorNathan Chancellor <nathan@kernel.org>
Thu, 3 Jun 2021 16:56:13 +0000 (09:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Jun 2021 22:27:37 +0000 (15:27 -0700)
clang points out that ret in ks8851_read_selftest() is set but unused:

drivers/net/ethernet/micrel/ks8851_common.c:1028:6: warning: variable
'ret' set but not used [-Wunused-but-set-variable]
        int ret = 0;
            ^
1 warning generated.

The return code of this function has never been checked so just remove
ret and make the function return void.

Fixes: 3ba81f3ece3c ("net: Micrel KS8851 SPI network driver")
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/micrel/ks8851_common.c

index 13eef6e..8315184 100644 (file)
@@ -1022,30 +1022,23 @@ static int ks8851_mdio_write(struct mii_bus *bus, int phy_id, int reg, u16 val)
  *
  * Read and check the TX/RX memory selftest information.
  */
-static int ks8851_read_selftest(struct ks8851_net *ks)
+static void ks8851_read_selftest(struct ks8851_net *ks)
 {
        unsigned both_done = MBIR_TXMBF | MBIR_RXMBF;
-       int ret = 0;
        unsigned rd;
 
        rd = ks8851_rdreg16(ks, KS_MBIR);
 
        if ((rd & both_done) != both_done) {
                netdev_warn(ks->netdev, "Memory selftest not finished\n");
-               return 0;
+               return;
        }
 
-       if (rd & MBIR_TXMBFA) {
+       if (rd & MBIR_TXMBFA)
                netdev_err(ks->netdev, "TX memory selftest fail\n");
-               ret |= 1;
-       }
 
-       if (rd & MBIR_RXMBFA) {
+       if (rd & MBIR_RXMBFA)
                netdev_err(ks->netdev, "RX memory selftest fail\n");
-               ret |= 2;
-       }
-
-       return 0;
 }
 
 /* driver bus management functions */