brcmfmac: Cleanup function brcmf_notifiy_connect_status_ap.
authorHante Meuleman <meuleman@broadcom.com>
Wed, 6 Feb 2013 17:40:43 +0000 (18:40 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 8 Feb 2013 19:51:33 +0000 (14:51 -0500)
Clean up function, removing some unnecessary code and
initialisation.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c

index 0f170cb83c548d990fc43150888a2e213764a4ae..544257a527790d380bece6738562694a53635967 100644 (file)
@@ -3994,38 +3994,32 @@ brcmf_notify_connect_status_ap(struct brcmf_cfg80211_info *cfg,
                               struct net_device *ndev,
                               const struct brcmf_event_msg *e, void *data)
 {
-       s32 err = 0;
+       static int generation;
        u32 event = e->event_code;
        u32 reason = e->reason;
-       u32 len = e->datalen;
-       static int generation;
-
        struct station_info sinfo;
 
        brcmf_dbg(CONN, "event %d, reason %d\n", event, reason);
-       memset(&sinfo, 0, sizeof(sinfo));
 
-       sinfo.filled = 0;
        if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) &&
-           reason == BRCMF_E_STATUS_SUCCESS) {
+           (reason == BRCMF_E_STATUS_SUCCESS)) {
+               memset(&sinfo, 0, sizeof(sinfo));
                sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
                if (!data) {
                        brcmf_err("No IEs present in ASSOC/REASSOC_IND");
                        return -EINVAL;
                }
                sinfo.assoc_req_ies = data;
-               sinfo.assoc_req_ies_len = len;
+               sinfo.assoc_req_ies_len = e->datalen;
                generation++;
                sinfo.generation = generation;
-               cfg80211_new_sta(ndev, e->addr, &sinfo, GFP_ATOMIC);
+               cfg80211_new_sta(ndev, e->addr, &sinfo, GFP_KERNEL);
        } else if ((event == BRCMF_E_DISASSOC_IND) ||
                   (event == BRCMF_E_DEAUTH_IND) ||
                   (event == BRCMF_E_DEAUTH)) {
-               generation++;
-               sinfo.generation = generation;
-               cfg80211_del_sta(ndev, e->addr, GFP_ATOMIC);
+               cfg80211_del_sta(ndev, e->addr, GFP_KERNEL);
        }
-       return err;
+       return 0;
 }
 
 static s32