]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
mwifiex: fix make namespacecheck warnings
authorAmitkumar Karwar <akarwar@marvell.com>
Thu, 13 Oct 2011 03:29:33 +0000 (20:29 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 14 Oct 2011 18:48:20 +0000 (14:48 -0400)
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>
drivers/net/wireless/mwifiex/cfp.c
drivers/net/wireless/mwifiex/fw.h
drivers/net/wireless/mwifiex/init.c
drivers/net/wireless/mwifiex/main.h
drivers/net/wireless/mwifiex/scan.c
drivers/net/wireless/mwifiex/sta_ioctl.c
drivers/net/wireless/mwifiex/txrx.c

index d0cada5a29a0e9cf0f67e4cc70efc048b6ebf036..f2e6de03805cd61bbe246d8ccf8a5a6235d78e0b 100644 (file)
@@ -48,7 +48,7 @@ static u8 adhoc_rates_bg[BG_SUPPORTED_RATES] = { 0x82, 0x84, 0x8b, 0x96,
 
 static u8 adhoc_rates_a[A_SUPPORTED_RATES] = { 0x8c, 0x12, 0x98, 0x24,
                                               0xb0, 0x48, 0x60, 0x6c, 0 };
-u8 supported_rates_a[A_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24,
+static u8 supported_rates_a[A_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24,
                                        0xb0, 0x48, 0x60, 0x6c, 0 };
 static u16 mwifiex_data_rates[MWIFIEX_SUPPORTED_RATES_EXT] = { 0x02, 0x04,
                                        0x0B, 0x16, 0x00, 0x0C, 0x12, 0x18,
@@ -57,19 +57,19 @@ static u16 mwifiex_data_rates[MWIFIEX_SUPPORTED_RATES_EXT] = { 0x02, 0x04,
                                        0x75, 0x82, 0x0C, 0x1B, 0x36, 0x51,
                                        0x6C, 0xA2, 0xD8, 0xF3, 0x10E, 0x00 };
 
-u8 supported_rates_b[B_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x16, 0 };
+static u8 supported_rates_b[B_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x16, 0 };
 
-u8 supported_rates_g[G_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24,
+static u8 supported_rates_g[G_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24,
                                        0x30, 0x48, 0x60, 0x6c, 0 };
 
-u8 supported_rates_bg[BG_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x0c,
+static u8 supported_rates_bg[BG_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x0c,
                                        0x12, 0x16, 0x18, 0x24, 0x30, 0x48,
                                        0x60, 0x6c, 0 };
 
 u16 region_code_index[MWIFIEX_MAX_REGION_CODE] = { 0x10, 0x20, 0x30,
                                                0x32, 0x40, 0x41, 0xff };
 
-u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 };
+static u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 };
 
 /*
  * This function maps an index in supported rates table into
index 71c61b7e74ee81f734aa1efa066dd68cb65ccbef..0cc5d73cb0c1e99730b4ebcbd882bc765ac187f0 100644 (file)
@@ -57,12 +57,6 @@ struct tx_packet_hdr {
 #define GET_FW_DEFAULT_BANDS(adapter)  \
        ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS)
 
-extern u8 supported_rates_b[B_SUPPORTED_RATES];
-extern u8 supported_rates_g[G_SUPPORTED_RATES];
-extern u8 supported_rates_bg[BG_SUPPORTED_RATES];
-extern u8 supported_rates_a[A_SUPPORTED_RATES];
-extern u8 supported_rates_n[N_SUPPORTED_RATES];
-
 #define HostCmd_WEP_KEY_INDEX_MASK              0x3fff
 
 #define KEY_INFO_ENABLED        0x01
index 0ce72fc91437ba2646c56313c1ea9a8f34277fb9..d792b3fb7c16ec407984288772eaa1e17a21c6b6 100644 (file)
@@ -282,6 +282,34 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
        adapter->arp_filter_size = 0;
 }
 
+/*
+ *  This function releases the lock variables and frees the locks and
+ *  associated locks.
+ */
+static void mwifiex_free_lock_list(struct mwifiex_adapter *adapter)
+{
+       struct mwifiex_private *priv;
+       s32 i, j;
+
+       /* Free lists */
+       list_del(&adapter->cmd_free_q);
+       list_del(&adapter->cmd_pending_q);
+       list_del(&adapter->scan_pending_q);
+
+       for (i = 0; i < adapter->priv_num; i++)
+               list_del(&adapter->bss_prio_tbl[i].bss_prio_head);
+
+       for (i = 0; i < adapter->priv_num; i++) {
+               if (adapter->priv[i]) {
+                       priv = adapter->priv[i];
+                       for (j = 0; j < MAX_NUM_TID; ++j)
+                               list_del(&priv->wmm.tid_tbl_ptr[j].ra_list);
+                       list_del(&priv->tx_ba_stream_tbl_ptr);
+                       list_del(&priv->rx_reorder_tbl_ptr);
+               }
+       }
+}
+
 /*
  * This function frees the adapter structure.
  *
@@ -375,34 +403,6 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
        return 0;
 }
 
-/*
- *  This function releases the lock variables and frees the locks and
- *  associated locks.
- */
-void mwifiex_free_lock_list(struct mwifiex_adapter *adapter)
-{
-       struct mwifiex_private *priv;
-       s32 i, j;
-
-       /* Free lists */
-       list_del(&adapter->cmd_free_q);
-       list_del(&adapter->cmd_pending_q);
-       list_del(&adapter->scan_pending_q);
-
-       for (i = 0; i < adapter->priv_num; i++)
-               list_del(&adapter->bss_prio_tbl[i].bss_prio_head);
-
-       for (i = 0; i < adapter->priv_num; i++) {
-               if (adapter->priv[i]) {
-                       priv = adapter->priv[i];
-                       for (j = 0; j < MAX_NUM_TID; ++j)
-                               list_del(&priv->wmm.tid_tbl_ptr[j].ra_list);
-                       list_del(&priv->tx_ba_stream_tbl_ptr);
-                       list_del(&priv->rx_reorder_tbl_ptr);
-               }
-       }
-}
-
 /*
  * This function initializes the firmware.
  *
index 7db20dbf486dc04da9b97430ae3eaa8cf7805d1b..30f138b6fa4c6cf4545ca1c2500baf8a42c43248 100644 (file)
@@ -658,7 +658,6 @@ struct mwifiex_adapter {
 };
 
 int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);
-void mwifiex_free_lock_list(struct mwifiex_adapter *adapter);
 
 int mwifiex_init_fw(struct mwifiex_adapter *adapter);
 
@@ -709,8 +708,6 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
 int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags);
 int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
                                struct sk_buff *skb, int status);
-int mwifiex_recv_packet_complete(struct mwifiex_adapter *,
-                                struct sk_buff *skb, int status);
 void mwifiex_clean_txrx(struct mwifiex_private *priv);
 u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv);
 void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter);
@@ -740,8 +737,6 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *,
 int mwifiex_process_sta_event(struct mwifiex_private *);
 void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb);
 int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta);
-int mwifiex_scan_networks(struct mwifiex_private *priv,
-                         const struct mwifiex_user_scan_cfg *user_scan_in);
 int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
                            struct mwifiex_scan_cmd_config *scan_cfg);
 void mwifiex_queue_scan_cmd(struct mwifiex_private *priv,
@@ -901,9 +896,6 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
 int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter);
 int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
                      struct mwifiex_802_11_ssid *req_ssid);
-int mwifiex_set_hs_params(struct mwifiex_private *priv,
-                             u16 action, int cmd_type,
-                             struct mwifiex_ds_hs_cfg *hscfg);
 int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
 int mwifiex_enable_hs(struct mwifiex_adapter *adapter);
 int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
index 5456dcbf037cfc47ec4d5a010e1fb415c3f7bb8e..dae8dbb24a03e83352742b20c3320c9819019889 100644 (file)
@@ -171,29 +171,6 @@ mwifiex_ssid_cmp(struct mwifiex_802_11_ssid *ssid1,
        return memcmp(ssid1->ssid, ssid2->ssid, ssid1->ssid_len);
 }
 
-/*
- * Sends IOCTL request to start a scan with user configurations.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- *
- * Upon completion, it also generates a wireless event to notify
- * applications.
- */
-int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
-                               struct mwifiex_user_scan_cfg *scan_req)
-{
-       int status;
-
-       priv->adapter->scan_wait_q_woken = false;
-
-       status = mwifiex_scan_networks(priv, scan_req);
-       if (!status)
-               status = mwifiex_wait_queue_complete(priv->adapter);
-
-       return status;
-}
-
 /*
  * This function checks if wapi is enabled in driver and scanned network is
  * compatible with it.
@@ -1316,8 +1293,8 @@ mwifiex_radio_type_to_band(u8 radio_type)
  * order to send the appropriate scan commands to firmware to populate or
  * update the internal driver scan table.
  */
-int mwifiex_scan_networks(struct mwifiex_private *priv,
-                         const struct mwifiex_user_scan_cfg *user_scan_in)
+static int mwifiex_scan_networks(struct mwifiex_private *priv,
+               const struct mwifiex_user_scan_cfg *user_scan_in)
 {
        int ret = 0;
        struct mwifiex_adapter *adapter = priv->adapter;
@@ -1398,6 +1375,29 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
        return ret;
 }
 
+/*
+ * Sends IOCTL request to start a scan with user configurations.
+ *
+ * This function allocates the IOCTL request buffer, fills it
+ * with requisite parameters and calls the IOCTL handler.
+ *
+ * Upon completion, it also generates a wireless event to notify
+ * applications.
+ */
+int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
+                               struct mwifiex_user_scan_cfg *scan_req)
+{
+       int status;
+
+       priv->adapter->scan_wait_q_woken = false;
+
+       status = mwifiex_scan_networks(priv, scan_req);
+       if (!status)
+               status = mwifiex_wait_queue_complete(priv->adapter);
+
+       return status;
+}
+
 /*
  * This function prepares a scan command to be sent to the firmware.
  *
index d39bb72896f17101a1d2f07af30334b07f044eda..ea4a29b7e331c4bccf646deb92f414c4825a5796 100644 (file)
@@ -293,8 +293,8 @@ done:
  * This function prepares the correct firmware command and
  * issues it.
  */
-int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
-                         int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg)
+static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
+                                int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg)
 
 {
        struct mwifiex_adapter *adapter = priv->adapter;
index 4c3421eb6f40d5cd3a39ed9428de89a30596685f..a206f412875f74647d8b7362fc17bb7c674bc047 100644 (file)
@@ -161,43 +161,3 @@ done:
        return 0;
 }
 
-/*
- * Packet receive completion callback handler.
- *
- * This function calls another completion callback handler which
- * updates the statistics, and optionally updates the parent buffer
- * use count before freeing the received packet.
- */
-int mwifiex_recv_packet_complete(struct mwifiex_adapter *adapter,
-                                struct sk_buff *skb, int status)
-{
-       struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb);
-       struct mwifiex_rxinfo *rx_info_parent;
-       struct mwifiex_private *priv;
-       struct sk_buff *skb_parent;
-       unsigned long flags;
-
-       priv = adapter->priv[rx_info->bss_index];
-
-       if (priv && (status == -1))
-               priv->stats.rx_dropped++;
-
-       if (rx_info->parent) {
-               skb_parent = rx_info->parent;
-               rx_info_parent = MWIFIEX_SKB_RXCB(skb_parent);
-
-               spin_lock_irqsave(&priv->rx_pkt_lock, flags);
-               --rx_info_parent->use_count;
-
-               if (!rx_info_parent->use_count) {
-                       spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
-                       dev_kfree_skb_any(skb_parent);
-               } else {
-                       spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
-               }
-       } else {
-               dev_kfree_skb_any(skb);
-       }
-
-       return 0;
-}