Skip to content

Commit

Permalink
staging: brcm80211: use static qualifier for local symbols in brcmsmac
Browse files Browse the repository at this point in the history
Cleanup resulted in merging several files and made several symbols
local to a source file. These were found by running sparse as it
gave the warning: symbol 'foo' was not declared. Should it be static?

Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent 4f80f93 commit 1143142
Show file tree
Hide file tree
Showing 13 changed files with 168 additions and 162 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/brcm80211/brcmsmac/aiutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ static void ai_hwfixup(struct si_info *sii)
}

/* parse the enumeration rom to identify all cores */
void ai_scan(struct si_pub *sih, struct chipcregs *cc)
static void ai_scan(struct si_pub *sih, struct chipcregs *cc)
{
struct si_info *sii = SI_INFO(sih);
u32 erombase, *eromptr, *eromlim;
Expand Down Expand Up @@ -2057,12 +2057,12 @@ void ai_chipcontrl_epa4331(struct si_pub *sih, bool on)
if (sih->chippkg == 9 || sih->chippkg == 0xb)
/* Ext PA Controls for 4331 12x9 Package */
W_REG(&cc->chipcontrol, val |
(CCTRL4331_EXTPA_EN |
CCTRL4331_EXTPA_ON_GPIO2_5));
CCTRL4331_EXTPA_EN |
CCTRL4331_EXTPA_ON_GPIO2_5);
else
/* Ext PA Controls for 4331 12x12 Package */
W_REG(&cc->chipcontrol,
val | (CCTRL4331_EXTPA_EN));
val | CCTRL4331_EXTPA_EN);
} else {
val &= ~(CCTRL4331_EXTPA_EN | CCTRL4331_EXTPA_ON_GPIO2_5);
W_REG(&cc->chipcontrol, val);
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/brcm80211/brcmsmac/antsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@
#define ANT_SELCFG_NUM_2x4 4
#define ANT_SELCFG_DEF_2x4 0x02 /* default antenna configuration */

const u16 mimo_2x4_div_antselpat_tbl[] = {
static const u16 mimo_2x4_div_antselpat_tbl[] = {
0, 0, 0x9, 0xa, /* ant0: 0 ant1: 2,3 */
0, 0, 0x5, 0x6, /* ant0: 1 ant1: 2,3 */
0, 0, 0, 0, /* n.a. */
0, 0, 0, 0 /* n.a. */
};

const u8 mimo_2x4_div_antselid_tbl[16] = {
static const u8 mimo_2x4_div_antselid_tbl[16] = {
0, 0, 0, 0, 0, 2, 3, 0,
0, 0, 1, 0, 0, 0, 0, 0 /* pat to antselid */
};

const u16 mimo_2x3_div_antselpat_tbl[] = {
static const u16 mimo_2x3_div_antselpat_tbl[] = {
16, 0, 1, 16, /* ant0: 0 ant1: 1,2 */
16, 16, 16, 16, /* n.a. */
16, 2, 16, 16, /* ant0: 2 ant1: 1 */
16, 16, 16, 16 /* n.a. */
};

const u8 mimo_2x3_div_antselid_tbl[16] = {
static const u8 mimo_2x3_div_antselid_tbl[16] = {
0, 1, 2, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 /* pat to antselid */
};
Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/brcm80211/brcmsmac/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ static bool _dma_descriptor_align(struct dma_info *di)
return true;
}

void *dma_alloc_consistent(struct pci_dev *pdev, uint size, u16 align_bits,
uint *alloced, dma_addr_t *pap)
static void *dma_alloc_consistent(struct pci_dev *pdev, uint size,
u16 align_bits, uint *alloced,
dma_addr_t *pap)
{
if (align_bits) {
u16 align = (1 << align_bits);
Expand Down
64 changes: 33 additions & 31 deletions drivers/staging/brcm80211/brcmsmac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
return wlc->macintstatus != 0;
}

int brcms_b_state_get(struct brcms_hardware *wlc_hw,
static int brcms_b_state_get(struct brcms_hardware *wlc_hw,
struct brcms_b_state *state)
{
state->machwcap = wlc_hw->machwcap;
Expand Down Expand Up @@ -904,7 +904,7 @@ static void brcms_b_info_init(struct brcms_hardware *wlc_hw)
wlc_hw->chanspec = CH20MHZ_CHSPEC(1);
}

void brcms_b_wait_for_wake(struct brcms_hardware *wlc_hw)
static void brcms_b_wait_for_wake(struct brcms_hardware *wlc_hw)
{
/* delay before first read of ucode state */
udelay(40);
Expand All @@ -914,7 +914,7 @@ void brcms_b_wait_for_wake(struct brcms_hardware *wlc_hw)
DBGST_ASLEEP), wlc_hw->wlc->fastpwrup_dly);
}

void brcms_b_hw_etheraddr(struct brcms_hardware *wlc_hw, u8 *ea)
static void brcms_b_hw_etheraddr(struct brcms_hardware *wlc_hw, u8 *ea)
{
memcpy(ea, wlc_hw->etheraddr, ETH_ALEN);
}
Expand Down Expand Up @@ -1186,7 +1186,7 @@ static void brcms_c_ucode_mute_override_clear(struct brcms_hardware *wlc_hw)
/*
* Write a MAC address to the given match reg offset in the RXE match engine.
*/
void
static void
brcms_b_set_addrmatch(struct brcms_hardware *wlc_hw, int match_reg_offset,
const u8 *addr)
{
Expand Down Expand Up @@ -1244,7 +1244,7 @@ brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset, int len,
}
}

void brcms_b_set_cwmin(struct brcms_hardware *wlc_hw, u16 newmin)
static void brcms_b_set_cwmin(struct brcms_hardware *wlc_hw, u16 newmin)
{
wlc_hw->band->CWmin = newmin;

Expand All @@ -1253,7 +1253,7 @@ void brcms_b_set_cwmin(struct brcms_hardware *wlc_hw, u16 newmin)
W_REG(&wlc_hw->regs->objdata, newmin);
}

void brcms_b_set_cwmax(struct brcms_hardware *wlc_hw, u16 newmax)
static void brcms_b_set_cwmax(struct brcms_hardware *wlc_hw, u16 newmax)
{
wlc_hw->band->CWmax = newmax;

Expand Down Expand Up @@ -1684,7 +1684,7 @@ static void brcms_b_xtal(struct brcms_hardware *wlc_hw, bool want)
* this function could be called when driver is down and w/o clock
* it operates on different registers depending on corerev and boardflag.
*/
bool brcms_b_radio_read_hwdisabled(struct brcms_hardware *wlc_hw)
static bool brcms_b_radio_read_hwdisabled(struct brcms_hardware *wlc_hw)
{
bool v, clk, xtal;
u32 resetbits = 0, flags = 0;
Expand Down Expand Up @@ -2051,7 +2051,7 @@ void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw, u8 antsel_type)
wlc_phy_antsel_type_set(wlc_hw->band->pi, antsel_type);
}

void brcms_b_fifoerrors(struct brcms_hardware *wlc_hw)
static void brcms_b_fifoerrors(struct brcms_hardware *wlc_hw)
{
bool fatal = false;
uint unit;
Expand Down Expand Up @@ -2755,7 +2755,7 @@ brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset, void *buf,
}
}

void brcms_b_copyfrom_vars(struct brcms_hardware *wlc_hw, char **buf,
static void brcms_b_copyfrom_vars(struct brcms_hardware *wlc_hw, char **buf,
uint *len)
{
BCMMSG(wlc_hw->wlc->wiphy, "nvram vars totlen=%d\n",
Expand All @@ -2765,7 +2765,8 @@ void brcms_b_copyfrom_vars(struct brcms_hardware *wlc_hw, char **buf,
*len = wlc_hw->vars_size;
}

void brcms_b_retrylimit_upd(struct brcms_hardware *wlc_hw, u16 SRL, u16 LRL)
static void brcms_b_retrylimit_upd(struct brcms_hardware *wlc_hw,
u16 SRL, u16 LRL)
{
wlc_hw->SRL = SRL;
wlc_hw->LRL = LRL;
Expand All @@ -2783,7 +2784,7 @@ void brcms_b_retrylimit_upd(struct brcms_hardware *wlc_hw, u16 SRL, u16 LRL)
}
}

void brcms_b_pllreq(struct brcms_hardware *wlc_hw, bool set, u32 req_bit)
static void brcms_b_pllreq(struct brcms_hardware *wlc_hw, bool set, u32 req_bit)
{
if (set) {
if (mboolisset(wlc_hw->pllreq, req_bit))
Expand All @@ -2810,7 +2811,7 @@ void brcms_b_pllreq(struct brcms_hardware *wlc_hw, bool set, u32 req_bit)
return;
}

void brcms_b_antsel_set(struct brcms_hardware *wlc_hw, u32 antsel_avail)
static void brcms_b_antsel_set(struct brcms_hardware *wlc_hw, u32 antsel_avail)
{
wlc_hw->antsel_avail = antsel_avail;
}
Expand Down Expand Up @@ -2850,7 +2851,7 @@ bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
return true;
}

void brcms_b_reset(struct brcms_hardware *wlc_hw)
static void brcms_b_reset(struct brcms_hardware *wlc_hw)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);

Expand Down Expand Up @@ -2899,7 +2900,7 @@ static u16 brcms_c_init_chanspec(struct brcms_c_info *wlc)
return chanspec;
}

struct scb global_scb;
static struct scb global_scb;

static void brcms_c_init_scb(struct brcms_c_info *wlc, struct scb *scb)
{
Expand Down Expand Up @@ -3092,7 +3093,7 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
}

void
brcms_b_init(struct brcms_hardware *wlc_hw, u16 chanspec,
static brcms_b_init(struct brcms_hardware *wlc_hw, u16 chanspec,
bool mute) {
u32 macintmask;
bool fastclk;
Expand Down Expand Up @@ -3581,7 +3582,7 @@ void brcms_c_set_bssid(struct brcms_bss_cfg *cfg)
brcms_c_set_addrmatch(wlc, RCM_BSSID_OFFSET, cfg->BSSID);
}

void brcms_b_set_shortslot(struct brcms_hardware *wlc_hw, bool shortslot)
static void brcms_b_set_shortslot(struct brcms_hardware *wlc_hw, bool shortslot)
{
wlc_hw->shortslot = shortslot;

Expand Down Expand Up @@ -4151,7 +4152,7 @@ static void brcms_c_radio_timer(void *arg)
}

/* common low-level watchdog code */
void brcms_b_watchdog(void *arg)
static void brcms_b_watchdog(void *arg)
{
struct brcms_c_info *wlc = (struct brcms_c_info *) arg;
struct brcms_hardware *wlc_hw = wlc->hw;
Expand Down Expand Up @@ -4399,8 +4400,9 @@ struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc)
* initialize software state for each core and band
* put the whole chip in reset(driver down state), no clock
*/
int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
bool piomode, void *regsva, struct pci_dev *btparam)
static int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device,
uint unit, bool piomode, void *regsva,
struct pci_dev *btparam)
{
struct brcms_hardware *wlc_hw;
struct d11regs *regs;
Expand Down Expand Up @@ -5209,7 +5211,7 @@ static void brcms_c_detach_module(struct brcms_c_info *wlc)
/*
* low level detach
*/
int brcms_b_detach(struct brcms_c_info *wlc)
static int brcms_b_detach(struct brcms_c_info *wlc)
{
uint i;
struct brcms_hw_band *band;
Expand Down Expand Up @@ -5380,7 +5382,7 @@ void brcms_c_radio_mpc_upd(struct brcms_c_info *wlc)
wlc->prev_non_delay_mpc = brcms_c_is_non_delay_mpc(wlc);
}
/* Initialize just the hardware when coming out of POR or S3/S5 system states */
void brcms_b_hw_up(struct brcms_hardware *wlc_hw)
static void brcms_b_hw_up(struct brcms_hardware *wlc_hw)
{
if (wlc_hw->wlc->pub->hw_up)
return;
Expand Down Expand Up @@ -5424,7 +5426,7 @@ void brcms_b_hw_up(struct brcms_hardware *wlc_hw)
}
}

int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
{
uint coremask;

Expand Down Expand Up @@ -5466,7 +5468,7 @@ int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
return 0;
}

int brcms_b_up_finish(struct brcms_hardware *wlc_hw)
static int brcms_b_up_finish(struct brcms_hardware *wlc_hw)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);

