]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
mac80211: a few code cleanups
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 17 Apr 2008 17:21:22 +0000 (19:21 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 May 2008 19:02:11 +0000 (15:02 -0400)
This has some code cleanups (some inspired by checkpatch), I got
bored at probably a third of the output though so if somebody
else wants to...

Signed-off-by: Johannes Berg <johannes@sipsolutions.net
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/aes_ccm.c
net/mac80211/aes_ccm.h
net/mac80211/debugfs_netdev.c
net/mac80211/ieee80211_i.h
net/mac80211/iface.c
net/mac80211/main.c
net/mac80211/mlme.c
net/mac80211/tkip.h
net/mac80211/wep.h

index 59f1691f62c89abcfef52f4b2bbc3156cb4c1062..4d4c2dfcf9a0340b9225531576136fd1df595c41 100644 (file)
@@ -134,7 +134,7 @@ int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch,
 }
 
 
-struct crypto_cipher * ieee80211_aes_key_setup_encrypt(const u8 key[])
+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[])
 {
        struct crypto_cipher *tfm;
 
index 885f19030b29ba1260fab169a7db8cf73c0973f5..8cd0f14aab4d8adf8156c47ebefe55d965412006 100644 (file)
@@ -14,7 +14,7 @@
 
 #define AES_BLOCK_LEN 16
 
-struct crypto_cipher * ieee80211_aes_key_setup_encrypt(const u8 key[]);
+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[]);
 void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch,
                               u8 *b_0, u8 *aad, u8 *data, size_t data_len,
                               u8 *cdata, u8 *mic);
index e3326d046944129d0b8f872591b27006cfb3f95f..3ae5493d728b40c47075dae75581a7c9c41c4c8b 100644 (file)
@@ -528,7 +528,7 @@ void ieee80211_debugfs_change_if_type(struct ieee80211_sub_if_data *sdata,
        add_files(sdata);
 }
 
-static int netdev_notify(struct notifier_block * nb,
+static int netdev_notify(struct notifier_block *nb,
                         unsigned long state,
                         void *ndev)
 {
index c7314bf4bec2c9ac4e45e3837a2ce024e21a59d2..a05e1db36993888a7c064bbafcbd02aed6e2c872 100644 (file)
@@ -919,9 +919,9 @@ ieee80211_rx_result ieee80211_sta_rx_scan(
 void ieee80211_rx_bss_list_init(struct net_device *dev);
 void ieee80211_rx_bss_list_deinit(struct net_device *dev);
 int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len);
-struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev,
-                                        struct sk_buff *skb, u8 *bssid,
-                                        u8 *addr);
+struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev,
+                                       struct sk_buff *skb, u8 *bssid,
+                                       u8 *addr);
 int ieee80211_sta_deauthenticate(struct net_device *dev, u16 reason);
 int ieee80211_sta_disassociate(struct net_device *dev, u16 reason);
 void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
index 80954a512185ca66ab65bbc087bce1b8f3a0b743..f41c7e0de622cd14cd65ca5cd3f3f6f975189888 100644 (file)
@@ -33,9 +33,8 @@ static void ieee80211_if_sdata_deinit(struct ieee80211_sub_if_data *sdata)
 {
        int i;
 
-       for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) {
+       for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++)
                __skb_queue_purge(&sdata->fragments[i].skb_list);
-       }
 }
 
 /* Must be called with rtnl lock held. */
index 9ad4e3631b6bd4b5ac012f53457abcaa41e2ec47..e19be27a3deffeda1dc395cc8a097b101dd1e4d4 100644 (file)
@@ -385,8 +385,8 @@ static int ieee80211_open(struct net_device *dev)
         * yet be effective. Trigger execution of ieee80211_sta_work
         * to fix this.
         */
-       if(sdata->vif.type == IEEE80211_IF_TYPE_STA ||
-          sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
+       if (sdata->vif.type == IEEE80211_IF_TYPE_STA ||
+           sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
                struct ieee80211_if_sta *ifsta = &sdata->u.sta;
                queue_work(local->hw.workqueue, &ifsta->work);
        }
@@ -1482,7 +1482,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
                return;
        }
 
-       rthdr = (struct ieee80211_tx_status_rtap_hdr*)
+       rthdr = (struct ieee80211_tx_status_rtap_hdr *)
                                skb_push(skb, sizeof(*rthdr));
 
        memset(rthdr, 0, sizeof(*rthdr));
