Commit dfa26436 authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: remove redundant CHIPID macro



The CHIPID macro simply expands to the macro argument so it is
redundant and as such removed.

Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 92246bcb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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 */
+9 −9
Original line number Diff line number Diff line
@@ -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;
@@ -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);
@@ -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);
@@ -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);

@@ -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;
+26 −26
Original line number Diff line number Diff line
@@ -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);
	}
@@ -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);
	}
@@ -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 |
@@ -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;
@@ -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) {
@@ -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;
				}
@@ -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;
@@ -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)) {
@@ -19082,8 +19082,8 @@ 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);
@@ -19091,9 +19091,9 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
			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) {
@@ -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);
		}
@@ -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;
@@ -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;
			}
@@ -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)
@@ -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 <<
+12 −12
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ 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),
					__func__, wlc_hw->sih->chip,
					CHIPREV(wlc_hw->sih->chiprev));

		WLCNTINCR(wlc->pub->_cnt->psmwds);
@@ -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
@@ -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);
@@ -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);
@@ -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)))
@@ -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);
+4 −4
Original line number Diff line number Diff line
@@ -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);
@@ -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,
@@ -6427,7 +6427,7 @@ 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),
					__func__, wlc->pub->sih->chip,
					CHIPREV(wlc->pub->sih->chiprev));

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