Expand Down Expand Up @@ -5611,7 +5613,7 @@ static uint brcms_c_down_del_timer(struct brcms_c_info *wlc)
return callbacks;
}

int brcms_b_bmac_down_prep(struct brcms_hardware *wlc_hw)
static int brcms_b_bmac_down_prep(struct brcms_hardware *wlc_hw)
{
bool dev_gone;
uint callbacks = 0;
Expand Down Expand Up @@ -5639,7 +5641,7 @@ int brcms_b_bmac_down_prep(struct brcms_hardware *wlc_hw)
return callbacks;
}

int brcms_b_down_finish(struct brcms_hardware *wlc_hw)
static int brcms_b_down_finish(struct brcms_hardware *wlc_hw)
{
uint callbacks = 0;
bool dev_gone;
Expand Down Expand Up @@ -6644,7 +6646,7 @@ static u16 brcms_c_rate_shm_offset(struct brcms_c_info *wlc, u8 rate)
*
* Returns true if packet consumed (queued), false if not.
*/
bool brcms_c_prec_enq(struct brcms_c_info *wlc, struct pktq *q,
static bool brcms_c_prec_enq(struct brcms_c_info *wlc, struct pktq *q,
struct sk_buff *pkt, int prec)
{
return brcms_c_prec_enq_head(wlc, q, pkt, prec, false);
Expand Down Expand Up @@ -8284,7 +8286,7 @@ void brcms_c_bcn_li_upd(struct brcms_c_info *wlc)
(wlc->bcn_li_dtim << 8) | wlc->bcn_li_bcn);
}

void
static void
brcms_b_read_tsf(struct brcms_hardware *wlc_hw, u32 *tsf_l_ptr,
u32 *tsf_h_ptr)
{
Expand Down Expand Up @@ -9033,7 +9035,7 @@ int brcms_c_get_header_len()
}

/* mac is assumed to be suspended at this point */
void
static void
brcms_b_write_hw_bcntemplates(struct brcms_hardware *wlc_hw, u16 bcn[],
int len, bool both)
{
Expand All @@ -9053,8 +9055,8 @@ brcms_b_write_hw_bcntemplates(struct brcms_hardware *wlc_hw, u16 bcn[],
}
}

void brcms_c_write_hw_bcntemplates(struct brcms_c_info *wlc, u16 bcn[], int len,
bool both)
static void brcms_c_write_hw_bcntemplates(struct brcms_c_info *wlc, u16 bcn[],
int len, bool both)
{
brcms_b_write_hw_bcntemplates(wlc->hw, bcn, len, both);
}
Expand Down Expand Up @@ -9297,7 +9299,7 @@ void brcms_c_mhf(struct brcms_c_info *wlc, u8 idx, u16 mask, u16 val, int bands)
brcms_b_mhf(wlc->hw, idx, mask, val, bands);
}

