Skip to content

Commit

Permalink
staging: brcm80211: remove redundant CHIPID macro
Browse files Browse the repository at this point in the history
The CHIPID macro simply expands to the macro argument so it is
redundant and as such removed.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Dec 2, 2010
1 parent 92246bc commit dfa2643
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 111 deletions.
1 change: 0 additions & 1 deletion drivers/staging/brcm80211/include/bcmdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#define SPI_BUS 6 /* gSPI target */
#define RPC_BUS 7 /* RPC target */

#define CHIPID(chip) (chip)
#define CHIPREV(rev) (rev)

/* Defines for DMA Address Width - Shared between OSL and HNDDMA */
Expand Down
18 changes: 9 additions & 9 deletions drivers/staging/brcm80211/phy/wlc_phy_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,8 @@ wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
pi->tbl_data_hi = tblDataHi;
pi->tbl_data_lo = tblDataLo;

if ((CHIPID(pi->sh->chip) == BCM43224_CHIP_ID ||
CHIPID(pi->sh->chip) == BCM43421_CHIP_ID) &&
if ((pi->sh->chip == BCM43224_CHIP_ID ||
pi->sh->chip == BCM43421_CHIP_ID) &&
(pi->sh->chiprev == 1)) {
pi->tbl_addr = tblAddr;
pi->tbl_save_id = tbl_id;
Expand All @@ -1098,8 +1098,8 @@ void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val)
{
ASSERT((width == 8) || (width == 16) || (width == 32));

if ((CHIPID(pi->sh->chip) == BCM43224_CHIP_ID ||
CHIPID(pi->sh->chip) == BCM43421_CHIP_ID) &&
if ((pi->sh->chip == BCM43224_CHIP_ID ||
pi->sh->chip == BCM43421_CHIP_ID) &&
(pi->sh->chiprev == 1) &&
(pi->tbl_save_id == NPHY_TBL_ID_ANTSWCTRLLUT)) {
read_phy_reg(pi, pi->tbl_data_lo);
Expand Down Expand Up @@ -1137,8 +1137,8 @@ wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,

for (idx = 0; idx < ptbl_info->tbl_len; idx++) {

if ((CHIPID(pi->sh->chip) == BCM43224_CHIP_ID ||
CHIPID(pi->sh->chip) == BCM43421_CHIP_ID) &&
if ((pi->sh->chip == BCM43224_CHIP_ID ||
pi->sh->chip == BCM43421_CHIP_ID) &&
(pi->sh->chiprev == 1) &&
(tbl_id == NPHY_TBL_ID_ANTSWCTRLLUT)) {
read_phy_reg(pi, tblDataLo);
Expand Down Expand Up @@ -1180,8 +1180,8 @@ wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,

for (idx = 0; idx < ptbl_info->tbl_len; idx++) {

if ((CHIPID(pi->sh->chip) == BCM43224_CHIP_ID ||
CHIPID(pi->sh->chip) == BCM43421_CHIP_ID) &&
if ((pi->sh->chip == BCM43224_CHIP_ID ||
pi->sh->chip == BCM43421_CHIP_ID) &&
(pi->sh->chiprev == 1)) {
(void)read_phy_reg(pi, tblDataLo);

Expand Down Expand Up @@ -3330,7 +3330,7 @@ const u8 *wlc_phy_get_ofdm_rate_lookup(void)

void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode)
{
if ((CHIPID(pi->sh->chip) == BCM4313_CHIP_ID) &&
if ((pi->sh->chip == BCM4313_CHIP_ID) &&
(pi->sh->boardflags & BFL_FEM)) {
if (mode) {
u16 txant = 0;
Expand Down
52 changes: 26 additions & 26 deletions drivers/staging/brcm80211/phy/wlc_phy_n.c
Original file line number Diff line number Diff line change
Expand Up @@ -14559,7 +14559,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
}
}

if ((!PHY_IPA(pi)) && (CHIPID(pi->sh->chip) == BCM5357_CHIP_ID)) {
if ((!PHY_IPA(pi)) && (pi->sh->chip == BCM5357_CHIP_ID)) {
si_pmu_chipcontrol(pi->sh->sih, 1, CCTRL5357_EXTPA,
CCTRL5357_EXTPA);
}
Expand Down Expand Up @@ -17604,7 +17604,7 @@ static void wlc_phy_radio_postinit_2057(phy_info_t *pi)

mod_radio_reg(pi, RADIO_2057_XTALPUOVR_PINCTRL, 0x1, 0x1);

if (CHIPID(pi->sh->chip) == !BCM6362_CHIP_ID) {
if (pi->sh->chip == !BCM6362_CHIP_ID) {

mod_radio_reg(pi, RADIO_2057_XTALPUOVR_PINCTRL, 0x2, 0x2);
}
Expand Down Expand Up @@ -18012,8 +18012,8 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 |
RADIO_2056_SYN, 0x1f);

if ((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) ||
(CHIPID(pi->sh->chip) == BCM47162_CHIP_ID)) {
if ((pi->sh->chip == BCM4716_CHIP_ID) ||
(pi->sh->chip == BCM47162_CHIP_ID)) {

write_radio_reg(pi,
RADIO_2056_SYN_PLL_LOOPFILTER4 |
Expand Down Expand Up @@ -18075,8 +18075,8 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
WRITE_RADIO_REG2(pi, RADIO_2056, TX, core,
PADG_IDAC, 0xcc);

if ((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) ||
(CHIPID(pi->sh->chip) ==
if ((pi->sh->chip == BCM4716_CHIP_ID) ||
(pi->sh->chip ==
BCM47162_CHIP_ID)) {
bias = 0x40;
cascbias = 0x45;
Expand All @@ -18088,11 +18088,11 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
bias = 0x25;
cascbias = 0x20;

if ((CHIPID(pi->sh->chip) ==
if ((pi->sh->chip ==
BCM43224_CHIP_ID)
|| (CHIPID(pi->sh->chip) ==
|| (pi->sh->chip ==
BCM43225_CHIP_ID)
|| (CHIPID(pi->sh->chip) ==
|| (pi->sh->chip ==
BCM43421_CHIP_ID)) {
if (pi->sh->chippkg ==
BCM43224_FAB_SMIC) {
Expand Down Expand Up @@ -18203,9 +18203,9 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,

cascbias = 0x30;

if ((CHIPID(pi->sh->chip) == BCM43224_CHIP_ID) ||
(CHIPID(pi->sh->chip) == BCM43225_CHIP_ID) ||
(CHIPID(pi->sh->chip) == BCM43421_CHIP_ID)) {
if ((pi->sh->chip == BCM43224_CHIP_ID) ||
(pi->sh->chip == BCM43225_CHIP_ID) ||
(pi->sh->chip == BCM43421_CHIP_ID)) {
if (pi->sh->chippkg == BCM43224_FAB_SMIC) {
cascbias = 0x35;
}
Expand Down Expand Up @@ -18932,7 +18932,7 @@ static void wlc_phy_spurwar_nphy(phy_info_t *pi)
case 38:
case 102:
case 118:
if ((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) &&
if ((pi->sh->chip == BCM4716_CHIP_ID) &&
(pi->sh->chippkg == BCM4717_PKG_ID)) {
nphy_adj_tone_id_buf[0] = 32;
nphy_adj_noise_var_buf[0] = 0x21f;
Expand Down Expand Up @@ -19067,7 +19067,7 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
if (pi->nphy_aband_spurwar_en &&
((val == 38) || (val == 102)
|| (val == 118))) {
if ((CHIPID(pi->sh->chip) ==
if ((pi->sh->chip ==
BCM4716_CHIP_ID)
&& (pi->sh->chippkg ==
BCM4717_PKG_ID)) {
Expand All @@ -19082,18 +19082,18 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
if (pi->phy_spuravoid == SPURAVOID_FORCEON)
spuravoid = 1;

if ((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) ||
(CHIPID(pi->sh->chip) == BCM47162_CHIP_ID)) {
if ((pi->sh->chip == BCM4716_CHIP_ID) ||
(pi->sh->chip == BCM47162_CHIP_ID)) {
si_pmu_spuravoid(pi->sh->sih, pi->sh->osh, spuravoid);
} else {
wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false);
si_pmu_spuravoid(pi->sh->sih, pi->sh->osh, spuravoid);
wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true);
}

if ((CHIPID(pi->sh->chip) == BCM43224_CHIP_ID) ||
(CHIPID(pi->sh->chip) == BCM43225_CHIP_ID) ||
(CHIPID(pi->sh->chip) == BCM43421_CHIP_ID)) {
if ((pi->sh->chip == BCM43224_CHIP_ID) ||
(pi->sh->chip == BCM43225_CHIP_ID) ||
(pi->sh->chip == BCM43421_CHIP_ID)) {

if (spuravoid == 1) {

Expand All @@ -19110,8 +19110,8 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
}
}

if (!((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) ||
(CHIPID(pi->sh->chip) == BCM47162_CHIP_ID))) {
if (!((pi->sh->chip == BCM4716_CHIP_ID) ||
(pi->sh->chip == BCM47162_CHIP_ID))) {
wlapi_bmac_core_phypll_reset(pi->sh->physhim);
}

Expand Down Expand Up @@ -21067,11 +21067,11 @@ s16 wlc_phy_tempsense_nphy(phy_info_t *pi)
wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x03, 16,
&auxADC_rssi_ctrlH_save);

if (CHIPID(pi->sh->chip) == BCM5357_CHIP_ID) {
if (pi->sh->chip == BCM5357_CHIP_ID) {
radio_temp[0] = (193 * (radio_temp[1] + radio_temp2[1])
+ 88 * (auxADC_Vl) - 27111 +
128) / 256;
} else if (CHIPID(pi->sh->chip) == BCM43236_CHIP_ID) {
} else if (pi->sh->chip == BCM43236_CHIP_ID) {
radio_temp[0] = (198 * (radio_temp[1] + radio_temp2[1])
+ 91 * (auxADC_Vl) - 27243 +
128) / 256;
Expand Down Expand Up @@ -26282,7 +26282,7 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi)
} else if (NREV_IS(pi->pubpi.phy_rev, 6)) {

tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev6;
if (CHIPID(pi->sh->chip) == BCM47162_CHIP_ID) {
if (pi->sh->chip == BCM47162_CHIP_ID) {

tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev5;
}
Expand Down Expand Up @@ -26838,7 +26838,7 @@ wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *txgains,
phy_a2 = 63;

if (CHSPEC_IS2G(pi->radio_chanspec)) {
if (CHIPID(pi->sh->chip) == BCM6362_CHIP_ID) {
if (pi->sh->chip == BCM6362_CHIP_ID) {
phy_a1 = 35;
phy_a3 = 35;
} else if ((pi->pubpi.radiorev == 4)
Expand Down Expand Up @@ -26951,7 +26951,7 @@ wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *txgains,
if (NREV_GE(pi->pubpi.phy_rev, 6)) {
phy_a5 = 0x00f7 | (phy_a4 << 8);

if (CHIPID(pi->sh->chip) ==
if (pi->sh->chip ==
BCM47162_CHIP_ID) {
phy_a5 =
0x10f7 | (phy_a4 <<
Expand Down
24 changes: 12 additions & 12 deletions drivers/staging/brcm80211/sys/wlc_bmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ bool BCMFASTPATH wlc_dpc(wlc_info_t *wlc, bool bounded)
WL_ERROR(("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n", wlc_hw->unit, wlc_hw->now));

printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n",
__func__, CHIPID(wlc_hw->sih->chip),
CHIPREV(wlc_hw->sih->chiprev));
__func__, wlc_hw->sih->chip,
CHIPREV(wlc_hw->sih->chiprev));

WLCNTINCR(wlc->pub->_cnt->psmwds);

Expand Down Expand Up @@ -842,7 +842,7 @@ int wlc_bmac_attach(wlc_info_t *wlc, u16 vendor, u16 device, uint unit,
} else
wlc_hw->_nbands = 1;

if ((CHIPID(wlc_hw->sih->chip) == BCM43225_CHIP_ID))
if ((wlc_hw->sih->chip == BCM43225_CHIP_ID))
wlc_hw->_nbands = 1;

/* BMAC_NOTE: remove init of pub values when wlc_attach() unconditionally does the
Expand Down Expand Up @@ -2224,9 +2224,9 @@ bool wlc_bmac_radio_read_hwdisabled(wlc_hw_info_t *wlc_hw)
flags |= SICF_PCLKE;

/* AI chip doesn't restore bar0win2 on hibernation/resume, need sw fixup */
if ((CHIPID(wlc_hw->sih->chip) == BCM43224_CHIP_ID) ||
(CHIPID(wlc_hw->sih->chip) == BCM43225_CHIP_ID) ||
(CHIPID(wlc_hw->sih->chip) == BCM43421_CHIP_ID))
if ((wlc_hw->sih->chip == BCM43224_CHIP_ID) ||
(wlc_hw->sih->chip == BCM43225_CHIP_ID) ||
(wlc_hw->sih->chip == BCM43421_CHIP_ID))
wlc_hw->regs =
(d11regs_t *) si_setcore(wlc_hw->sih, D11_CORE_ID,
0);
Expand Down Expand Up @@ -2266,9 +2266,9 @@ void wlc_bmac_hw_up(wlc_hw_info_t *wlc_hw)
si_pci_fixcfg(wlc_hw->sih);

/* AI chip doesn't restore bar0win2 on hibernation/resume, need sw fixup */
if ((CHIPID(wlc_hw->sih->chip) == BCM43224_CHIP_ID) ||
(CHIPID(wlc_hw->sih->chip) == BCM43225_CHIP_ID) ||
(CHIPID(wlc_hw->sih->chip) == BCM43421_CHIP_ID))
if ((wlc_hw->sih->chip == BCM43224_CHIP_ID) ||
(wlc_hw->sih->chip == BCM43225_CHIP_ID) ||
(wlc_hw->sih->chip == BCM43421_CHIP_ID))
wlc_hw->regs =
(d11regs_t *) si_setcore(wlc_hw->sih, D11_CORE_ID,
0);
Expand All @@ -2281,7 +2281,7 @@ void wlc_bmac_hw_up(wlc_hw_info_t *wlc_hw)
wlc_hw->wlc->pub->hw_up = true;

if ((wlc_hw->boardflags & BFL_FEM)
&& (CHIPID(wlc_hw->sih->chip) == BCM4313_CHIP_ID)) {
&& (wlc_hw->sih->chip == BCM4313_CHIP_ID)) {
if (!
(wlc_hw->boardrev >= 0x1250
&& (wlc_hw->boardflags & BFL_FEM_BT)))
Expand Down Expand Up @@ -2689,8 +2689,8 @@ void wlc_bmac_switch_macfreq(wlc_hw_info_t *wlc_hw, u8 spurmode)
regs = wlc_hw->regs;
osh = wlc_hw->osh;

if ((CHIPID(wlc_hw->sih->chip) == BCM43224_CHIP_ID) ||
(CHIPID(wlc_hw->sih->chip) == BCM43225_CHIP_ID)) {
if ((wlc_hw->sih->chip == BCM43224_CHIP_ID) ||
(wlc_hw->sih->chip == BCM43225_CHIP_ID)) {
if (spurmode == WL_SPURAVOID_ON2) { /* 126Mhz */
W_REG(osh, &regs->tsf_clk_frac_l, 0x2082);
W_REG(osh, &regs->tsf_clk_frac_h, 0x8);
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/brcm80211/sys/wlc_mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
wlc_radio_mpc_upd(wlc);

if (WLANTSEL_ENAB(wlc)) {
if ((CHIPID(wlc->pub->sih->chip)) == BCM43235_CHIP_ID) {
if ((wlc->pub->sih->chip) == BCM43235_CHIP_ID) {
if ((getintvar(wlc->pub->vars, "aa2g") == 7) ||
(getintvar(wlc->pub->vars, "aa5g") == 7)) {
wlc_bmac_antsel_set(wlc->hw, 1);
Expand Down Expand Up @@ -2537,7 +2537,7 @@ int wlc_up(wlc_info_t *wlc)
}

if ((wlc->pub->boardflags & BFL_FEM)
&& (CHIPID(wlc->pub->sih->chip) == BCM4313_CHIP_ID)) {
&& (wlc->pub->sih->chip == BCM4313_CHIP_ID)) {
if (wlc->pub->boardrev >= 0x1250
&& (wlc->pub->boardflags & BFL_FEM_BT)) {
wlc_mhf(wlc, MHF5, MHF5_4313_GPIOCTRL,
Expand Down Expand Up @@ -6427,8 +6427,8 @@ void wlc_high_dpc(wlc_info_t *wlc, u32 macintstatus)
WL_ERROR(("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n", wlc->pub->unit, wlc->pub->now));

printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n",
__func__, CHIPID(wlc->pub->sih->chip),
CHIPREV(wlc->pub->sih->chiprev));
__func__, wlc->pub->sih->chip,
CHIPREV(wlc->pub->sih->chiprev));

WLCNTINCR(wlc->pub->_cnt->psmwds);

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/util/aiutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <pcicfg.h>
#include <bcmdevs.h>

#define BCM47162_DMP() ((CHIPID(sih->chip) == BCM47162_CHIP_ID) && \
#define BCM47162_DMP() ((sih->chip == BCM47162_CHIP_ID) && \
(CHIPREV(sih->chiprev) == 0) && \
(sii->coreid[sii->curidx] == MIPS74K_CORE_ID))

Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/brcm80211/util/bcmotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int ipxotp_max_rgnsz(si_t *sih, int osizew)
{
int ret = 0;

switch (CHIPID(sih->chip)) {
switch (sih->chip) {
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
ret = osizew * 2 - OTP_SZ_FU_72 - OTP_SZ_CHECKSUM;
Expand Down Expand Up @@ -273,8 +273,8 @@ static void _ipxotp_init(otpinfo_t *oi, chipcregs_t *cc)
/* Read OTP lock bits and subregion programmed indication bits */
oi->status = R_REG(oi->osh, &cc->otpstatus);

if ((CHIPID(oi->sih->chip) == BCM43224_CHIP_ID)
|| (CHIPID(oi->sih->chip) == BCM43225_CHIP_ID)) {
if ((oi->sih->chip == BCM43224_CHIP_ID)
|| (oi->sih->chip == BCM43225_CHIP_ID)) {
u32 p_bits;
p_bits =
(ipxotp_otpr(oi, cc, oi->otpgu_base + OTPGU_P_OFF) &
Expand Down
Loading

0 comments on commit dfa2643

Please sign in to comment.