From: Yogesh Hegde <yogi.kernel@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/5] staging: rtl8192e: Remove variable SetBWModeHandler
Date: Wed, 7 Jun 2023 20:32:06 +0530 [thread overview]
Message-ID: <0af9595916447a28e27c249f3696fe107382ca53.1686149467.git.yogi.kernel@gmail.com> (raw)
In-Reply-To: <cover.1686149467.git.yogi.kernel@gmail.com>
The variable SetBWModeHandler 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 <yogi.kernel@gmail.com>
---
v2: Removed the variable and called the function direction instead of
just renaming the variable as suggested by Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtl819x_HTProc.c | 8 ++++----
drivers/staging/rtl8192e/rtllib.h | 3 ---
drivers/staging/rtl8192e/rtllib_softmac_wx.c | 6 +++---
4 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index bbe0864e1348..6f6c31344441 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -717,7 +717,6 @@ static void _rtl92e_init_priv_handler(struct net_device *dev)
priv->rtllib->handle_assoc_response = _rtl92e_handle_assoc_response;
priv->rtllib->handle_beacon = _rtl92e_handle_beacon;
priv->rtllib->LeisurePSLeave = rtl92e_leisure_ps_leave;
- priv->rtllib->SetBWModeHandler = rtl92e_set_bw_mode;
priv->rf_set_chan = rtl92e_set_channel;
priv->rtllib->start_send_beacons = rtl92e_start_beacon;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index fe30a291e64c..ad92a8230055 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -6,6 +6,8 @@
*/
#include "rtllib.h"
#include "rtl819x_HT.h"
+#include "rtl8192e/r8192E_phy.h"
+
u8 MCS_FILTER_ALL[16] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
@@ -835,12 +837,10 @@ static void HTSetConnectBwModeCallback(struct rtllib_device *ieee)
ieee->set_chan(ieee->dev,
ieee->current_network.channel);
- ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40,
- ht_info->CurSTAExtChnlOffset);
+ rtl92e_set_bw_mode(ieee->dev, HT_CHANNEL_WIDTH_20_40, ht_info->CurSTAExtChnlOffset);
} else {
ieee->set_chan(ieee->dev, ieee->current_network.channel);
- ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20,
- HT_EXTCHNL_OFFSET_NO_EXT);
+ rtl92e_set_bw_mode(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
}
ht_info->sw_bw_in_progress = false;
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 68a3b8af3119..d22a586043f2 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1706,9 +1706,6 @@ struct rtllib_device {
/* check whether Tx hw resource available */
short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
- void (*SetBWModeHandler)(struct net_device *dev,
- enum ht_channel_width bandwidth,
- enum ht_extchnl_offset Offset);
bool (*GetNmodeSupportBySecCfg)(struct net_device *dev);
bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev);
u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee);
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index d85a32d2d050..9fb4fee93990 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -15,6 +15,7 @@
#include "rtllib.h"
#include "dot11d.h"
+#include "rtl8192e/r8192E_phy.h"
/* FIXME: add A freqs */
const long rtllib_wlan_frequencies[] = {
@@ -359,8 +360,7 @@ void rtllib_wx_sync_scan_wq(void *data)
b40M = 1;
chan_offset = ieee->ht_info->CurSTAExtChnlOffset;
bandwidth = (enum ht_channel_width)ieee->ht_info->bCurBW40MHz;
- ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20,
- HT_EXTCHNL_OFFSET_NO_EXT);
+ rtl92e_set_bw_mode(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
}
rtllib_start_scan_syncro(ieee, 0);
@@ -372,7 +372,7 @@ void rtllib_wx_sync_scan_wq(void *data)
ieee->set_chan(ieee->dev, chan - 2);
else
ieee->set_chan(ieee->dev, chan);
- ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset);
+ rtl92e_set_bw_mode(ieee->dev, bandwidth, chan_offset);
} else {
ieee->set_chan(ieee->dev, chan);
}
--
2.25.1
next prev parent reply other threads:[~2023-06-07 15:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 15:01 [PATCH v2 0/5] Trivial code cleanup patches Yogesh Hegde
2023-06-07 15:01 ` [PATCH v2 1/5] staging: rtl8192e: Remove variable SetWirelessMode Yogesh Hegde
2023-06-07 15:07 ` Dan Carpenter
2023-06-07 20:18 ` Philipp Hortmann
2023-06-08 9:00 ` Dan Carpenter
2023-06-08 9:59 ` Yogesh Hegde
2023-06-08 10:27 ` Dan Carpenter
2023-06-08 12:43 ` Philipp Hortmann
2023-06-12 1:52 ` kernel test robot
2023-06-07 15:02 ` Yogesh Hegde [this message]
2023-06-13 9:16 ` [PATCH v2 2/5] staging: rtl8192e: Remove variable SetBWModeHandler kernel test robot
2023-06-07 15:02 ` [PATCH v2 3/5] staging: rtl8192e: Remove variable LeisurePSLeave Yogesh Hegde
2023-06-07 15:02 ` [PATCH v2 4/5] staging: rtl8192e: Remove variable InitialGainHandler Yogesh Hegde
2023-06-07 15:03 ` [PATCH v2 5/5] staging: rtl8192e: Remove DRV_NAME definition in rtllib_debug.h Yogesh Hegde
2023-06-07 15:10 ` [PATCH v2 0/5] Trivial code cleanup patches Dan Carpenter
2023-06-15 10:36 ` Greg Kroah-Hartman
2023-06-15 14:09 ` Yogesh Hegde
2023-06-15 14:34 ` Greg Kroah-Hartman
2023-06-15 16:11 ` Yogesh Hegde
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=0af9595916447a28e27c249f3696fe107382ca53.1686149467.git.yogi.kernel@gmail.com \
--to=yogi.kernel@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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
all inboxes | Powered by JetHome®