2023-06-07 15:18:40

by Yogesh Hegde

[permalink] [raw]
Subject: [PATCH v2 4/5] staging: rtl8192e: Remove variable InitialGainHandler

The variable InitialGainHandler is set in only one place throughout the
driver. This patch removes the variable and calls the real function
directly instead, eliminating the unnecessary indirection.
Additionally, the removal of the variable aligns with the checkpatch
guidelines by removing the use of CamelCase.

Signed-off-by: Yogesh Hegde <[email protected]>
---

v2: Removed the variable and called the function direction instead of
just renaming the variable as suggested by Greg Kroah-Hartman
<[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 4 ++--
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtllib.h | 1 -
3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 641e993aaa86..5385bb099c56 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -1129,11 +1129,11 @@ void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation)
if (priv->up) {
switch (Operation) {
case SCAN_OPT_BACKUP:
- priv->rtllib->InitialGainHandler(dev, IG_Backup);
+ rtl92e_init_gain(dev, IG_Backup);
break;

case SCAN_OPT_RESTORE:
- priv->rtllib->InitialGainHandler(dev, IG_Restore);
+ rtl92e_init_gain(dev, IG_Restore);
break;
}
}
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 231903002233..8218319ad834 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -731,7 +731,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev)

priv->rtllib->SetHwRegHandler = rtl92e_set_reg;
priv->rtllib->AllowAllDestAddrHandler = rtl92e_set_monitor_mode;
- priv->rtllib->InitialGainHandler = rtl92e_init_gain;
priv->rtllib->rtllib_ips_leave_wq = rtl92e_rtllib_ips_leave_wq;
priv->rtllib->rtllib_ips_leave = rtl92e_rtllib_ips_leave;
priv->rtllib->ScanOperationBackupHandler = rtl92e_scan_op_backup;
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index f7fd8b77db99..92ed1b493f6b 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1709,7 +1709,6 @@ struct rtllib_device {
bool (*GetNmodeSupportBySecCfg)(struct net_device *dev);
bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev);
u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee);
- void (*InitialGainHandler)(struct net_device *dev, u8 Operation);
void (*ScanOperationBackupHandler)(struct net_device *dev,
u8 Operation);
void (*SetHwRegHandler)(struct net_device *dev, u8 variable, u8 *val);
--
2.25.1