aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorJohn Whitmore <johnfwhitmore@gmail.com>2018-08-03 01:01:55 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-05 16:21:06 +0200
commita2351af9f562a77480ca91c970ea151ceba47c36 (patch)
tree1f9595deba7b7a50b72cc673b68cd288fde13dcd /drivers/staging
parentstaging:rtl8192u: Remove debug member from structures - Style (diff)
downloadlinux-dev-a2351af9f562a77480ca91c970ea151ceba47c36.tar.xz
linux-dev-a2351af9f562a77480ca91c970ea151ceba47c36.zip
staging:rtl8192u: Remove member variable rx_gain_range_max - Style
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192u/r8192U_dm.c5
-rw-r--r--drivers/staging/rtl8192u/r8192U_dm.h1
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 3336798310ac..8b9d011e9eec 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -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
diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
index bc736f2f5a5c..f3e3db18fdd0 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.h
+++ b/drivers/staging/rtl8192u/r8192U_dm.h
@@ -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;