OSDN Git Service

staging:rtl8192u: Remove member diff_TH - Style
authorJohn Whitmore <johnfwhitmore@gmail.com>
Fri, 3 Aug 2018 00:02:02 +0000 (01:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Aug 2018 14:21:07 +0000 (16:21 +0200)
The member variable diff_TH is assigned a constant value and then used
in a comparison. The variable is never changed so the comparison can
as easily be performed directly with the defined constant.

The member variable has been removed and the defined constant
RxPathSelection_diff_TH renamed to RX_PATH_SELECTION_DIFF_TH, to clear
the checkpatch issue with CamelCase naming.

These are coding style changes which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/r8192U_dm.c
drivers/staging/rtl8192u/r8192U_dm.h

index f01d2f8..d847adf 100644 (file)
@@ -2385,7 +2385,6 @@ static void dm_init_rxpath_selection(struct net_device *dev)
        u8 i;
        struct r8192_priv *priv = ieee80211_priv(dev);
 
-       DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH;
        if (priv->CustomerID == RT_CID_819x_Netcore)
                DM_RxPathSelTable.cck_method = CCK_RX_VERSION_2;
        else
@@ -2555,7 +2554,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)
        }
 
        if (tmp_min_rssi < RX_PATH_SELECTION_SS_TH_LOW && disabled_rf_cnt < 2) {
-               if ((tmp_max_rssi - tmp_min_rssi) >= DM_RxPathSelTable.diff_TH) {
+               if ((tmp_max_rssi - tmp_min_rssi) >= RX_PATH_SELECTION_DIFF_TH) {
                        /* record the enabled rssi threshold */
                        DM_RxPathSelTable.rf_enable_rssi_th[min_rssi_index] = tmp_max_rssi+5;
                        /* disable the BB Rx path, OFDM */
index 0aaac0f..a7cce1f 100644 (file)
@@ -38,7 +38,7 @@
 #define                DM_DIG_MIN_Netcore                      0x12
 
 #define                RX_PATH_SELECTION_SS_TH_LOW             30
-#define                RxPathSelection_diff_TH                 18
+#define                RX_PATH_SELECTION_DIFF_TH                       18
 
 #define                RateAdaptiveTH_High                     50
 #define                RateAdaptiveTH_Low_20M          30
@@ -132,7 +132,6 @@ struct dynamic_rx_path_sel {
        enum cck_rx_path_method         cck_method;
        u8              cck_rx_path;
 
-       u8              diff_TH;
        u8              disabledRF;
        u8              reserved;