aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2011-05-03 23:11:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-05 14:59:16 -0400
commit270e58e8898c8be40451ebee45b6c9b5bd5db04b (patch)
tree4dd71a0e18a3f5528af59fcaebc61d98377792e5
parent57f16b5da03784d1660133fbec7281ea5735da69 (diff)
mwifiex: remove unnecessary variable initialization
Skip initialization of local variables with some default values if the values are not going to be used further down the code path. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwifiex/11n.c7
-rw-r--r--drivers/net/wireless/mwifiex/11n_aggr.c7
-rw-r--r--drivers/net/wireless/mwifiex/11n_rxreorder.c15
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c23
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c28
-rw-r--r--drivers/net/wireless/mwifiex/debugfs.c10
-rw-r--r--drivers/net/wireless/mwifiex/init.c29
-rw-r--r--drivers/net/wireless/mwifiex/join.c9
-rw-r--r--drivers/net/wireless/mwifiex/main.c19
-rw-r--r--drivers/net/wireless/mwifiex/scan.c22
-rw-r--r--drivers/net/wireless/mwifiex/sdio.c30
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmd.c8
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmdresp.c28
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c50
-rw-r--r--drivers/net/wireless/mwifiex/sta_rx.c4
-rw-r--r--drivers/net/wireless/mwifiex/sta_tx.c4
-rw-r--r--drivers/net/wireless/mwifiex/txrx.c10
-rw-r--r--drivers/net/wireless/mwifiex/util.c8
-rw-r--r--drivers/net/wireless/mwifiex/wmm.c2
19 files changed, 148 insertions, 165 deletions
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index 1d294cfa6c9b..916183d39009 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -187,7 +187,7 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
187 */ 187 */
188int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, void *data_buf) 188int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, void *data_buf)
189{ 189{
190 struct mwifiex_ds_11n_tx_cfg *tx_cfg = NULL; 190 struct mwifiex_ds_11n_tx_cfg *tx_cfg;
191 struct host_cmd_ds_11n_cfg *htcfg = &resp->params.htcfg; 191 struct host_cmd_ds_11n_cfg *htcfg = &resp->params.htcfg;
192 192
193 if (data_buf) { 193 if (data_buf) {
@@ -274,7 +274,7 @@ int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd,
274int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp, 274int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp,
275 void *data_buf) 275 void *data_buf)
276{ 276{
277 struct mwifiex_ds_11n_amsdu_aggr_ctrl *amsdu_aggr_ctrl = NULL; 277 struct mwifiex_ds_11n_amsdu_aggr_ctrl *amsdu_aggr_ctrl;
278 struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl = 278 struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl =
279 &resp->params.amsdu_aggr_ctrl; 279 &resp->params.amsdu_aggr_ctrl;
280 280
@@ -461,8 +461,7 @@ mwifiex_cfg_tx_buf(struct mwifiex_private *priv,
461 struct mwifiex_bssdescriptor *bss_desc) 461 struct mwifiex_bssdescriptor *bss_desc)
462{ 462{
463 u16 max_amsdu = MWIFIEX_TX_DATA_BUF_SIZE_2K; 463 u16 max_amsdu = MWIFIEX_TX_DATA_BUF_SIZE_2K;
464 u16 tx_buf = 0; 464 u16 tx_buf, curr_tx_buf_size = 0;
465 u16 curr_tx_buf_size = 0;
466 465
467 if (bss_desc->bcn_ht_cap) { 466 if (bss_desc->bcn_ht_cap) {
468 if (le16_to_cpu(bss_desc->bcn_ht_cap->cap_info) & 467 if (le16_to_cpu(bss_desc->bcn_ht_cap->cap_info) &
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index c9fb0627de43..12cf4246f96b 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -60,7 +60,7 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr,
60 * later with ethertype 60 * later with ethertype
61 */ 61 */
62 }; 62 };
63 struct tx_packet_hdr *tx_header = NULL; 63 struct tx_packet_hdr *tx_header;
64 64
65 skb_put(skb_aggr, sizeof(*tx_header)); 65 skb_put(skb_aggr, sizeof(*tx_header));
66 66
@@ -182,7 +182,7 @@ int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv,
182 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); 182 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb);
183 struct rxpd *local_rx_pd = (struct rxpd *) skb->data; 183 struct rxpd *local_rx_pd = (struct rxpd *) skb->data;
184 struct sk_buff *skb_daggr; 184 struct sk_buff *skb_daggr;
185 struct mwifiex_rxinfo *rx_info_daggr = NULL; 185 struct mwifiex_rxinfo *rx_info_daggr;
186 int ret = -1; 186 int ret = -1;
187 struct rx_packet_hdr *rx_pkt_hdr; 187 struct rx_packet_hdr *rx_pkt_hdr;
188 struct mwifiex_adapter *adapter = priv->adapter; 188 struct mwifiex_adapter *adapter = priv->adapter;
@@ -285,8 +285,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
285 struct mwifiex_adapter *adapter = priv->adapter; 285 struct mwifiex_adapter *adapter = priv->adapter;
286 struct sk_buff *skb_aggr, *skb_src; 286 struct sk_buff *skb_aggr, *skb_src;
287 struct mwifiex_txinfo *tx_info_aggr, *tx_info_src; 287 struct mwifiex_txinfo *tx_info_aggr, *tx_info_src;
288 int pad = 0; 288 int pad = 0, ret;
289 int ret = 0;
290 struct mwifiex_tx_param tx_param; 289 struct mwifiex_tx_param tx_param;
291 struct txpd *ptx_pd = NULL; 290 struct txpd *ptx_pd = NULL;
292 291
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index a93c03fdea82..e5dfdc39a921 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -39,7 +39,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
39 *rx_reor_tbl_ptr, int start_win) 39 *rx_reor_tbl_ptr, int start_win)
40{ 40{
41 int no_pkt_to_send, i; 41 int no_pkt_to_send, i;
42 void *rx_tmp_ptr = NULL; 42 void *rx_tmp_ptr;
43 unsigned long flags; 43 unsigned long flags;
44 44
45 no_pkt_to_send = (start_win > rx_reor_tbl_ptr->start_win) ? 45 no_pkt_to_send = (start_win > rx_reor_tbl_ptr->start_win) ?
@@ -88,7 +88,7 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv,
88 struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr) 88 struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr)
89{ 89{
90 int i, j, xchg; 90 int i, j, xchg;
91 void *rx_tmp_ptr = NULL; 91 void *rx_tmp_ptr;
92 unsigned long flags; 92 unsigned long flags;
93 93
94 for (i = 0; i < rx_reor_tbl_ptr->win_size; ++i) { 94 for (i = 0; i < rx_reor_tbl_ptr->win_size; ++i) {
@@ -335,8 +335,8 @@ int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv,
335 &cmd->params.add_ba_rsp; 335 &cmd->params.add_ba_rsp;
336 struct host_cmd_ds_11n_addba_req *cmd_addba_req = 336 struct host_cmd_ds_11n_addba_req *cmd_addba_req =
337 (struct host_cmd_ds_11n_addba_req *) data_buf; 337 (struct host_cmd_ds_11n_addba_req *) data_buf;
338 u8 tid = 0; 338 u8 tid;
339 int win_size = 0; 339 int win_size;
340 uint16_t block_ack_param_set; 340 uint16_t block_ack_param_set;
341 341
342 cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_RSP); 342 cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_RSP);
@@ -406,9 +406,8 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
406 u8 *ta, u8 pkt_type, void *payload) 406 u8 *ta, u8 pkt_type, void *payload)
407{ 407{
408 struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr; 408 struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr;
409 int start_win, end_win, win_size; 409 int start_win, end_win, win_size, ret;
410 int ret = 0; 410 u16 pkt_index;
411 u16 pkt_index = 0;
412 411
413 rx_reor_tbl_ptr = 412 rx_reor_tbl_ptr =
414 mwifiex_11n_get_rx_reorder_tbl((struct mwifiex_private *) priv, 413 mwifiex_11n_get_rx_reorder_tbl((struct mwifiex_private *) priv,
@@ -540,7 +539,7 @@ int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv,
540 (struct host_cmd_ds_11n_addba_rsp *) 539 (struct host_cmd_ds_11n_addba_rsp *)
541 &resp->params.add_ba_rsp; 540 &resp->params.add_ba_rsp;
542 int tid, win_size; 541 int tid, win_size;
543 struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr = NULL; 542 struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr;
544 uint16_t block_ack_param_set; 543 uint16_t block_ack_param_set;
545 544
546 block_ack_param_set = le16_to_cpu(add_ba_rsp->block_ack_param_set); 545 block_ack_param_set = le16_to_cpu(add_ba_rsp->block_ack_param_set);
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 77a80296b6cb..0c0116374d7d 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -77,18 +77,15 @@ mwifiex_channels_to_cfg80211_channel_type(int channel_type)
77static int 77static int
78mwifiex_is_alg_wep(u32 cipher) 78mwifiex_is_alg_wep(u32 cipher)
79{ 79{
80 int alg = 0;
81
82 switch (cipher) { 80 switch (cipher) {
83 case WLAN_CIPHER_SUITE_WEP40: 81 case WLAN_CIPHER_SUITE_WEP40:
84 case WLAN_CIPHER_SUITE_WEP104: 82 case WLAN_CIPHER_SUITE_WEP104:
85 alg = 1; 83 return 1;
86 break;
87 default: 84 default:
88 alg = 0;
89 break; 85 break;
90 } 86 }
91 return alg; 87
88 return 0;
92} 89}
93 90
94/* 91/*
@@ -408,7 +405,7 @@ mwifiex_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev,
408static int 405static int
409mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr) 406mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr)
410{ 407{
411 int ret = 0; 408 int ret;
412 409
413 if (frag_thr < MWIFIEX_FRAG_MIN_VALUE 410 if (frag_thr < MWIFIEX_FRAG_MIN_VALUE
414 || frag_thr > MWIFIEX_FRAG_MAX_VALUE) 411 || frag_thr > MWIFIEX_FRAG_MAX_VALUE)
@@ -449,7 +446,6 @@ static int
449mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) 446mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
450{ 447{
451 struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); 448 struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
452
453 int ret = 0; 449 int ret = 0;
454 450
455 if (changed & WIPHY_PARAM_RTS_THRESHOLD) { 451 if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
@@ -473,7 +469,7 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
473 enum nl80211_iftype type, u32 *flags, 469 enum nl80211_iftype type, u32 *flags,
474 struct vif_params *params) 470 struct vif_params *params)
475{ 471{
476 int ret = 0; 472 int ret;
477 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 473 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
478 474
479 if (priv->bss_mode == type) { 475 if (priv->bss_mode == type) {
@@ -717,7 +713,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
717{ 713{
718 struct ieee80211_channel *chan; 714 struct ieee80211_channel *chan;
719 struct mwifiex_bss_info bss_info; 715 struct mwifiex_bss_info bss_info;
720 int ie_len = 0; 716 int ie_len;
721 u8 ie_buf[IEEE80211_MAX_SSID_LEN + sizeof(struct ieee_types_header)]; 717 u8 ie_buf[IEEE80211_MAX_SSID_LEN + sizeof(struct ieee_types_header)];
722 718
723 if (mwifiex_get_bss_info(priv, &bss_info)) 719 if (mwifiex_get_bss_info(priv, &bss_info))
@@ -903,8 +899,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
903{ 899{
904 struct mwifiex_802_11_ssid req_ssid; 900 struct mwifiex_802_11_ssid req_ssid;
905 struct mwifiex_ssid_bssid ssid_bssid; 901 struct mwifiex_ssid_bssid ssid_bssid;
906 int ret = 0; 902 int ret, auth_type = 0;
907 int auth_type = 0;
908 903
909 memset(&req_ssid, 0, sizeof(struct mwifiex_802_11_ssid)); 904 memset(&req_ssid, 0, sizeof(struct mwifiex_802_11_ssid));
910 memset(&ssid_bssid, 0, sizeof(struct mwifiex_ssid_bssid)); 905 memset(&ssid_bssid, 0, sizeof(struct mwifiex_ssid_bssid));
@@ -1247,8 +1242,8 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = {
1247int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac, 1242int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac,
1248 struct mwifiex_private *priv) 1243 struct mwifiex_private *priv)
1249{ 1244{
1250 int ret = 0; 1245 int ret;
1251 void *wdev_priv = NULL; 1246 void *wdev_priv;
1252 struct wireless_dev *wdev; 1247 struct wireless_dev *wdev;
1253 1248
1254 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); 1249 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 776146a104ec..b75cc9271a19 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -128,7 +128,7 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
128{ 128{
129 129
130 struct mwifiex_adapter *adapter = priv->adapter; 130 struct mwifiex_adapter *adapter = priv->adapter;
131 int ret = 0; 131 int ret;
132 struct host_cmd_ds_command *host_cmd; 132 struct host_cmd_ds_command *host_cmd;
133 uint16_t cmd_code; 133 uint16_t cmd_code;
134 uint16_t cmd_size; 134 uint16_t cmd_size;
@@ -222,8 +222,8 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
222 */ 222 */
223static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) 223static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
224{ 224{
225 int ret = 0; 225 int ret;
226 u16 cmd_len = 0; 226 u16 cmd_len;
227 struct mwifiex_private *priv; 227 struct mwifiex_private *priv;
228 struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf = 228 struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf =
229 (struct mwifiex_opt_sleep_confirm_buffer *) 229 (struct mwifiex_opt_sleep_confirm_buffer *)
@@ -364,13 +364,13 @@ int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter)
364 */ 364 */
365int mwifiex_process_event(struct mwifiex_adapter *adapter) 365int mwifiex_process_event(struct mwifiex_adapter *adapter)
366{ 366{
367 int ret = 0; 367 int ret;
368 struct mwifiex_private *priv = 368 struct mwifiex_private *priv =
369 mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); 369 mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
370 struct sk_buff *skb = adapter->event_skb; 370 struct sk_buff *skb = adapter->event_skb;
371 u32 eventcause = adapter->event_cause; 371 u32 eventcause = adapter->event_cause;
372 struct timeval tstamp; 372 struct timeval tstamp;
373 struct mwifiex_rxinfo *rx_info = NULL; 373 struct mwifiex_rxinfo *rx_info;
374 374
375 /* Save the last event to debug log */ 375 /* Save the last event to debug log */
376 adapter->dbg.last_event_index = 376 adapter->dbg.last_event_index =
@@ -446,10 +446,10 @@ int mwifiex_send_cmd_sync(struct mwifiex_private *priv, uint16_t cmd_no,
446int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no, 446int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no,
447 u16 cmd_action, u32 cmd_oid, void *data_buf) 447 u16 cmd_action, u32 cmd_oid, void *data_buf)
448{ 448{
449 int ret = 0; 449 int ret;
450 struct mwifiex_adapter *adapter = priv->adapter; 450 struct mwifiex_adapter *adapter = priv->adapter;
451 struct cmd_ctrl_node *cmd_node = NULL; 451 struct cmd_ctrl_node *cmd_node;
452 struct host_cmd_ds_command *cmd_ptr = NULL; 452 struct host_cmd_ds_command *cmd_ptr;
453 453
454 if (!adapter) { 454 if (!adapter) {
455 pr_err("PREP_CMD: adapter is NULL\n"); 455 pr_err("PREP_CMD: adapter is NULL\n");
@@ -605,8 +605,8 @@ mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
605 */ 605 */
606int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter) 606int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
607{ 607{
608 struct mwifiex_private *priv = NULL; 608 struct mwifiex_private *priv;
609 struct cmd_ctrl_node *cmd_node = NULL; 609 struct cmd_ctrl_node *cmd_node;
610 int ret = 0; 610 int ret = 0;
611 struct host_cmd_ds_command *host_cmd; 611 struct host_cmd_ds_command *host_cmd;
612 unsigned long cmd_flags; 612 unsigned long cmd_flags;
@@ -673,7 +673,7 @@ int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
673 */ 673 */
674int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) 674int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
675{ 675{
676 struct host_cmd_ds_command *resp = NULL; 676 struct host_cmd_ds_command *resp;
677 struct mwifiex_private *priv = 677 struct mwifiex_private *priv =
678 mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); 678 mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
679 int ret = 0; 679 int ret = 0;
@@ -805,7 +805,7 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
805{ 805{
806 struct mwifiex_adapter *adapter = 806 struct mwifiex_adapter *adapter =
807 (struct mwifiex_adapter *) function_context; 807 (struct mwifiex_adapter *) function_context;
808 struct cmd_ctrl_node *cmd_node = NULL; 808 struct cmd_ctrl_node *cmd_node;
809 struct timeval tstamp; 809 struct timeval tstamp;
810 810
811 adapter->num_cmd_timeout++; 811 adapter->num_cmd_timeout++;
@@ -877,7 +877,7 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
877void 877void
878mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter) 878mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter)
879{ 879{
880 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL; 880 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node;
881 unsigned long flags; 881 unsigned long flags;
882 882
883 /* Cancel current cmd */ 883 /* Cancel current cmd */
@@ -1160,7 +1160,7 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
1160{ 1160{
1161 struct host_cmd_ds_802_11_ps_mode_enh *psmode_enh = 1161 struct host_cmd_ds_802_11_ps_mode_enh *psmode_enh =
1162 &cmd->params.psmode_enh; 1162 &cmd->params.psmode_enh;
1163 u8 *tlv = NULL; 1163 u8 *tlv;
1164 u16 cmd_size = 0; 1164 u16 cmd_size = 0;
1165 1165
1166 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH); 1166 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH);
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index 7ddcb062f103..46d65e02c7ba 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -193,7 +193,7 @@ mwifiex_info_read(struct file *file, char __user *ubuf,
193 unsigned long page = get_zeroed_page(GFP_KERNEL); 193 unsigned long page = get_zeroed_page(GFP_KERNEL);
194 char *p = (char *) page, fmt[64]; 194 char *p = (char *) page, fmt[64];
195 struct mwifiex_bss_info info; 195 struct mwifiex_bss_info info;
196 ssize_t ret = 0; 196 ssize_t ret;
197 int i = 0; 197 int i = 0;
198 198
199 if (!p) 199 if (!p)
@@ -288,7 +288,7 @@ mwifiex_getlog_read(struct file *file, char __user *ubuf,
288 (struct mwifiex_private *) file->private_data; 288 (struct mwifiex_private *) file->private_data;
289 unsigned long page = get_zeroed_page(GFP_KERNEL); 289 unsigned long page = get_zeroed_page(GFP_KERNEL);
290 char *p = (char *) page; 290 char *p = (char *) page;
291 ssize_t ret = 0; 291 ssize_t ret;
292 struct mwifiex_ds_get_stats stats; 292 struct mwifiex_ds_get_stats stats;
293 293
294 if (!p) 294 if (!p)
@@ -400,7 +400,7 @@ mwifiex_debug_read(struct file *file, char __user *ubuf,
400 struct mwifiex_debug_data *d = &items[0]; 400 struct mwifiex_debug_data *d = &items[0];
401 unsigned long page = get_zeroed_page(GFP_KERNEL); 401 unsigned long page = get_zeroed_page(GFP_KERNEL);
402 char *p = (char *) page; 402 char *p = (char *) page;
403 ssize_t ret = 0; 403 ssize_t ret;
404 size_t size, addr; 404 size_t size, addr;
405 long val; 405 long val;
406 int i, j; 406 int i, j;
@@ -507,7 +507,7 @@ mwifiex_regrdwr_write(struct file *file,
507 unsigned long addr = get_zeroed_page(GFP_KERNEL); 507 unsigned long addr = get_zeroed_page(GFP_KERNEL);
508 char *buf = (char *) addr; 508 char *buf = (char *) addr;
509 size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1)); 509 size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1));
510 int ret = 0; 510 int ret;
511 u32 reg_type = 0, reg_offset = 0, reg_value = UINT_MAX; 511 u32 reg_type = 0, reg_offset = 0, reg_value = UINT_MAX;
512 512
513 if (!buf) 513 if (!buf)
@@ -650,7 +650,7 @@ mwifiex_rdeeprom_read(struct file *file, char __user *ubuf,
650 (struct mwifiex_private *) file->private_data; 650 (struct mwifiex_private *) file->private_data;
651 unsigned long addr = get_zeroed_page(GFP_KERNEL); 651 unsigned long addr = get_zeroed_page(GFP_KERNEL);
652 char *buf = (char *) addr; 652 char *buf = (char *) addr;
653 int pos = 0, ret = 0, i = 0; 653 int pos = 0, ret = 0, i;
654 u8 value[MAX_EEPROM_DATA]; 654 u8 value[MAX_EEPROM_DATA];
655 655
656 if (!buf) 656 if (!buf)
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index fc2c0c5728d9..27ad72b291b7 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -151,7 +151,7 @@ static int mwifiex_init_priv(struct mwifiex_private *priv)
151 */ 151 */
152static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter) 152static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
153{ 153{
154 int ret = 0; 154 int ret;
155 u32 buf_size; 155 u32 buf_size;
156 struct mwifiex_bssdescriptor *temp_scan_table; 156 struct mwifiex_bssdescriptor *temp_scan_table;
157 157
@@ -342,9 +342,8 @@ mwifiex_free_adapter(struct mwifiex_adapter *adapter)
342 */ 342 */
343int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) 343int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
344{ 344{
345 struct mwifiex_private *priv = NULL; 345 struct mwifiex_private *priv;
346 s32 i = 0; 346 s32 i, j;
347 u32 j = 0;
348 347
349 spin_lock_init(&adapter->mwifiex_lock); 348 spin_lock_init(&adapter->mwifiex_lock);
350 spin_lock_init(&adapter->int_lock); 349 spin_lock_init(&adapter->int_lock);
@@ -400,9 +399,8 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
400 */ 399 */
401void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) 400void mwifiex_free_lock_list(struct mwifiex_adapter *adapter)
402{ 401{
403 struct mwifiex_private *priv = NULL; 402 struct mwifiex_private *priv;
404 s32 i = 0; 403 s32 i, j;
405 s32 j = 0;
406 404
407 /* Free lists */ 405 /* Free lists */
408 list_del(&adapter->cmd_free_q); 406 list_del(&adapter->cmd_free_q);
@@ -436,10 +434,9 @@ void mwifiex_free_lock_list(struct mwifiex_adapter *adapter)
436 */ 434 */
437int mwifiex_init_fw(struct mwifiex_adapter *adapter) 435int mwifiex_init_fw(struct mwifiex_adapter *adapter)
438{ 436{
439 int ret = 0; 437 int ret;
440 struct mwifiex_private *priv = NULL; 438 struct mwifiex_private *priv;
441 u8 i = 0; 439 u8 i, first_sta = true;
442 u8 first_sta = true;
443 int is_cmd_pend_q_empty; 440 int is_cmd_pend_q_empty;
444 unsigned long flags; 441 unsigned long flags;
445 442
@@ -497,8 +494,7 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv)
497{ 494{
498 int i; 495 int i;
499 struct mwifiex_adapter *adapter = priv->adapter; 496 struct mwifiex_adapter *adapter = priv->adapter;
500 struct mwifiex_bss_prio_node *bssprio_node = NULL, *tmp_node = NULL, 497 struct mwifiex_bss_prio_node *bssprio_node, *tmp_node, **cur;
501 **cur = NULL;
502 struct list_head *head; 498 struct list_head *head;
503 spinlock_t *lock; 499 spinlock_t *lock;
504 unsigned long flags; 500 unsigned long flags;
@@ -552,8 +548,8 @@ int
552mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) 548mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
553{ 549{
554 int ret = -EINPROGRESS; 550 int ret = -EINPROGRESS;
555 struct mwifiex_private *priv = NULL; 551 struct mwifiex_private *priv;
556 s32 i = 0; 552 s32 i;
557 unsigned long flags; 553 unsigned long flags;
558 554
559 /* mwifiex already shutdown */ 555 /* mwifiex already shutdown */
@@ -608,9 +604,8 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
608int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, 604int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
609 struct mwifiex_fw_image *pmfw) 605 struct mwifiex_fw_image *pmfw)
610{ 606{
611 int ret = 0; 607 int ret, winner;
612 u32 poll_num = 1; 608 u32 poll_num = 1;
613 int winner;
614 609
615 /* Check if firmware is already running */ 610 /* Check if firmware is already running */
616 ret = adapter->if_ops.check_fw_status(adapter, poll_num, &winner); 611 ret = adapter->if_ops.check_fw_status(adapter, poll_num, &winner);
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 85fca5eb4195..5eab3dc29b1c 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -143,9 +143,8 @@ mwifiex_cmd_append_tsf_tlv(struct mwifiex_private *priv, u8 **buffer,
143static int mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1, 143static int mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1,
144 u32 rate1_size, u8 *rate2, u32 rate2_size) 144 u32 rate1_size, u8 *rate2, u32 rate2_size)
145{ 145{
146 int ret = 0; 146 int ret;
147 u8 *ptr = rate1; 147 u8 *ptr = rate1, *tmp;
148 u8 *tmp = NULL;
149 u32 i, j; 148 u32 i, j;
150 149
151 tmp = kmalloc(rate1_size, GFP_KERNEL); 150 tmp = kmalloc(rate1_size, GFP_KERNEL);
@@ -203,7 +202,7 @@ mwifiex_setup_rates_from_bssdesc(struct mwifiex_private *priv,
203 u8 *out_rates, u32 *out_rates_size) 202 u8 *out_rates, u32 *out_rates_size)
204{ 203{
205 u8 card_rates[MWIFIEX_SUPPORTED_RATES]; 204 u8 card_rates[MWIFIEX_SUPPORTED_RATES];
206 u32 card_rates_size = 0; 205 u32 card_rates_size;
207 206
208 /* Copy AP supported rates */ 207 /* Copy AP supported rates */
209 memcpy(out_rates, bss_desc->supported_rates, MWIFIEX_SUPPORTED_RATES); 208 memcpy(out_rates, bss_desc->supported_rates, MWIFIEX_SUPPORTED_RATES);
@@ -1359,7 +1358,7 @@ int mwifiex_adhoc_join(struct mwifiex_private *priv,
1359static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) 1358static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac)
1360{ 1359{
1361 u8 mac_address[ETH_ALEN]; 1360 u8 mac_address[ETH_ALEN];
1362 int ret = 0; 1361 int ret;
1363 u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; 1362 u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
1364 1363
1365 if (mac) { 1364 if (mac) {
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index c5971880e7b3..38f912b8fcec 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -150,7 +150,7 @@ error:
150 */ 150 */
151static int mwifiex_unregister(struct mwifiex_adapter *adapter) 151static int mwifiex_unregister(struct mwifiex_adapter *adapter)
152{ 152{
153 s32 i = 0; 153 s32 i;
154 154
155 del_timer(&adapter->cmd_timer); 155 del_timer(&adapter->cmd_timer);
156 156
@@ -379,8 +379,7 @@ static void mwifiex_free_adapter(struct mwifiex_adapter *adapter)
379 */ 379 */
380static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter) 380static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter)
381{ 381{
382 int ret = 0; 382 int ret, err;
383 int err;
384 struct mwifiex_fw_image fw; 383 struct mwifiex_fw_image fw;
385 384
386 memset(&fw, 0, sizeof(struct mwifiex_fw_image)); 385 memset(&fw, 0, sizeof(struct mwifiex_fw_image));
@@ -449,7 +448,7 @@ done:
449static void 448static void
450mwifiex_fill_buffer(struct sk_buff *skb) 449mwifiex_fill_buffer(struct sk_buff *skb)
451{ 450{
452 struct ethhdr *eth = NULL; 451 struct ethhdr *eth;
453 struct iphdr *iph; 452 struct iphdr *iph;
454 struct timeval tv; 453 struct timeval tv;
455 u8 tid = 0; 454 u8 tid = 0;
@@ -510,7 +509,7 @@ static int
510mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 509mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
511{ 510{
512 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 511 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
513 struct sk_buff *new_skb = NULL; 512 struct sk_buff *new_skb;
514 struct mwifiex_txinfo *tx_info; 513 struct mwifiex_txinfo *tx_info;
515 514
516 dev_dbg(priv->adapter->dev, "data: %lu BSS(%d): Data <= kernel\n", 515 dev_dbg(priv->adapter->dev, "data: %lu BSS(%d): Data <= kernel\n",
@@ -571,7 +570,7 @@ mwifiex_set_mac_address(struct net_device *dev, void *addr)
571{ 570{
572 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 571 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
573 struct sockaddr *hw_addr = (struct sockaddr *) addr; 572 struct sockaddr *hw_addr = (struct sockaddr *) addr;
574 int ret = 0; 573 int ret;
575 574
576 memcpy(priv->curr_addr, hw_addr->sa_data, ETH_ALEN); 575 memcpy(priv->curr_addr, hw_addr->sa_data, ETH_ALEN);
577 576
@@ -696,9 +695,9 @@ static struct mwifiex_private *mwifiex_add_interface(
696 struct mwifiex_adapter *adapter, 695 struct mwifiex_adapter *adapter,
697 u8 bss_index, u8 bss_type) 696 u8 bss_index, u8 bss_type)
698{ 697{
699 struct net_device *dev = NULL; 698 struct net_device *dev;
700 struct mwifiex_private *priv = NULL; 699 struct mwifiex_private *priv;
701 void *mdev_priv = NULL; 700 void *mdev_priv;
702 701
703 dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), "mlan%d", 702 dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), "mlan%d",
704 ether_setup, 1); 703 ether_setup, 1);
@@ -763,7 +762,7 @@ error:
763static void 762static void
764mwifiex_remove_interface(struct mwifiex_adapter *adapter, u8 bss_index) 763mwifiex_remove_interface(struct mwifiex_adapter *adapter, u8 bss_index)
765{ 764{
766 struct net_device *dev = NULL; 765 struct net_device *dev;
767 struct mwifiex_private *priv = adapter->priv[bss_index]; 766 struct mwifiex_private *priv = adapter->priv[bss_index];
768 767
769 if (!priv) 768 if (!priv)
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 31a529578805..4968974f3427 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -117,8 +117,8 @@ mwifiex_search_oui_in_ie(struct ie_body *iebody, u8 *oui)
117static u8 117static u8
118mwifiex_is_rsn_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) 118mwifiex_is_rsn_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher)
119{ 119{
120 u8 *oui = NULL; 120 u8 *oui;
121 struct ie_body *iebody = NULL; 121 struct ie_body *iebody;
122 u8 ret = MWIFIEX_OUI_NOT_PRESENT; 122 u8 ret = MWIFIEX_OUI_NOT_PRESENT;
123 123
124 if (((bss_desc->bcn_rsn_ie) && ((*(bss_desc->bcn_rsn_ie)). 124 if (((bss_desc->bcn_rsn_ie) && ((*(bss_desc->bcn_rsn_ie)).
@@ -144,8 +144,8 @@ mwifiex_is_rsn_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher)
144static u8 144static u8
145mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) 145mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher)
146{ 146{
147 u8 *oui = NULL; 147 u8 *oui;
148 struct ie_body *iebody = NULL; 148 struct ie_body *iebody;
149 u8 ret = MWIFIEX_OUI_NOT_PRESENT; 149 u8 ret = MWIFIEX_OUI_NOT_PRESENT;
150 150
151 if (((bss_desc->bcn_wpa_ie) && ((*(bss_desc->bcn_wpa_ie)). 151 if (((bss_desc->bcn_wpa_ie) && ((*(bss_desc->bcn_wpa_ie)).
@@ -181,7 +181,7 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv,
181 struct mwifiex_ssid_bssid *ssid_bssid) 181 struct mwifiex_ssid_bssid *ssid_bssid)
182{ 182{
183 struct mwifiex_ssid_bssid tmp_ssid_bssid; 183 struct mwifiex_ssid_bssid tmp_ssid_bssid;
184 u8 *mac = NULL; 184 u8 *mac;
185 185
186 if (!ssid_bssid) 186 if (!ssid_bssid)
187 return -1; 187 return -1;
@@ -213,7 +213,7 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv,
213int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, 213int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
214 struct mwifiex_user_scan_cfg *scan_req) 214 struct mwifiex_user_scan_cfg *scan_req)
215{ 215{
216 int status = 0; 216 int status;
217 217
218 priv->adapter->cmd_wait_q.condition = false; 218 priv->adapter->cmd_wait_q.condition = false;
219 219
@@ -2253,8 +2253,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
2253{ 2253{
2254 int ret = 0; 2254 int ret = 0;
2255 struct mwifiex_adapter *adapter = priv->adapter; 2255 struct mwifiex_adapter *adapter = priv->adapter;
2256 struct cmd_ctrl_node *cmd_node = NULL; 2256 struct cmd_ctrl_node *cmd_node;
2257 union mwifiex_scan_cmd_config_tlv *scan_cfg_out = NULL; 2257 union mwifiex_scan_cmd_config_tlv *scan_cfg_out;
2258 struct mwifiex_ie_types_chan_list_param_set *chan_list_out; 2258 struct mwifiex_ie_types_chan_list_param_set *chan_list_out;
2259 u32 buf_size; 2259 u32 buf_size;
2260 struct mwifiex_chan_scan_param_set *scan_chan_list; 2260 struct mwifiex_chan_scan_param_set *scan_chan_list;
@@ -2404,8 +2404,8 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
2404{ 2404{
2405 int ret = 0; 2405 int ret = 0;
2406 struct mwifiex_adapter *adapter = priv->adapter; 2406 struct mwifiex_adapter *adapter = priv->adapter;
2407 struct cmd_ctrl_node *cmd_node = NULL; 2407 struct cmd_ctrl_node *cmd_node;
2408 struct host_cmd_ds_802_11_scan_rsp *scan_rsp = NULL; 2408 struct host_cmd_ds_802_11_scan_rsp *scan_rsp;
2409 struct mwifiex_bssdescriptor *bss_new_entry = NULL; 2409 struct mwifiex_bssdescriptor *bss_new_entry = NULL;
2410 struct mwifiex_ie_types_data *tlv_data; 2410 struct mwifiex_ie_types_data *tlv_data;
2411 struct mwifiex_ie_types_tsf_timestamp *tsf_tlv; 2411 struct mwifiex_ie_types_tsf_timestamp *tsf_tlv;
@@ -2906,7 +2906,7 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv,
2906int mwifiex_request_scan(struct mwifiex_private *priv, 2906int mwifiex_request_scan(struct mwifiex_private *priv,
2907 struct mwifiex_802_11_ssid *req_ssid) 2907 struct mwifiex_802_11_ssid *req_ssid)
2908{ 2908{
2909 int ret = 0; 2909 int ret;
2910 2910
2911 if (down_interruptible(&priv->async_sem)) { 2911 if (down_interruptible(&priv->async_sem)) {
2912 dev_err(priv->adapter->dev, "%s: acquire semaphore\n", 2912 dev_err(priv->adapter->dev, "%s: acquire semaphore\n",
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 5148d0e0fad6..470dbaaeaa02 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -46,7 +46,7 @@ static struct semaphore add_remove_card_sem;
46static int 46static int
47mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) 47mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
48{ 48{
49 int ret = 0; 49 int ret;
50 struct sdio_mmc_card *card = NULL; 50 struct sdio_mmc_card *card = NULL;
51 51
52 pr_debug("info: vendor=0x%4.04X device=0x%4.04X class=%d function=%d\n", 52 pr_debug("info: vendor=0x%4.04X device=0x%4.04X class=%d function=%d\n",
@@ -119,7 +119,7 @@ static int mwifiex_sdio_suspend(struct device *dev)
119{ 119{
120 struct sdio_func *func = dev_to_sdio_func(dev); 120 struct sdio_func *func = dev_to_sdio_func(dev);
121 struct sdio_mmc_card *card; 121 struct sdio_mmc_card *card;
122 struct mwifiex_adapter *adapter = NULL; 122 struct mwifiex_adapter *adapter;
123 mmc_pm_flag_t pm_flag = 0; 123 mmc_pm_flag_t pm_flag = 0;
124 int hs_actived = 0; 124 int hs_actived = 0;
125 int i; 125 int i;
@@ -177,7 +177,7 @@ static int mwifiex_sdio_resume(struct device *dev)
177{ 177{
178 struct sdio_func *func = dev_to_sdio_func(dev); 178 struct sdio_func *func = dev_to_sdio_func(dev);
179 struct sdio_mmc_card *card; 179 struct sdio_mmc_card *card;
180 struct mwifiex_adapter *adapter = NULL; 180 struct mwifiex_adapter *adapter;
181 mmc_pm_flag_t pm_flag = 0; 181 mmc_pm_flag_t pm_flag = 0;
182 int i; 182 int i;
183 183
@@ -420,7 +420,7 @@ static int mwifiex_write_data_to_card(struct mwifiex_adapter *adapter,
420 u8 *payload, u32 pkt_len, u32 port) 420 u8 *payload, u32 pkt_len, u32 port)
421{ 421{
422 u32 i = 0; 422 u32 i = 0;
423 int ret = 0; 423 int ret;
424 424
425 do { 425 do {
426 ret = mwifiex_write_data_sync(adapter, payload, pkt_len, port); 426 ret = mwifiex_write_data_sync(adapter, payload, pkt_len, port);
@@ -531,7 +531,7 @@ static int
531mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits) 531mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits)
532{ 532{
533 u32 tries; 533 u32 tries;
534 u32 cs = 0; 534 u32 cs;
535 535
536 for (tries = 0; tries < MAX_POLL_TRIES; tries++) { 536 for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
537 if (mwifiex_read_reg(adapter, CARD_STATUS_REG, &cs)) 537 if (mwifiex_read_reg(adapter, CARD_STATUS_REG, &cs))
@@ -553,7 +553,7 @@ mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits)
553static int 553static int
554mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat) 554mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat)
555{ 555{
556 u32 fws0 = 0, fws1 = 0; 556 u32 fws0, fws1;
557 557
558 if (mwifiex_read_reg(adapter, CARD_FW_STATUS0_REG, &fws0)) 558 if (mwifiex_read_reg(adapter, CARD_FW_STATUS0_REG, &fws0))
559 return -1; 559 return -1;
@@ -574,7 +574,7 @@ mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat)
574 */ 574 */
575static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) 575static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter)
576{ 576{
577 u32 host_int_mask = 0; 577 u32 host_int_mask;
578 578
579 /* Read back the host_int_mask register */ 579 /* Read back the host_int_mask register */
580 if (mwifiex_read_reg(adapter, HOST_INT_MASK_REG, &host_int_mask)) 580 if (mwifiex_read_reg(adapter, HOST_INT_MASK_REG, &host_int_mask))
@@ -614,7 +614,7 @@ static int mwifiex_sdio_card_to_host(struct mwifiex_adapter *adapter,
614 u32 *type, u8 *buffer, 614 u32 *type, u8 *buffer,
615 u32 npayload, u32 ioport) 615 u32 npayload, u32 ioport)
616{ 616{
617 int ret = 0; 617 int ret;
618 u32 nb; 618 u32 nb;
619 619
620 if (!buffer) { 620 if (!buffer) {
@@ -652,14 +652,14 @@ static int mwifiex_sdio_card_to_host(struct mwifiex_adapter *adapter,
652static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter, 652static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
653 struct mwifiex_fw_image *fw) 653 struct mwifiex_fw_image *fw)
654{ 654{
655 int ret = 0; 655 int ret;
656 u8 *firmware = fw->fw_buf; 656 u8 *firmware = fw->fw_buf;
657 u32 firmware_len = fw->fw_len; 657 u32 firmware_len = fw->fw_len;
658 u32 offset = 0; 658 u32 offset = 0;
659 u32 base0, base1; 659 u32 base0, base1;
660 u8 *fwbuf; 660 u8 *fwbuf;
661 u16 len = 0; 661 u16 len = 0;
662 u32 txlen = 0, tx_blocks = 0, tries = 0; 662 u32 txlen, tx_blocks = 0, tries;
663 u32 i = 0; 663 u32 i = 0;
664 664
665 if (!firmware_len) { 665 if (!firmware_len) {
@@ -830,7 +830,7 @@ static int mwifiex_check_fw_status(struct mwifiex_adapter *adapter,
830static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter) 830static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
831{ 831{
832 struct sdio_mmc_card *card = adapter->card; 832 struct sdio_mmc_card *card = adapter->card;
833 u32 sdio_ireg = 0; 833 u32 sdio_ireg;
834 unsigned long flags; 834 unsigned long flags;
835 835
836 if (mwifiex_read_data_sync(adapter, card->mp_regs, MAX_MP_REGS, 836 if (mwifiex_read_data_sync(adapter, card->mp_regs, MAX_MP_REGS,
@@ -964,7 +964,7 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
964 s32 f_do_rx_cur = 0; 964 s32 f_do_rx_cur = 0;
965 s32 f_aggr_cur = 0; 965 s32 f_aggr_cur = 0;
966 struct sk_buff *skb_deaggr; 966 struct sk_buff *skb_deaggr;
967 u32 pind = 0; 967 u32 pind;
968 u32 pkt_len, pkt_type = 0; 968 u32 pkt_len, pkt_type = 0;
969 u8 *curr_ptr; 969 u8 *curr_ptr;
970 u32 rx_len = skb->len; 970 u32 rx_len = skb->len;
@@ -1114,7 +1114,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
1114 struct sdio_mmc_card *card = adapter->card; 1114 struct sdio_mmc_card *card = adapter->card;
1115 int ret = 0; 1115 int ret = 0;
1116 u8 sdio_ireg; 1116 u8 sdio_ireg;
1117 struct sk_buff *skb = NULL; 1117 struct sk_buff *skb;
1118 u8 port = CTRL_PORT; 1118 u8 port = CTRL_PORT;
1119 u32 len_reg_l, len_reg_u; 1119 u32 len_reg_l, len_reg_u;
1120 u32 rx_blocks; 1120 u32 rx_blocks;
@@ -1377,7 +1377,7 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
1377 struct mwifiex_tx_param *tx_param) 1377 struct mwifiex_tx_param *tx_param)
1378{ 1378{
1379 struct sdio_mmc_card *card = adapter->card; 1379 struct sdio_mmc_card *card = adapter->card;
1380 int ret = 0; 1380 int ret;
1381 u32 buf_block_len; 1381 u32 buf_block_len;
1382 u32 blk_size; 1382 u32 blk_size;
1383 u8 port = CTRL_PORT; 1383 u8 port = CTRL_PORT;
@@ -1560,7 +1560,7 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
1560{ 1560{
1561 struct sdio_mmc_card *card = adapter->card; 1561 struct sdio_mmc_card *card = adapter->card;
1562 int ret; 1562 int ret;
1563 u32 sdio_ireg = 0; 1563 u32 sdio_ireg;
1564 1564
1565 /* 1565 /*
1566 * Read the HOST_INT_STATUS_REG for ACK the first interrupt got 1566 * Read the HOST_INT_STATUS_REG for ACK the first interrupt got
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 33c8ba1f5e33..8af3a78d2723 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -274,8 +274,8 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv,
274static int mwifiex_cmd_tx_power_cfg(struct host_cmd_ds_command *cmd, 274static int mwifiex_cmd_tx_power_cfg(struct host_cmd_ds_command *cmd,
275 u16 cmd_action, void *data_buf) 275 u16 cmd_action, void *data_buf)
276{ 276{
277 struct mwifiex_types_power_group *pg_tlv = NULL; 277 struct mwifiex_types_power_group *pg_tlv;
278 struct host_cmd_ds_txpwr_cfg *txp = NULL; 278 struct host_cmd_ds_txpwr_cfg *txp;
279 struct host_cmd_ds_txpwr_cfg *cmd_txp_cfg = &cmd->params.txp_cfg; 279 struct host_cmd_ds_txpwr_cfg *cmd_txp_cfg = &cmd->params.txp_cfg;
280 280
281 cmd->command = cpu_to_le16(HostCmd_CMD_TXPWR_CFG); 281 cmd->command = cpu_to_le16(HostCmd_CMD_TXPWR_CFG);
@@ -478,7 +478,7 @@ mwifiex_set_keyparamset_wep(struct mwifiex_private *priv,
478 struct mwifiex_ie_type_key_param_set *key_param_set, 478 struct mwifiex_ie_type_key_param_set *key_param_set,
479 u16 *key_param_len) 479 u16 *key_param_len)
480{ 480{
481 int cur_key_param_len = 0; 481 int cur_key_param_len;
482 u8 i; 482 u8 i;
483 483
484 /* Multi-key_param_set TLV is supported */ 484 /* Multi-key_param_set TLV is supported */
@@ -1121,7 +1121,7 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
1121 */ 1121 */
1122int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) 1122int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
1123{ 1123{
1124 int ret = 0; 1124 int ret;
1125 u16 enable = true; 1125 u16 enable = true;
1126 struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl; 1126 struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1127 struct mwifiex_ds_auto_ds auto_ds; 1127 struct mwifiex_ds_auto_ds auto_ds;
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index 7f4f10b752fb..d08f76429a0a 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -43,7 +43,7 @@ static void
43mwifiex_process_cmdresp_error(struct mwifiex_private *priv, 43mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
44 struct host_cmd_ds_command *resp) 44 struct host_cmd_ds_command *resp)
45{ 45{
46 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL; 46 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node;
47 struct mwifiex_adapter *adapter = priv->adapter; 47 struct mwifiex_adapter *adapter = priv->adapter;
48 struct host_cmd_ds_802_11_ps_mode_enh *pm; 48 struct host_cmd_ds_802_11_ps_mode_enh *pm;
49 unsigned long flags; 49 unsigned long flags;
@@ -124,7 +124,7 @@ static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv,
124{ 124{
125 struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp = 125 struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp =
126 &resp->params.rssi_info_rsp; 126 &resp->params.rssi_info_rsp;
127 struct mwifiex_ds_get_signal *signal = NULL; 127 struct mwifiex_ds_get_signal *signal;
128 128
129 priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); 129 priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last);
130 priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); 130 priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last);
@@ -232,7 +232,7 @@ static int mwifiex_ret_get_log(struct mwifiex_private *priv,
232{ 232{
233 struct host_cmd_ds_802_11_get_log *get_log = 233 struct host_cmd_ds_802_11_get_log *get_log =
234 (struct host_cmd_ds_802_11_get_log *) &resp->params.get_log; 234 (struct host_cmd_ds_802_11_get_log *) &resp->params.get_log;
235 struct mwifiex_ds_get_stats *stats = NULL; 235 struct mwifiex_ds_get_stats *stats;
236 236
237 if (data_buf) { 237 if (data_buf) {
238 stats = (struct mwifiex_ds_get_stats *) data_buf; 238 stats = (struct mwifiex_ds_get_stats *) data_buf;
@@ -280,10 +280,10 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
280 struct host_cmd_ds_command *resp, 280 struct host_cmd_ds_command *resp,
281 void *data_buf) 281 void *data_buf)
282{ 282{
283 struct mwifiex_rate_cfg *ds_rate = NULL; 283 struct mwifiex_rate_cfg *ds_rate;
284 struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg; 284 struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg;
285 struct mwifiex_rate_scope *rate_scope; 285 struct mwifiex_rate_scope *rate_scope;
286 struct mwifiex_ie_types_header *head = NULL; 286 struct mwifiex_ie_types_header *head;
287 u16 tlv, tlv_buf_len; 287 u16 tlv, tlv_buf_len;
288 u8 *tlv_buf; 288 u8 *tlv_buf;
289 u32 i; 289 u32 i;
@@ -368,9 +368,9 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
368 */ 368 */
369static int mwifiex_get_power_level(struct mwifiex_private *priv, void *data_buf) 369static int mwifiex_get_power_level(struct mwifiex_private *priv, void *data_buf)
370{ 370{
371 int length = -1, max_power = -1, min_power = -1; 371 int length, max_power = -1, min_power = -1;
372 struct mwifiex_types_power_group *pg_tlv_hdr = NULL; 372 struct mwifiex_types_power_group *pg_tlv_hdr;
373 struct mwifiex_power_group *pg = NULL; 373 struct mwifiex_power_group *pg;
374 374
375 if (data_buf) { 375 if (data_buf) {
376 pg_tlv_hdr = 376 pg_tlv_hdr =
@@ -418,8 +418,8 @@ static int mwifiex_ret_tx_power_cfg(struct mwifiex_private *priv,
418{ 418{
419 struct mwifiex_adapter *adapter = priv->adapter; 419 struct mwifiex_adapter *adapter = priv->adapter;
420 struct host_cmd_ds_txpwr_cfg *txp_cfg = &resp->params.txp_cfg; 420 struct host_cmd_ds_txpwr_cfg *txp_cfg = &resp->params.txp_cfg;
421 struct mwifiex_types_power_group *pg_tlv_hdr = NULL; 421 struct mwifiex_types_power_group *pg_tlv_hdr;
422 struct mwifiex_power_group *pg = NULL; 422 struct mwifiex_power_group *pg;
423 u16 action = le16_to_cpu(txp_cfg->action); 423 u16 action = le16_to_cpu(txp_cfg->action);
424 424
425 switch (action) { 425 switch (action) {
@@ -593,7 +593,7 @@ static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv,
593 &resp->params.domain_info_resp; 593 &resp->params.domain_info_resp;
594 struct mwifiex_ietypes_domain_param_set *domain = &domain_info->domain; 594 struct mwifiex_ietypes_domain_param_set *domain = &domain_info->domain;
595 u16 action = le16_to_cpu(domain_info->action); 595 u16 action = le16_to_cpu(domain_info->action);
596 u8 no_of_triplet = 0; 596 u8 no_of_triplet;
597 597
598 no_of_triplet = (u8) ((le16_to_cpu(domain->header.len) - 598 no_of_triplet = (u8) ((le16_to_cpu(domain->header.len) -
599 IEEE80211_COUNTRY_STRING_LEN) / 599 IEEE80211_COUNTRY_STRING_LEN) /
@@ -661,7 +661,7 @@ static int mwifiex_ret_ver_ext(struct mwifiex_private *priv,
661 void *data_buf) 661 void *data_buf)
662{ 662{
663 struct host_cmd_ds_version_ext *ver_ext = &resp->params.verext; 663 struct host_cmd_ds_version_ext *ver_ext = &resp->params.verext;
664 struct host_cmd_ds_version_ext *version_ext = NULL; 664 struct host_cmd_ds_version_ext *version_ext;
665 665
666 if (data_buf) { 666 if (data_buf) {
667 version_ext = (struct host_cmd_ds_version_ext *)data_buf; 667 version_ext = (struct host_cmd_ds_version_ext *)data_buf;
@@ -682,8 +682,8 @@ static int mwifiex_ret_ver_ext(struct mwifiex_private *priv,
682static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp, 682static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp,
683 void *data_buf) 683 void *data_buf)
684{ 684{
685 struct mwifiex_ds_reg_rw *reg_rw = NULL; 685 struct mwifiex_ds_reg_rw *reg_rw;
686 struct mwifiex_ds_read_eeprom *eeprom = NULL; 686 struct mwifiex_ds_read_eeprom *eeprom;
687 687
688 if (data_buf) { 688 if (data_buf) {
689 reg_rw = (struct mwifiex_ds_reg_rw *) data_buf; 689 reg_rw = (struct mwifiex_ds_reg_rw *) data_buf;
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index e7adaab35226..4585c1bb9fa9 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -149,7 +149,7 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
149int mwifiex_bss_start(struct mwifiex_private *priv, 149int mwifiex_bss_start(struct mwifiex_private *priv,
150 struct mwifiex_ssid_bssid *ssid_bssid) 150 struct mwifiex_ssid_bssid *ssid_bssid)
151{ 151{
152 int ret = 0; 152 int ret;
153 struct mwifiex_adapter *adapter = priv->adapter; 153 struct mwifiex_adapter *adapter = priv->adapter;
154 s32 i = -1; 154 s32 i = -1;
155 155
@@ -376,7 +376,7 @@ int mwifiex_get_bss_info(struct mwifiex_private *priv,
376{ 376{
377 struct mwifiex_adapter *adapter = priv->adapter; 377 struct mwifiex_adapter *adapter = priv->adapter;
378 struct mwifiex_bssdescriptor *bss_desc; 378 struct mwifiex_bssdescriptor *bss_desc;
379 s32 tbl_idx = 0; 379 s32 tbl_idx;
380 380
381 if (!info) 381 if (!info)
382 return -1; 382 return -1;
@@ -436,9 +436,8 @@ int mwifiex_set_radio_band_cfg(struct mwifiex_private *priv,
436 struct mwifiex_ds_band_cfg *radio_cfg) 436 struct mwifiex_ds_band_cfg *radio_cfg)
437{ 437{
438 struct mwifiex_adapter *adapter = priv->adapter; 438 struct mwifiex_adapter *adapter = priv->adapter;
439 u8 infra_band = 0; 439 u8 infra_band, adhoc_band;
440 u8 adhoc_band = 0; 440 u32 adhoc_channel;
441 u32 adhoc_channel = 0;
442 441
443 infra_band = (u8) radio_cfg->config_bands; 442 infra_band = (u8) radio_cfg->config_bands;
444 adhoc_band = (u8) radio_cfg->adhoc_start_band; 443 adhoc_band = (u8) radio_cfg->adhoc_start_band;
@@ -636,7 +635,7 @@ int mwifiex_bss_ioctl_find_bss(struct mwifiex_private *priv,
636int 635int
637mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel) 636mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
638{ 637{
639 int ret = 0; 638 int ret;
640 struct mwifiex_bss_info bss_info; 639 struct mwifiex_bss_info bss_info;
641 struct mwifiex_ssid_bssid ssid_bssid; 640 struct mwifiex_ssid_bssid ssid_bssid;
642 u16 curr_chan = 0; 641 u16 curr_chan = 0;
@@ -755,11 +754,10 @@ static int mwifiex_rate_ioctl_set_rate_value(struct mwifiex_private *priv,
755 struct mwifiex_rate_cfg *rate_cfg) 754 struct mwifiex_rate_cfg *rate_cfg)
756{ 755{
757 u8 rates[MWIFIEX_SUPPORTED_RATES]; 756 u8 rates[MWIFIEX_SUPPORTED_RATES];
758 u8 *rate = NULL; 757 u8 *rate;
759 int rate_index = 0; 758 int rate_index, ret;
760 u16 bitmap_rates[MAX_BITMAP_RATES_SIZE]; 759 u16 bitmap_rates[MAX_BITMAP_RATES_SIZE];
761 u32 i = 0; 760 u32 i;
762 int ret = 0;
763 struct mwifiex_adapter *adapter = priv->adapter; 761 struct mwifiex_adapter *adapter = priv->adapter;
764 762
765 if (rate_cfg->is_rate_auto) { 763 if (rate_cfg->is_rate_auto) {
@@ -819,7 +817,7 @@ static int mwifiex_rate_ioctl_set_rate_value(struct mwifiex_private *priv,
819static int mwifiex_rate_ioctl_cfg(struct mwifiex_private *priv, 817static int mwifiex_rate_ioctl_cfg(struct mwifiex_private *priv,
820 struct mwifiex_rate_cfg *rate_cfg) 818 struct mwifiex_rate_cfg *rate_cfg)
821{ 819{
822 int status = 0; 820 int status;
823 821
824 if (!rate_cfg) 822 if (!rate_cfg)
825 return -1; 823 return -1;
@@ -841,7 +839,7 @@ static int mwifiex_rate_ioctl_cfg(struct mwifiex_private *priv,
841int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, 839int mwifiex_drv_get_data_rate(struct mwifiex_private *priv,
842 struct mwifiex_rate_cfg *rate) 840 struct mwifiex_rate_cfg *rate)
843{ 841{
844 int ret = 0; 842 int ret;
845 843
846 memset(rate, 0, sizeof(struct mwifiex_rate_cfg)); 844 memset(rate, 0, sizeof(struct mwifiex_rate_cfg));
847 rate->action = HostCmd_ACT_GEN_GET; 845 rate->action = HostCmd_ACT_GEN_GET;
@@ -875,11 +873,11 @@ int mwifiex_drv_get_data_rate(struct mwifiex_private *priv,
875int mwifiex_set_tx_power(struct mwifiex_private *priv, 873int mwifiex_set_tx_power(struct mwifiex_private *priv,
876 struct mwifiex_power_cfg *power_cfg) 874 struct mwifiex_power_cfg *power_cfg)
877{ 875{
878 int ret = 0; 876 int ret;
879 struct host_cmd_ds_txpwr_cfg *txp_cfg = NULL; 877 struct host_cmd_ds_txpwr_cfg *txp_cfg;
880 struct mwifiex_types_power_group *pg_tlv = NULL; 878 struct mwifiex_types_power_group *pg_tlv;
881 struct mwifiex_power_group *pg = NULL; 879 struct mwifiex_power_group *pg;
882 u8 *buf = NULL; 880 u8 *buf;
883 u16 dbm = 0; 881 u16 dbm = 0;
884 882
885 if (!power_cfg->is_power_auto) { 883 if (!power_cfg->is_power_auto) {
@@ -960,7 +958,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
960 */ 958 */
961int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode) 959int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode)
962{ 960{
963 int ret = 0; 961 int ret;
964 struct mwifiex_adapter *adapter = priv->adapter; 962 struct mwifiex_adapter *adapter = priv->adapter;
965 u16 sub_cmd; 963 u16 sub_cmd;
966 964
@@ -1078,8 +1076,8 @@ static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_private *priv,
1078static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv, 1076static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv,
1079 struct mwifiex_ds_encrypt_key *encrypt_key) 1077 struct mwifiex_ds_encrypt_key *encrypt_key)
1080{ 1078{
1081 int ret = 0; 1079 int ret;
1082 struct mwifiex_wep_key *wep_key = NULL; 1080 struct mwifiex_wep_key *wep_key;
1083 int index; 1081 int index;
1084 1082
1085 if (priv->wep_key_curr_index >= NUM_WEP_KEYS) 1083 if (priv->wep_key_curr_index >= NUM_WEP_KEYS)
@@ -1142,7 +1140,7 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv,
1142static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv, 1140static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv,
1143 struct mwifiex_ds_encrypt_key *encrypt_key) 1141 struct mwifiex_ds_encrypt_key *encrypt_key)
1144{ 1142{
1145 int ret = 0; 1143 int ret;
1146 u8 remove_key = false; 1144 u8 remove_key = false;
1147 struct host_cmd_ds_802_11_key_material *ibss_key; 1145 struct host_cmd_ds_802_11_key_material *ibss_key;
1148 1146
@@ -1209,7 +1207,7 @@ static int
1209mwifiex_sec_ioctl_encrypt_key(struct mwifiex_private *priv, 1207mwifiex_sec_ioctl_encrypt_key(struct mwifiex_private *priv,
1210 struct mwifiex_ds_encrypt_key *encrypt_key) 1208 struct mwifiex_ds_encrypt_key *encrypt_key)
1211{ 1209{
1212 int status = 0; 1210 int status;
1213 1211
1214 if (encrypt_key->is_wapi_key) 1212 if (encrypt_key->is_wapi_key)
1215 status = mwifiex_sec_ioctl_set_wapi_key(priv, encrypt_key); 1213 status = mwifiex_sec_ioctl_set_wapi_key(priv, encrypt_key);
@@ -1253,7 +1251,7 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv,
1253 struct mwifiex_ds_get_signal *signal) 1251 struct mwifiex_ds_get_signal *signal)
1254{ 1252{
1255 struct mwifiex_ds_get_signal info; 1253 struct mwifiex_ds_get_signal info;
1256 int status = 0; 1254 int status;
1257 1255
1258 memset(&info, 0, sizeof(struct mwifiex_ds_get_signal)); 1256 memset(&info, 0, sizeof(struct mwifiex_ds_get_signal));
1259 info.selector = ALL_RSSI_INFO_MASK; 1257 info.selector = ALL_RSSI_INFO_MASK;
@@ -1334,7 +1332,7 @@ int
1334mwifiex_get_stats_info(struct mwifiex_private *priv, 1332mwifiex_get_stats_info(struct mwifiex_private *priv,
1335 struct mwifiex_ds_get_stats *log) 1333 struct mwifiex_ds_get_stats *log)
1336{ 1334{
1337 int ret = 0; 1335 int ret;
1338 struct mwifiex_ds_get_stats get_log; 1336 struct mwifiex_ds_get_stats get_log;
1339 1337
1340 memset(&get_log, 0, sizeof(struct mwifiex_ds_get_stats)); 1338 memset(&get_log, 0, sizeof(struct mwifiex_ds_get_stats));
@@ -1425,7 +1423,7 @@ int
1425mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type, 1423mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type,
1426 u32 reg_offset, u32 *value) 1424 u32 reg_offset, u32 *value)
1427{ 1425{
1428 int ret = 0; 1426 int ret;
1429 struct mwifiex_ds_reg_rw reg_rw; 1427 struct mwifiex_ds_reg_rw reg_rw;
1430 1428
1431 reg_rw.type = cpu_to_le32(reg_type); 1429 reg_rw.type = cpu_to_le32(reg_type);
@@ -1451,7 +1449,7 @@ int
1451mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes, 1449mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes,
1452 u8 *value) 1450 u8 *value)
1453{ 1451{
1454 int ret = 0; 1452 int ret;
1455 struct mwifiex_ds_read_eeprom rd_eeprom; 1453 struct mwifiex_ds_read_eeprom rd_eeprom;
1456 1454
1457 rd_eeprom.offset = cpu_to_le16((u16) offset); 1455 rd_eeprom.offset = cpu_to_le16((u16) offset);
diff --git a/drivers/net/wireless/mwifiex/sta_rx.c b/drivers/net/wireless/mwifiex/sta_rx.c
index 8282679e64fd..e047f0d8a983 100644
--- a/drivers/net/wireless/mwifiex/sta_rx.c
+++ b/drivers/net/wireless/mwifiex/sta_rx.c
@@ -41,7 +41,7 @@
41int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter, 41int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
42 struct sk_buff *skb) 42 struct sk_buff *skb)
43{ 43{
44 int ret = 0; 44 int ret;
45 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); 45 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb);
46 struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; 46 struct mwifiex_private *priv = adapter->priv[rx_info->bss_index];
47 struct rx_packet_hdr *rx_pkt_hdr; 47 struct rx_packet_hdr *rx_pkt_hdr;
@@ -123,7 +123,7 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter,
123 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); 123 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb);
124 struct rx_packet_hdr *rx_pkt_hdr; 124 struct rx_packet_hdr *rx_pkt_hdr;
125 u8 ta[ETH_ALEN]; 125 u8 ta[ETH_ALEN];
126 u16 rx_pkt_type = 0; 126 u16 rx_pkt_type;
127 struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; 127 struct mwifiex_private *priv = adapter->priv[rx_info->bss_index];
128 128
129 local_rx_pd = (struct rxpd *) (skb->data); 129 local_rx_pd = (struct rxpd *) (skb->data);
diff --git a/drivers/net/wireless/mwifiex/sta_tx.c b/drivers/net/wireless/mwifiex/sta_tx.c
index 5d37ef160121..fa6221bc9104 100644
--- a/drivers/net/wireless/mwifiex/sta_tx.c
+++ b/drivers/net/wireless/mwifiex/sta_tx.c
@@ -113,8 +113,8 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags)
113/* sizeof(struct txpd) + Interface specific header */ 113/* sizeof(struct txpd) + Interface specific header */
114#define NULL_PACKET_HDR 64 114#define NULL_PACKET_HDR 64
115 u32 data_len = NULL_PACKET_HDR; 115 u32 data_len = NULL_PACKET_HDR;
116 struct sk_buff *skb = NULL; 116 struct sk_buff *skb;
117 int ret = 0; 117 int ret;
118 struct mwifiex_txinfo *tx_info = NULL; 118 struct mwifiex_txinfo *tx_info = NULL;
119 119
120 if (adapter->surprise_removed) 120 if (adapter->surprise_removed)
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c
index ce772e078db8..210120889dfe 100644
--- a/drivers/net/wireless/mwifiex/txrx.c
+++ b/drivers/net/wireless/mwifiex/txrx.c
@@ -68,7 +68,7 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
68{ 68{
69 int ret = -1; 69 int ret = -1;
70 struct mwifiex_adapter *adapter = priv->adapter; 70 struct mwifiex_adapter *adapter = priv->adapter;
71 u8 *head_ptr = NULL; 71 u8 *head_ptr;
72 struct txpd *local_tx_pd = NULL; 72 struct txpd *local_tx_pd = NULL;
73 73
74 head_ptr = (u8 *) mwifiex_process_sta_txpd(priv, skb); 74 head_ptr = (u8 *) mwifiex_process_sta_txpd(priv, skb);
@@ -121,8 +121,8 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
121int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, 121int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
122 struct sk_buff *skb, int status) 122 struct sk_buff *skb, int status)
123{ 123{
124 struct mwifiex_private *priv = NULL, *tpriv = NULL; 124 struct mwifiex_private *priv, *tpriv;
125 struct mwifiex_txinfo *tx_info = NULL; 125 struct mwifiex_txinfo *tx_info;
126 int i; 126 int i;
127 127
128 if (!skb) 128 if (!skb)
@@ -169,9 +169,9 @@ int mwifiex_recv_packet_complete(struct mwifiex_adapter *adapter,
169 struct sk_buff *skb, int status) 169 struct sk_buff *skb, int status)
170{ 170{
171 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); 171 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb);
172 struct mwifiex_rxinfo *rx_info_parent = NULL; 172 struct mwifiex_rxinfo *rx_info_parent;
173 struct mwifiex_private *priv; 173 struct mwifiex_private *priv;
174 struct sk_buff *skb_parent = NULL; 174 struct sk_buff *skb_parent;
175 unsigned long flags; 175 unsigned long flags;
176 176
177 priv = adapter->priv[rx_info->bss_index]; 177 priv = adapter->priv[rx_info->bss_index];
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c
index 7ab4fb279f8a..a8d53aa7e38d 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -152,8 +152,8 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv,
152 */ 152 */
153int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb) 153int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb)
154{ 154{
155 struct mwifiex_rxinfo *rx_info = NULL; 155 struct mwifiex_rxinfo *rx_info;
156 struct mwifiex_private *priv = NULL; 156 struct mwifiex_private *priv;
157 157
158 if (!skb) 158 if (!skb)
159 return -1; 159 return -1;
@@ -184,8 +184,8 @@ int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb)
184int mwifiex_recv_complete(struct mwifiex_adapter *adapter, 184int mwifiex_recv_complete(struct mwifiex_adapter *adapter,
185 struct sk_buff *skb, int status) 185 struct sk_buff *skb, int status)
186{ 186{
187 struct mwifiex_private *priv = NULL; 187 struct mwifiex_private *priv;
188 struct mwifiex_rxinfo *rx_info = NULL; 188 struct mwifiex_rxinfo *rx_info;
189 189
190 if (!skb) 190 if (!skb)
191 return 0; 191 return 0;
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index c009370f309e..faa09e32902e 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -799,7 +799,7 @@ u8
799mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv, 799mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv,
800 const struct sk_buff *skb) 800 const struct sk_buff *skb)
801{ 801{
802 u8 ret_val = 0; 802 u8 ret_val;
803 struct timeval out_tstamp, in_tstamp; 803 struct timeval out_tstamp, in_tstamp;
804 u32 queue_delay; 804 u32 queue_delay;
805 805