staging: kpc2000: Remove unnecessary return variable
authorWambui Karuga <wambui.karugax@gmail.com>
Wed, 9 Oct 2019 17:07:03 +0000 (20:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2019 08:44:50 +0000 (10:44 +0200)
Remove unnecessary variable `val` in kp_spi_read_reg() that only holds
the return value from readq().
Issue found by coccinelle using the script:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/20191009170703.GA2869@wambui
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/kpc2000/kpc2000_spi.c

index 3be33c450cabb3a6199407db88c0e1edbffc645d..6ba94b0131da11b938f67c809d983a331d490805 100644 (file)
@@ -162,14 +162,12 @@ union kp_spi_ffctrl {
 kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx)
 {
        u64 __iomem *addr = cs->base;
-       u64 val;
 
        addr += idx;
        if ((idx == KP_SPI_REG_CONFIG) && (cs->conf_cache >= 0))
                return cs->conf_cache;
 
-       val = readq(addr);
-       return val;
+       return readq(addr);
 }
 
        static inline void