int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
static int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
uint *blocks)
{
if (fifo >= NFIFO)
Expand Down
7 changes: 4 additions & 3 deletions drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,8 @@ wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
}

uint
wlc_phy_init_radio_regs(struct brcms_phy *pi, struct radio_regs *radioregs,
wlc_phy_init_radio_regs(struct brcms_phy *pi,
const struct radio_regs *radioregs,
u16 core_offset)
{
uint i = 0;
Expand Down Expand Up @@ -1724,7 +1725,7 @@ void wlc_phy_txpower_recalc_target(struct brcms_phy *pi)
(*txpwr_recalc_fn)(pi);
}

void
static void
wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr,
u16 chanspec)
{
Expand Down Expand Up @@ -2539,7 +2540,7 @@ void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *pih)
wlc_phy_noise_sample_request(pih, PHY_NOISE_SAMPLE_EXTERNAL, channel);
}

s8 lcnphy_gain_index_offset_for_pkt_rssi[] = {
static const s8 lcnphy_gain_index_offset_for_pkt_rssi[] = {
8,
8,
8,
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ extern void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
extern uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
struct radio_20xx_regs *radioregs);
extern uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
struct radio_regs *radioregs,
const struct radio_regs *radioregs,
u16 core_offset);

extern void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ struct lcnphy_radio_regs lcnphy_radio_regs_2064[] = {
#define LCNPHY_NUM_DIG_FILT_COEFFS 16
#define LCNPHY_NUM_TX_DIG_FILTERS_CCK 13

u16 LCNPHY_txdigfiltcoeffs_cck[LCNPHY_NUM_TX_DIG_FILTERS_CCK]
static const u16 LCNPHY_txdigfiltcoeffs_cck[LCNPHY_NUM_TX_DIG_FILTERS_CCK]
[LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
{0, 1, 415, 1874, 64, 128, 64, 792, 1656, 64, 128, 64, 778, 1582, 64,
128, 64,},
Expand Down Expand Up @@ -909,7 +909,7 @@ u16 LCNPHY_txdigfiltcoeffs_cck[LCNPHY_NUM_TX_DIG_FILTERS_CCK]
};

#define LCNPHY_NUM_TX_DIG_FILTERS_OFDM 3
u16 LCNPHY_txdigfiltcoeffs_ofdm[LCNPHY_NUM_TX_DIG_FILTERS_OFDM]
static const u16 LCNPHY_txdigfiltcoeffs_ofdm[LCNPHY_NUM_TX_DIG_FILTERS_OFDM]
[LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
{0, 0, 0xa2, 0x0, 0x100, 0x100, 0x0, 0x0, 0x0, 0x100, 0x0, 0x0,
0x278, 0xfea0, 0x80, 0x100, 0x80,},
Expand Down
Loading

0 comments on commit 1143142

Please sign in to comment.