staging: rtl8192e: Remove IS_DOT11D_ENABLE(ieee)
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sun, 19 Nov 2023 22:14:51 +0000 (23:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Nov 2023 12:46:28 +0000 (12:46 +0000)
Variable "enabled" is initialized to false and never changed. Therefore
IS_DOT11D_ENABLE(ieee) returns always false. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/9e737b2246e0b73c3ad84a4ee09f5e94bf778b3c.1700431464.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/dot11d.c
drivers/staging/rtl8192e/dot11d.h
drivers/staging/rtl8192e/rtllib_softmac.c

index fc65a63a4de6d448c234d4f8dcc9a86cec096f99..9eb941326bc852266d34a89eca12dde1609cbcde 100644 (file)
@@ -18,8 +18,6 @@ void dot11d_init(struct rtllib_device *ieee)
 {
        struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);
 
-       dot11d_info->enabled = false;
-
        dot11d_info->state = DOT11D_STATE_NONE;
        dot11d_info->country_len = 0;
        memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
index 39bda2f94eed6451e055fea230b0040f799a4029..c28067510653b60222f3a396cc45ebece043e3cc 100644 (file)
@@ -33,8 +33,6 @@ enum dot11d_state {
  */
 
 struct rt_dot11d_info {
-       bool enabled;
-
        u16 country_len;
        u8  country_buffer[MAX_IE_LEN];
        u8  country_src_addr[6];
@@ -54,8 +52,6 @@ static inline void copy_mac_addr(unsigned char *des, unsigned char *src)
 #define GET_DOT11D_INFO(__ieee_dev)                    \
         ((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))
 
-#define IS_DOT11D_ENABLE(__ieee_dev)                   \
-        (GET_DOT11D_INFO(__ieee_dev)->enabled)
 #define IS_COUNTRY_IE_VALID(__ieee_dev)                        \
        (GET_DOT11D_INFO(__ieee_dev)->country_len > 0)
 
index 42d652fe86013a16cd24b4a0591406ba633115e1..08349f522c830d5815344b012d4b218dbfecf305 100644 (file)
@@ -492,10 +492,6 @@ out:
        ieee->actscanning = false;
        ieee->sync_scan_hurryup = 0;
 
-       if (ieee->link_state >= MAC80211_LINKED) {
-               if (IS_DOT11D_ENABLE(ieee))
-                       dot11d_scan_complete(ieee);
-       }
        mutex_unlock(&ieee->scan_mutex);
 
        ieee->be_scan_inprogress = false;
@@ -552,8 +548,6 @@ static void rtllib_softmac_scan_wq(void *data)
        return;
 
 out:
-       if (IS_DOT11D_ENABLE(ieee))
-               dot11d_scan_complete(ieee);
        ieee->current_network.channel = last_channel;
 
 out1:
@@ -609,10 +603,6 @@ static void rtllib_start_scan(struct rtllib_device *ieee)
 {
        ieee->rtllib_ips_leave_wq(ieee->dev);
 
-       if (IS_DOT11D_ENABLE(ieee)) {
-               if (IS_COUNTRY_IE_VALID(ieee))
-                       RESET_CIE_WATCHDOG(ieee);
-       }
        if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) {
                if (ieee->scanning_continue == 0) {
                        ieee->actscanning = true;
@@ -625,10 +615,6 @@ static void rtllib_start_scan(struct rtllib_device *ieee)
 /* called with wx_mutex held */
 void rtllib_start_scan_syncro(struct rtllib_device *ieee)
 {
-       if (IS_DOT11D_ENABLE(ieee)) {
-               if (IS_COUNTRY_IE_VALID(ieee))
-                       RESET_CIE_WATCHDOG(ieee);
-       }
        ieee->sync_scan_hurryup = 0;
        if (ieee->softmac_features & IEEE_SOFTMAC_SCAN)
                rtllib_softmac_scan_syncro(ieee);
@@ -2090,10 +2076,6 @@ static void rtllib_start_bss(struct rtllib_device *ieee)
 {
        unsigned long flags;
 
-       if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee)) {
-               if (!ieee->global_domain)
-                       return;
-       }
        /* check if we have already found the net we
         * are interested in (if any).
         * if not (we are disassociated and we are not
@@ -2128,8 +2110,6 @@ void rtllib_disassociate(struct rtllib_device *ieee)
        if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)
                rtllib_reset_queue(ieee);
 
-       if (IS_DOT11D_ENABLE(ieee))
-               dot11d_reset(ieee);
        ieee->link_state = MAC80211_NOLINK;
        ieee->is_set_key = false;
        ieee->wap_set = 0;