staging: rtl8192e: Remove checks of pointer to LeisureP.. and start_se..
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sat, 25 Feb 2023 18:20:33 +0000 (19:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Mar 2023 16:05:46 +0000 (17:05 +0100)
Function pointers of LeisurePSLeave and start_send_beacons 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@gmail.com>
Link: https://lore.kernel.org/r/cd828bb1c8dfbb6d2a85d770c82afbb9889e0ea2.1677345331.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_rx.c
drivers/staging/rtl8192e/rtllib_softmac.c
drivers/staging/rtl8192e/rtllib_softmac_wx.c

index 35b36f7..c394c21 100644 (file)
@@ -1214,8 +1214,7 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast,
                        if (((ieee->link_detect_info.NumRxUnicastOkInPeriod +
                            ieee->link_detect_info.NumTxOkInPeriod) > 8) ||
                            (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) {
-                               if (ieee->LeisurePSLeave)
-                                       ieee->LeisurePSLeave(ieee->dev);
+                               ieee->LeisurePSLeave(ieee->dev);
                        }
                }
        }
index d697089..b06baf5 100644 (file)
@@ -669,8 +669,7 @@ EXPORT_SYMBOL(rtllib_stop_send_beacons);
 
 void rtllib_start_send_beacons(struct rtllib_device *ieee)
 {
-       if (ieee->start_send_beacons)
-               ieee->start_send_beacons(ieee->dev);
+       ieee->start_send_beacons(ieee->dev);
        if (ieee->softmac_features & IEEE_SOFTMAC_BEACONS)
                rtllib_beacons_start(ieee);
 }
index 06f3d75..f90764d 100644 (file)
@@ -340,8 +340,7 @@ void rtllib_wx_sync_scan_wq(void *data)
 
        chan = ieee->current_network.channel;
 
-       if (ieee->LeisurePSLeave)
-               ieee->LeisurePSLeave(ieee->dev);
+       ieee->LeisurePSLeave(ieee->dev);
        /* notify AP to be in PS mode */
        rtllib_sta_ps_send_null_frame(ieee, 1);
        rtllib_sta_ps_send_null_frame(ieee, 1);