index a5e5c31c23abf3d23bca0d0ce9186e1776249215..de09f58d9683f08d94870b313b0b18c319280e57 100644 (file)
@@ -306,28 +306,24 @@ static void ieee80211_sta_wmm_params(struct net_device *dev,
                switch (aci) {
                case 1:
                        queue = IEEE80211_TX_QUEUE_DATA3;
-                       if (acm) {
+                       if (acm)
                                local->wmm_acm |= BIT(0) | BIT(3);
-                       }
                        break;
                case 2:
                        queue = IEEE80211_TX_QUEUE_DATA1;
-                       if (acm) {
+                       if (acm)
                                local->wmm_acm |= BIT(4) | BIT(5);
-                       }
                        break;
                case 3:
                        queue = IEEE80211_TX_QUEUE_DATA0;
-                       if (acm) {
+                       if (acm)
                                local->wmm_acm |= BIT(6) | BIT(7);
-                       }
                        break;
                case 0:
                default:
                        queue = IEEE80211_TX_QUEUE_DATA2;
-                       if (acm) {
+                       if (acm)
                                local->wmm_acm |= BIT(1) | BIT(2);
-                       }
                        break;
                }
 
@@ -706,9 +702,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
        if (bss) {
                if (bss->capability & WLAN_CAPABILITY_PRIVACY)
                        capab |= WLAN_CAPABILITY_PRIVACY;
-               if (bss->wmm_ie) {
+               if (bss->wmm_ie)
                        wmm = 1;
-               }
                ieee80211_rx_bss_put(dev, bss);
        }
 
@@ -1805,9 +1800,8 @@ static void ieee80211_rx_mgmt_deauth(struct net_device *dev,
               " (reason=%d)\n",
               dev->name, print_mac(mac, mgmt->sa), reason_code);
 
-       if (ifsta->flags & IEEE80211_STA_AUTHENTICATED) {
+       if (ifsta->flags & IEEE80211_STA_AUTHENTICATED)
                printk(KERN_DEBUG "%s: deauthenticated\n", dev->name);
-       }
 
        if (ifsta->state == IEEE80211_AUTHENTICATE ||
            ifsta->state == IEEE80211_ASSOCIATE ||
@@ -3517,10 +3511,12 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
        bss->beacon_int = local->hw.conf.beacon_int;
        bss->last_update = jiffies;
        bss->capability = WLAN_CAPABILITY_IBSS;
-       if (sdata->default_key) {
+
+       if (sdata->default_key)
                bss->capability |= WLAN_CAPABILITY_PRIVACY;
-       else
+       else
                sdata->drop_unencrypted = 0;
+
        bss->supp_rates_len = sband->n_bitrates;
        pos = bss->supp_rates;
        for (i = 0; i < sband->n_bitrates; i++) {
@@ -4203,6 +4199,7 @@ int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len)
 {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        struct ieee80211_if_sta *ifsta = &sdata->u.sta;
+
        kfree(ifsta->extra_ie);
        if (len == 0) {
                ifsta->extra_ie = NULL;
@@ -4220,9 +4217,9 @@ int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len)
 }
 
 
-struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev,
-                                        struct sk_buff *skb, u8 *bssid,
-                                        u8 *addr)
+struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev,
+                                       struct sk_buff *skb, u8 *bssid,
+                                       u8 *addr)
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct sta_info *sta;
index b7c2ee763d9d5d03562c3e73ad8710ff46480e00..1fa0bb4dba3c7e7d2a6cfcca92f0e68aad6de0fe 100644 (file)
@@ -13,8 +13,8 @@
 #include <linux/crypto.h>
 #include "key.h"
 
-u8 * ieee80211_tkip_add_iv(u8 *pos, struct ieee80211_key *key,
-                          u8 iv0, u8 iv1, u8 iv2);
+u8 *ieee80211_tkip_add_iv(u8 *pos, struct ieee80211_key *key,
+                         u8 iv0, u8 iv1, u8 iv2);
 void ieee80211_tkip_gen_phase1key(struct ieee80211_key *key, u8 *ta,
                                  u16 *phase1key);
 void ieee80211_tkip_gen_rc4key(struct ieee80211_key *key, u8 *ta,
index 363779c5065897ef39b72532e0d467424f0e6b17..e587172115b8397acc0ce4f92d401e5b288101a4 100644 (file)
@@ -26,7 +26,7 @@ int ieee80211_wep_encrypt(struct ieee80211_local *local, struct sk_buff *skb,
                          struct ieee80211_key *key);
 int ieee80211_wep_decrypt(struct ieee80211_local *local, struct sk_buff *skb,
                          struct ieee80211_key *key);
-u8 * ieee80211_wep_is_weak_iv(struct sk_buff *skb, struct ieee80211_key *key);
+u8 *ieee80211_wep_is_weak_iv(struct sk_buff *skb, struct ieee80211_key *key);
 
 ieee80211_rx_result
 ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx);