From: John Whitmore <johnfwhitmore@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
John Whitmore <johnfwhitmore@gmail.com>
Subject: [PATCH 01/18] staging:rtl8192u: Remove debug member from structures - Style
Date: Fri, 3 Aug 2018 01:01:54 +0100 [thread overview]
Message-ID: <20180803000211.10589-2-johnfwhitmore@gmail.com> (raw)
In-Reply-To: <20180803000211.10589-1-johnfwhitmore@gmail.com>
Two structures, (struct dig and struct dynamic_rx_path_sel) contain
a u8 member variable representing debug setting. In the file r8192U_dm.c
these member variables, for both structures, are initialised to an
enumerated constant 'DM_DBG_OFF'. The member variables are never
assigned another value, other then off. Later in code the member
variables are tested to for equality to 'DM_DBG_OFF' and if that is the
case an assignment statement is executed.
Since the value of the variables is always off the test is redundant and
the conditional branch can just be executed without the test. Since the
member variables are then actually used both have been removed, along
with the enumerated type which defines debug status, on/off.
These are coding style changes to remove unused or redundant code, there
should be no impact on runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
drivers/staging/rtl8192u/r8192U_dm.c | 8 ++------
drivers/staging/rtl8192u/r8192U_dm.h | 8 --------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 0ba1b1e2bc6e..3336798310ac 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -1635,7 +1635,6 @@ static void dm_dig_init(struct net_device *dev)
/* 2007/10/05 MH Disable DIG scheme now. Not tested. */
dm_digtable.dig_enable_flag = true;
dm_digtable.dig_algorithm = DIG_ALGO_BY_RSSI;
- dm_digtable.dbg_mode = DM_DBG_OFF; /* off=by real rssi value, on=by DM_DigTable.Rssi_val for new dig */
dm_digtable.dig_algorithm_switch = 0;
/* 2007/10/04 MH Define init gain threshold. */
@@ -1720,8 +1719,7 @@ static void dm_ctrl_initgain_byrssi_by_driverrssi(
/*DbgPrint("DM_DigTable.PreConnectState = %d, DM_DigTable.CurConnectState = %d\n",
DM_DigTable.PreConnectState, DM_DigTable.CurConnectState);*/
- if (dm_digtable.dbg_mode == DM_DBG_OFF)
- dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb;
+ dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb;
/*DbgPrint("DM_DigTable.Rssi_val = %d\n", DM_DigTable.Rssi_val);*/
dm_initial_gain(dev);
dm_pd_th(dev);
@@ -2398,7 +2396,6 @@ static void dm_init_rxpath_selection(struct net_device *dev)
DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;
else
DM_RxPathSelTable.cck_method = CCK_Rx_Version_1;
- DM_RxPathSelTable.DbgMode = DM_DBG_OFF;
DM_RxPathSelTable.disabledRF = 0;
for (i = 0; i < 4; i++) {
DM_RxPathSelTable.rf_rssi[i] = 50;
@@ -2440,8 +2437,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)
/* decide max/sec/min rssi index */
for (i = 0; i < RF90_PATH_MAX; i++) {
- if (!DM_RxPathSelTable.DbgMode)
- DM_RxPathSelTable.rf_rssi[i] = priv->stats.rx_rssi_percentage[i];
+ DM_RxPathSelTable.rf_rssi[i] = priv->stats.rx_rssi_percentage[i];
if (priv->brfpath_rxenable[i]) {
rf_num++;
diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
index 2ba6a4208870..bc736f2f5a5c 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.h
+++ b/drivers/staging/rtl8192u/r8192U_dm.h
@@ -96,7 +96,6 @@ enum dig_cck_cs_ratio_state {
struct dig {
u8 dig_enable_flag;
enum dig_algorithm dig_algorithm;
- u8 dbg_mode;
u8 dig_algorithm_switch;
long rssi_low_thresh;
@@ -133,7 +132,6 @@ enum cck_rx_path_method {
struct dynamic_rx_path_sel {
u8 Enable;
- u8 DbgMode;
enum cck_rx_path_method cck_method;
u8 cck_Rx_path;
@@ -147,12 +145,6 @@ struct dynamic_rx_path_sel {
long cck_pwdb_sta[4];
};
-typedef enum tag_DM_DbgMode_Definition {
- DM_DBG_OFF = 0,
- DM_DBG_ON = 1,
- DM_DBG_MAX
-} DM_DBG_E;
-
typedef struct tag_Tx_Config_Cmd_Format {
u32 Op; /* Command packet type. */
u32 Length; /* Command packet length. */
--
2.18.0
next prev parent reply other threads:[~2018-08-03 0:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-03 0:01 [PATCH 00/18] staging:rtl8192u: Clean up ofr8192U_dm.h John Whitmore
2018-08-03 0:01 ` John Whitmore [this message]
2018-08-03 0:01 ` [PATCH 02/18] staging:rtl8192u: Remove member variable rx_gain_range_max - Style John Whitmore
2018-08-03 0:01 ` [PATCH 03/18] staging:rtl8192u: Remove member initialgain_lowerbound_state " John Whitmore
2018-08-03 0:01 ` [PATCH 04/18] staging:rtl8192u: Rename enum constants " John Whitmore
2018-08-03 0:01 ` [PATCH 05/18] staging:rtl8192u: Remove unused extern DM_RxPathSelTable " John Whitmore
2018-08-03 0:01 ` [PATCH 06/18] staging:rtl8192u: Remove member variable Enable " John Whitmore
2018-08-03 0:02 ` [PATCH 07/18] staging:rtl8192u: Rename cck_Rx_path " John Whitmore
2018-08-03 0:02 ` [PATCH 08/18] staging:rtl8192u: Remove SS_TH_low " John Whitmore
2018-08-03 0:02 ` [PATCH 09/18] staging:rtl8192u: Remove member diff_TH " John Whitmore
2018-08-03 0:02 ` [PATCH 10/18] staging:rtl8192u: Rename member disabledRF " John Whitmore
2018-08-03 0:02 ` [PATCH 11/18] staging:rtl8192u: Remove member reserved " John Whitmore
2018-08-03 0:02 ` [PATCH 12/18] staging:rtl8192u: Refactor DCMD_TXCMD_T structure " John Whitmore
2018-08-03 0:02 ` [PATCH 13/18] staging:rtl8192u: Rename DM_DIG_MIN_Netcore " John Whitmore
2018-08-03 0:02 ` [PATCH 14/18] staging:rtl8192u: Rename RateAdaptiveTH_High " John Whitmore
2018-08-03 0:02 ` [PATCH 15/18] staging:rtl8192u: Rename constants RateAdaptiveTH_Low_* " John Whitmore
2018-08-03 0:02 ` [PATCH 16/18] staging:rtl8192u: Rename constants " John Whitmore
2018-08-03 0:02 ` [PATCH 17/18] staging:rtl8192u: Rename Register Constants " John Whitmore
2018-08-03 0:02 ` [PATCH 18/18] staging:rtl8192u: Clean up of spacing " John Whitmore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180803000211.10589-2-johnfwhitmore@gmail.com \
--to=johnfwhitmore@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox