diff options
author | Yogesh Ashok Powar <yogeshp@marvell.com> | 2011-05-03 23:11:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-05 14:59:16 -0400 |
commit | 270e58e8898c8be40451ebee45b6c9b5bd5db04b (patch) | |
tree | 4dd71a0e18a3f5528af59fcaebc61d98377792e5 /drivers/net/wireless/mwifiex/cfg80211.c | |
parent | 57f16b5da03784d1660133fbec7281ea5735da69 (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>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfg80211.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 77a80296b6c..0c0116374d7 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) | |||
77 | static int | 77 | static int |
78 | mwifiex_is_alg_wep(u32 cipher) | 78 | mwifiex_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, | |||
408 | static int | 405 | static int |
409 | mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr) | 406 | mwifiex_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 | |||
449 | mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) | 446 | mwifiex_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 = { | |||
1247 | int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac, | 1242 | int 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); |