Staging: rtl8188eu: hal: Compress return logic into one line
authorMihaela Muraru <mihaela.muraru21@gmail.com>
Thu, 13 Oct 2016 15:27:31 +0000 (18:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 08:27:32 +0000 (10:27 +0200)
Simplify function returns by merging assignment and return into
one command line.
Found with Coccinelle
@@
expression e, ret;
@@

-ret =
+return
        e;
-return ret;

Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/phy.c

index 109c2d7..35c91e0 100644 (file)
@@ -40,12 +40,11 @@ static u32 cal_bit_shift(u32 bitmask)
 
 u32 phy_query_bb_reg(struct adapter *adapt, u32 regaddr, u32 bitmask)
 {
-       u32 return_value = 0, original_value, bit_shift;
+       u32 original_value, bit_shift;
 
        original_value = usb_read32(adapt, regaddr);
        bit_shift = cal_bit_shift(bitmask);
-       return_value = (original_value & bitmask) >> bit_shift;
-       return return_value;
+       return (original_value & bitmask) >> bit_shift;
 }
 
 void phy_set_bb_reg(struct adapter *adapt, u32 regaddr, u32 bitmask, u32 data)
@@ -119,12 +118,11 @@ static void rf_serial_write(struct adapter *adapt,
 u32 rtw_hal_read_rfreg(struct adapter *adapt, enum rf_radio_path rf_path,
                     u32 reg_addr, u32 bit_mask)
 {
-       u32 original_value, readback_value, bit_shift;
+       u32 original_value, bit_shift;
 
        original_value = rf_serial_read(adapt, rf_path, reg_addr);
        bit_shift =  cal_bit_shift(bit_mask);
-       readback_value = (original_value & bit_mask) >> bit_shift;
-       return readback_value;
+       return (original_value & bit_mask) >> bit_shift;
 }
 
 void phy_set_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path,