staging: kpc2000: Remove unnecessary return variable
PATCH 1/1 staging: kpc2000: Remove unnecessary return variable
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;
--- drivers/staging/kpc2000/kpc2000_spi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/kpc2000/kpc2000_spi.c +1 -3
@@ -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
Signature · 1 line
2.23.0
Quoted 14 lines · Wambui Karuga
Remove unnecessary variable
valinkp_spi_read_reg()that only holds the return value fromreadq().
Issue found by coccinelle using the script:@@
local idexpression ret;
expression e;
@@(quoted diff) +1
-2-ret = +return e; -return ret;
Quoted 1 line
Signed-off-by Wambui Karuga <[email protected]>
Quoted 32 lines
--- drivers/staging/kpc2000/kpc2000_spi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/kpc2000/kpc2000_spi.c +1
-4@@ -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 --2.23.0
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191009170703.GA2869%40wambui.