[PATCH 3/4] staging: rtl8192e: Remove checks of pointer to stop_send.. and rtllib_..

From: Philipp Hortmann
Date: Sat Feb 25 2023 - 13:20:57 EST


Function pointers of stop_send_beacons and rtllib_ips_leave_wq is set
while executing the probe function. Therefore a NULL pointer check is
not required. Remove checks as it is dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx>
---
drivers/staging/rtl8192e/rtllib_softmac.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index b06baf5ff6d4..7b73c5df5e2a 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -659,8 +659,7 @@ static void rtllib_beacons_stop(struct rtllib_device *ieee)

void rtllib_stop_send_beacons(struct rtllib_device *ieee)
{
- if (ieee->stop_send_beacons)
- ieee->stop_send_beacons(ieee->dev);
+ ieee->stop_send_beacons(ieee->dev);
if (ieee->softmac_features & IEEE_SOFTMAC_BEACONS)
rtllib_beacons_stop(ieee);
}
@@ -728,8 +727,7 @@ EXPORT_SYMBOL(rtllib_act_scanning);
/* called with ieee->lock held */
static void rtllib_start_scan(struct rtllib_device *ieee)
{
- if (ieee->rtllib_ips_leave_wq != NULL)
- ieee->rtllib_ips_leave_wq(ieee->dev);
+ ieee->rtllib_ips_leave_wq(ieee->dev);

if (IS_DOT11D_ENABLE(ieee)) {
if (IS_COUNTRY_IE_VALID(ieee))
@@ -1584,8 +1582,7 @@ static void rtllib_associate_procedure_wq(void *data)
rtllib_stop_scan(ieee);
HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
if (ieee->rf_power_state == rf_off) {
- if (ieee->rtllib_ips_leave_wq != NULL)
- ieee->rtllib_ips_leave_wq(ieee->dev);
+ ieee->rtllib_ips_leave_wq(ieee->dev);
mutex_unlock(&ieee->wx_mutex);
return;
}
--
2.39.2