Staging: rtl8192: Simplifying if-else statement
authorKsenija Stanojevic <ksenija.stanojevic@gmail.com>
Fri, 20 Feb 2015 17:14:30 +0000 (18:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Feb 2015 23:12:10 +0000 (15:12 -0800)
This patch simplifies the code by not having two identical paths and
fixes the warning given by checkpatch.pl: "else is not useful after
a break or return".

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/r819xU_phy.c

index 3b2c954ff2929da70daca03f2c7da706599e20bd..c8dc648a59eedd15acffe2c690b871706dde04d1 100644 (file)
@@ -352,16 +352,14 @@ u32 rtl8192_phy_QueryRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath,
                return 0;
        if (priv->Rf_Mode == RF_OP_By_FW) {
                reg = phy_FwRFSerialRead(dev, eRFPath, reg_addr);
-               bitshift =  rtl8192_CalculateBitShift(bitmask);
-               reg = (reg & bitmask) >> bitshift;
                udelay(200);
-               return reg;
        } else {
                reg = rtl8192_phy_RFSerialRead(dev, eRFPath, reg_addr);
-               bitshift =  rtl8192_CalculateBitShift(bitmask);
-               reg = (reg & bitmask) >> bitshift;
-               return reg;
        }
+       bitshift =  rtl8192_CalculateBitShift(bitmask);
+       reg = (reg & bitmask) >> bitshift;
+       return reg;
+
 }
 
 /******************************************************************************