#define rtl819XRadioD_Array Rtl8192UsbRadioD_Array
 #define rtl819XAGCTAB_Array Rtl8192UsbAGCTAB_Array
 
-/******************************************************************************
- * function: This function reads BB parameters from header file we generate,
- *           and does register read/write
- * input:    u32       bitmask  //taget bit pos in the addr to be modified
- * output:   none
- * return:   u32       return the shift bit position of the mask
- ******************************************************************************/
-static u32 rtl8192_CalculateBitShift(u32 bitmask)
-{
-       u32 i;
-
-       i = ffs(bitmask) - 1;
-       return i;
-}
-
 /******************************************************************************
  * function:  This function checks different RF type to execute legal judgement.
  *            If RF Path is illegal, we will return false.
 
        if (bitmask != bMaskDWord) {
                read_nic_dword(dev, reg_addr, ®);
-               bitshift = rtl8192_CalculateBitShift(bitmask);
+               bitshift = ffs(bitmask) - 1;
                reg &= ~bitmask;
                reg |= data << bitshift;
                write_nic_dword(dev, reg_addr, reg);
        u32 reg, bitshift;
 
        read_nic_dword(dev, reg_addr, ®);
-       bitshift = rtl8192_CalculateBitShift(bitmask);
+       bitshift = ffs(bitmask) - 1;
 
        return (reg & bitmask) >> bitshift;
 }
                if (bitmask != bMask12Bits) {
                        /* RF data is 12 bits only */
                        reg = phy_FwRFSerialRead(dev, eRFPath, reg_addr);
-                       bitshift =  rtl8192_CalculateBitShift(bitmask);
+                       bitshift =  ffs(bitmask) - 1;
                        reg &= ~bitmask;
                        reg |= data << bitshift;
 
                if (bitmask != bMask12Bits) {
                        /* RF data is 12 bits only */
                        reg = rtl8192_phy_RFSerialRead(dev, eRFPath, reg_addr);
-                       bitshift =  rtl8192_CalculateBitShift(bitmask);
+                       bitshift =  ffs(bitmask) - 1;
                        reg &= ~bitmask;
                        reg |= data << bitshift;
 
        } else {
                reg = rtl8192_phy_RFSerialRead(dev, eRFPath, reg_addr);
        }
-       bitshift =  rtl8192_CalculateBitShift(bitmask);
+       bitshift =  ffs(bitmask) - 1;
        reg = (reg & bitmask) >> bitshift;
        return reg;