staging: brcm80211: cleaned up softmac phy macro's affecting code flow
authorRoland Vossen <rvossen@broadcom.com>
Fri, 2 Sep 2011 14:00:33 +0000 (16:00 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 23:46:27 +0000 (16:46 -0700)
Substituted macro's.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
drivers/staging/brcm80211/brcmsmac/types.h

index b52b30589c1a8c5e7939d42adc096422fb5210b1..5f30de20f6da2ef56ccdea71312ebedd2ee102c2 100644 (file)
@@ -204,7 +204,8 @@ u16 read_radio_reg(struct brcms_phy *pi, u16 addr)
 
        switch (pi->pubpi.phy_type) {
        case PHY_TYPE_N:
-               CASECHECK(PHYTYPE, PHY_TYPE_N);
+               if (!CONF_HAS(PHYTYPE, PHY_TYPE_N))
+                       break;
                if (NREV_GE(pi->pubpi.phy_rev, 7))
                        addr |= RADIO_2057_READ_OFF;
                else
@@ -212,7 +213,8 @@ u16 read_radio_reg(struct brcms_phy *pi, u16 addr)
                break;
 
        case PHY_TYPE_LCN:
-               CASECHECK(PHYTYPE, PHY_TYPE_LCN);
+               if (!CONF_HAS(PHYTYPE, PHY_TYPE_LCN))
+                       break;
                addr |= RADIO_2064_READ_OFF;
                break;
 
index cf65f6e7522f2c4b18afd0735976c4fb8a1dc6b9..792df0793642368ab52851bf50193564b6053044 100644 (file)
 #define PHYTYPE_IS(var, val)\
        (PHYCONF_HAS(val) && (PHYCONF_IS(val) || ((var) == (val))))
 
-/* Finally, early-exit from switch case if anyone wants it... */
-
-#define CASECHECK(config, val) if (!(CONF_HAS(config, val))) break
-#define CASEMSK(config, mask)  if (!(CONF_MSK(config, mask))) break
-
 /* Set up PHYTYPE automatically: (depends on PHY_TYPE_X, from d11.h) */
 
 #define _PHYCONF_N (1 << PHY_TYPE_N)