]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Staging: pi433: Merge assignment with return value
authorMeghana Madhyastha <meghana.madhyastha@gmail.com>
Fri, 15 Sep 2017 07:04:30 +0000 (12:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Sep 2017 10:00:07 +0000 (12:00 +0200)
Removes the unnecessary assignment of retval preceding
the return statement.

Detected using the following Coccinelle script:
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/rf69.c

index c4b1b218ea38f8d197b5393492e2f690158737f6..f5b90aa759ea7d47945da734f68b8576be543c4f 100644 (file)
@@ -690,9 +690,7 @@ int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength)
        /* transmit to chip */
        retval = WRITE_REG(REG_PREAMBLE_MSB, msb);
        if (retval) return retval;
-       retval = WRITE_REG(REG_PREAMBLE_LSB, lsb);
-
-       return retval;
+       return WRITE_REG(REG_PREAMBLE_LSB, lsb);
 }
 
 int rf69_set_sync_enable(struct spi_device *spi, enum optionOnOff optionOnOff)