brcmfmac: simplify if-else condition in brcmf_cfg80211_escan()
authorArend van Spriel <arend@broadcom.com>
Tue, 6 Nov 2012 00:22:10 +0000 (16:22 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 14 Nov 2012 19:55:42 +0000 (14:55 -0500)
Code flow was:
err = foo();
if (!err)
return err;
else
goto exit;
return 0;

Changed it to just to exit label if err is non-zero.

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

index 9da9d05e1dfbcb190c26d58d04645d9c09d9ab68..f05ab77db574b0336e07821dd4cd1ff3735e6daa 100644 (file)
@@ -966,9 +966,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct net_device *ndev,
        set_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
        if (escan_req) {
                err = brcmf_do_escan(cfg, wiphy, ndev, request);
-               if (!err)
-                       return err;
-               else
+               if (err)
                        goto scan_out;
        } else {
                WL_SCAN("ssid \"%s\", ssid_len (%d)\n",