Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mwifiex: fix make namespacecheck warnings

This patch takes care of warnings found by running
'make namespacecheck':

1. Remove dead code.
2. Reorder function definitions to avoid forward declarations.
3. Remove unnecessary function/structure declarations and mark
them as static.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Amitkumar Karwar and committed by
John W. Linville
711825a0 efaaa8b8

+60 -114
+5 -5
drivers/net/wireless/mwifiex/cfp.c
··· 48 48 49 49 static u8 adhoc_rates_a[A_SUPPORTED_RATES] = { 0x8c, 0x12, 0x98, 0x24, 50 50 0xb0, 0x48, 0x60, 0x6c, 0 }; 51 - u8 supported_rates_a[A_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24, 51 + static u8 supported_rates_a[A_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24, 52 52 0xb0, 0x48, 0x60, 0x6c, 0 }; 53 53 static u16 mwifiex_data_rates[MWIFIEX_SUPPORTED_RATES_EXT] = { 0x02, 0x04, 54 54 0x0B, 0x16, 0x00, 0x0C, 0x12, 0x18, ··· 57 57 0x75, 0x82, 0x0C, 0x1B, 0x36, 0x51, 58 58 0x6C, 0xA2, 0xD8, 0xF3, 0x10E, 0x00 }; 59 59 60 - u8 supported_rates_b[B_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x16, 0 }; 60 + static u8 supported_rates_b[B_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x16, 0 }; 61 61 62 - u8 supported_rates_g[G_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24, 62 + static u8 supported_rates_g[G_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24, 63 63 0x30, 0x48, 0x60, 0x6c, 0 }; 64 64 65 - u8 supported_rates_bg[BG_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x0c, 65 + static u8 supported_rates_bg[BG_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x0c, 66 66 0x12, 0x16, 0x18, 0x24, 0x30, 0x48, 67 67 0x60, 0x6c, 0 }; 68 68 69 69 u16 region_code_index[MWIFIEX_MAX_REGION_CODE] = { 0x10, 0x20, 0x30, 70 70 0x32, 0x40, 0x41, 0xff }; 71 71 72 - u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 }; 72 + static u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 }; 73 73 74 74 /* 75 75 * This function maps an index in supported rates table into
-6
drivers/net/wireless/mwifiex/fw.h
··· 57 57 #define GET_FW_DEFAULT_BANDS(adapter) \ 58 58 ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS) 59 59 60 - extern u8 supported_rates_b[B_SUPPORTED_RATES]; 61 - extern u8 supported_rates_g[G_SUPPORTED_RATES]; 62 - extern u8 supported_rates_bg[BG_SUPPORTED_RATES]; 63 - extern u8 supported_rates_a[A_SUPPORTED_RATES]; 64 - extern u8 supported_rates_n[N_SUPPORTED_RATES]; 65 - 66 60 #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff 67 61 68 62 #define KEY_INFO_ENABLED 0x01
+28 -28
drivers/net/wireless/mwifiex/init.c
··· 283 283 } 284 284 285 285 /* 286 + * This function releases the lock variables and frees the locks and 287 + * associated locks. 288 + */ 289 + static void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) 290 + { 291 + struct mwifiex_private *priv; 292 + s32 i, j; 293 + 294 + /* Free lists */ 295 + list_del(&adapter->cmd_free_q); 296 + list_del(&adapter->cmd_pending_q); 297 + list_del(&adapter->scan_pending_q); 298 + 299 + for (i = 0; i < adapter->priv_num; i++) 300 + list_del(&adapter->bss_prio_tbl[i].bss_prio_head); 301 + 302 + for (i = 0; i < adapter->priv_num; i++) { 303 + if (adapter->priv[i]) { 304 + priv = adapter->priv[i]; 305 + for (j = 0; j < MAX_NUM_TID; ++j) 306 + list_del(&priv->wmm.tid_tbl_ptr[j].ra_list); 307 + list_del(&priv->tx_ba_stream_tbl_ptr); 308 + list_del(&priv->rx_reorder_tbl_ptr); 309 + } 310 + } 311 + } 312 + 313 + /* 286 314 * This function frees the adapter structure. 287 315 * 288 316 * The freeing operation is done recursively, by canceling all ··· 401 373 } 402 374 403 375 return 0; 404 - } 405 - 406 - /* 407 - * This function releases the lock variables and frees the locks and 408 - * associated locks. 409 - */ 410 - void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) 411 - { 412 - struct mwifiex_private *priv; 413 - s32 i, j; 414 - 415 - /* Free lists */ 416 - list_del(&adapter->cmd_free_q); 417 - list_del(&adapter->cmd_pending_q); 418 - list_del(&adapter->scan_pending_q); 419 - 420 - for (i = 0; i < adapter->priv_num; i++) 421 - list_del(&adapter->bss_prio_tbl[i].bss_prio_head); 422 - 423 - for (i = 0; i < adapter->priv_num; i++) { 424 - if (adapter->priv[i]) { 425 - priv = adapter->priv[i]; 426 - for (j = 0; j < MAX_NUM_TID; ++j) 427 - list_del(&priv->wmm.tid_tbl_ptr[j].ra_list); 428 - list_del(&priv->tx_ba_stream_tbl_ptr); 429 - list_del(&priv->rx_reorder_tbl_ptr); 430 - } 431 - } 432 376 } 433 377 434 378 /*
-8
drivers/net/wireless/mwifiex/main.h
··· 658 658 }; 659 659 660 660 int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); 661 - void mwifiex_free_lock_list(struct mwifiex_adapter *adapter); 662 661 663 662 int mwifiex_init_fw(struct mwifiex_adapter *adapter); 664 663 ··· 708 709 int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags); 709 710 int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, 710 711 struct sk_buff *skb, int status); 711 - int mwifiex_recv_packet_complete(struct mwifiex_adapter *, 712 - struct sk_buff *skb, int status); 713 712 void mwifiex_clean_txrx(struct mwifiex_private *priv); 714 713 u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv); 715 714 void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter); ··· 737 740 int mwifiex_process_sta_event(struct mwifiex_private *); 738 741 void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); 739 742 int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta); 740 - int mwifiex_scan_networks(struct mwifiex_private *priv, 741 - const struct mwifiex_user_scan_cfg *user_scan_in); 742 743 int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, 743 744 struct mwifiex_scan_cmd_config *scan_cfg); 744 745 void mwifiex_queue_scan_cmd(struct mwifiex_private *priv, ··· 896 901 int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter); 897 902 int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, 898 903 struct mwifiex_802_11_ssid *req_ssid); 899 - int mwifiex_set_hs_params(struct mwifiex_private *priv, 900 - u16 action, int cmd_type, 901 - struct mwifiex_ds_hs_cfg *hscfg); 902 904 int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); 903 905 int mwifiex_enable_hs(struct mwifiex_adapter *adapter); 904 906 int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
+25 -25
drivers/net/wireless/mwifiex/scan.c
··· 172 172 } 173 173 174 174 /* 175 - * Sends IOCTL request to start a scan with user configurations. 176 - * 177 - * This function allocates the IOCTL request buffer, fills it 178 - * with requisite parameters and calls the IOCTL handler. 179 - * 180 - * Upon completion, it also generates a wireless event to notify 181 - * applications. 182 - */ 183 - int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, 184 - struct mwifiex_user_scan_cfg *scan_req) 185 - { 186 - int status; 187 - 188 - priv->adapter->scan_wait_q_woken = false; 189 - 190 - status = mwifiex_scan_networks(priv, scan_req); 191 - if (!status) 192 - status = mwifiex_wait_queue_complete(priv->adapter); 193 - 194 - return status; 195 - } 196 - 197 - /* 198 175 * This function checks if wapi is enabled in driver and scanned network is 199 176 * compatible with it. 200 177 */ ··· 1293 1316 * order to send the appropriate scan commands to firmware to populate or 1294 1317 * update the internal driver scan table. 1295 1318 */ 1296 - int mwifiex_scan_networks(struct mwifiex_private *priv, 1297 - const struct mwifiex_user_scan_cfg *user_scan_in) 1319 + static int mwifiex_scan_networks(struct mwifiex_private *priv, 1320 + const struct mwifiex_user_scan_cfg *user_scan_in) 1298 1321 { 1299 1322 int ret = 0; 1300 1323 struct mwifiex_adapter *adapter = priv->adapter; ··· 1373 1396 kfree(scan_cfg_out); 1374 1397 kfree(scan_chan_list); 1375 1398 return ret; 1399 + } 1400 + 1401 + /* 1402 + * Sends IOCTL request to start a scan with user configurations. 1403 + * 1404 + * This function allocates the IOCTL request buffer, fills it 1405 + * with requisite parameters and calls the IOCTL handler. 1406 + * 1407 + * Upon completion, it also generates a wireless event to notify 1408 + * applications. 1409 + */ 1410 + int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, 1411 + struct mwifiex_user_scan_cfg *scan_req) 1412 + { 1413 + int status; 1414 + 1415 + priv->adapter->scan_wait_q_woken = false; 1416 + 1417 + status = mwifiex_scan_networks(priv, scan_req); 1418 + if (!status) 1419 + status = mwifiex_wait_queue_complete(priv->adapter); 1420 + 1421 + return status; 1376 1422 } 1377 1423 1378 1424 /*
+2 -2
drivers/net/wireless/mwifiex/sta_ioctl.c
··· 293 293 * This function prepares the correct firmware command and 294 294 * issues it. 295 295 */ 296 - int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, 297 - int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg) 296 + static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, 297 + int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg) 298 298 299 299 { 300 300 struct mwifiex_adapter *adapter = priv->adapter;
-40
drivers/net/wireless/mwifiex/txrx.c
··· 161 161 return 0; 162 162 } 163 163 164 - /* 165 - * Packet receive completion callback handler. 166 - * 167 - * This function calls another completion callback handler which 168 - * updates the statistics, and optionally updates the parent buffer 169 - * use count before freeing the received packet. 170 - */ 171 - int mwifiex_recv_packet_complete(struct mwifiex_adapter *adapter, 172 - struct sk_buff *skb, int status) 173 - { 174 - struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); 175 - struct mwifiex_rxinfo *rx_info_parent; 176 - struct mwifiex_private *priv; 177 - struct sk_buff *skb_parent; 178 - unsigned long flags; 179 - 180 - priv = adapter->priv[rx_info->bss_index]; 181 - 182 - if (priv && (status == -1)) 183 - priv->stats.rx_dropped++; 184 - 185 - if (rx_info->parent) { 186 - skb_parent = rx_info->parent; 187 - rx_info_parent = MWIFIEX_SKB_RXCB(skb_parent); 188 - 189 - spin_lock_irqsave(&priv->rx_pkt_lock, flags); 190 - --rx_info_parent->use_count; 191 - 192 - if (!rx_info_parent->use_count) { 193 - spin_unlock_irqrestore(&priv->rx_pkt_lock, flags); 194 - dev_kfree_skb_any(skb_parent); 195 - } else { 196 - spin_unlock_irqrestore(&priv->rx_pkt_lock, flags); 197 - } 198 - } else { 199 - dev_kfree_skb_any(skb); 200 - } 201 - 202 - return 0; 203 - }