staging:rtl8192u: Remove member variable rx_gain_range_max - Style
authorJohn Whitmore <johnfwhitmore@gmail.com>
Fri, 3 Aug 2018 00:01:55 +0000 (01:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Aug 2018 14:21:06 +0000 (16:21 +0200)
The structure 'dig' defines a member variable, (rx_gain_range_max)
which is initialised to the value 'DM_DIG_MAX', (a defined constant).
The variable is then used to test and set another variable. Since
the member rx_gain_range_max is never assigned any other value then
the constant 'DM_DIG_MAX' the code might as well simply use that
constant, rather the a member variable set to that constant.

The member variable has been removed and the constant used directly
in the code. This is a coding style change which should not impact
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 3336798..8b9d011 100644 (file)
@@ -1650,7 +1650,6 @@ static void dm_dig_init(struct net_device *dev)
 
        dm_digtable.rssi_val = 50;      /* for new dig debug rssi value */
        dm_digtable.backoff_val = DM_DIG_BACKOFF;
-       dm_digtable.rx_gain_range_max = DM_DIG_MAX;
        if (priv->CustomerID == RT_CID_819x_Netcore)
                dm_digtable.rx_gain_range_min = DM_DIG_MIN_Netcore;
        else
@@ -1968,8 +1967,8 @@ static void dm_initial_gain(
 
        if (dm_digtable.pre_connect_state == dm_digtable.cur_connect_state) {
                if (dm_digtable.cur_connect_state == DIG_CONNECT) {
-                       if ((dm_digtable.rssi_val+10-dm_digtable.backoff_val) > dm_digtable.rx_gain_range_max)
-                               dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_max;
+                       if ((dm_digtable.rssi_val + 10 - dm_digtable.backoff_val) > DM_DIG_MAX)
+                               dm_digtable.cur_ig_value = DM_DIG_MAX;
                        else if ((dm_digtable.rssi_val+10-dm_digtable.backoff_val) < dm_digtable.rx_gain_range_min)
                                dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_min;
                        else
index bc736f2..f3e3db1 100644 (file)
@@ -118,7 +118,6 @@ struct dig {
        u32             cur_ig_value;
 
        u8              backoff_val;
-       u8              rx_gain_range_max;
        u8              rx_gain_range_min;
        bool            initialgain_lowerbound_state;