提交 a1c5ad81 编写于 作者: R Roland Vossen 提交者: Greg Kroah-Hartman

staging: brcm80211: replaced BCME_OK by 0

Code cleanup.
Signed-off-by: NRoland Vossen <rvossen@broadcom.com>
Reviewed-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 3b818080
......@@ -155,7 +155,7 @@ int sdioh_sdmmc_osinit(sdioh_info_t *sd)
sdos->sd = sd;
spin_lock_init(&sdos->lock);
return BCME_OK;
return 0;
}
void sdioh_sdmmc_osfree(sdioh_info_t *sd)
......
......@@ -902,7 +902,7 @@ wl_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
wl_show_host_event(event, event_data);
#endif /* SHOW_EVENTS */
return BCME_OK;
return 0;
}
/* Convert user's input in hex pattern to byte-size mask */
......
......@@ -2694,7 +2694,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
ASSERT(dhd != NULL);
bcmerror = wl_host_event(dhd, ifidx, pktdata, event, data);
if (bcmerror != BCME_OK)
if (bcmerror != 0)
return bcmerror;
#if defined(CONFIG_WIRELESS_EXT)
......
......@@ -558,7 +558,7 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
DHD_INFO(("CLKCTL: set PENDING\n"));
bus->clkstate = CLK_PENDING;
return BCME_OK;
return 0;
} else if (bus->clkstate == CLK_PENDING) {
/* Cancel CA-only interrupt filter */
devctl =
......@@ -634,7 +634,7 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
return BCME_ERROR;
}
}
return BCME_OK;
return 0;
}
/* Change idle/active SD state */
......@@ -721,7 +721,7 @@ static int dhdsdio_sdclk(dhd_bus_t *bus, bool on)
bus->clkstate = CLK_NONE;
}
return BCME_OK;
return 0;
}
/* Transition SD and backplane clock readiness */
......@@ -739,7 +739,7 @@ static int dhdsdio_clkctl(dhd_bus_t *bus, uint target, bool pendok)
dhd_os_wd_timer(bus->dhd, dhd_watchdog_ms);
bus->activity = true;
}
return BCME_OK;
return 0;
}
switch (target) {
......@@ -778,7 +778,7 @@ static int dhdsdio_clkctl(dhd_bus_t *bus, uint target, bool pendok)
DHD_INFO(("dhdsdio_clkctl: %d -> %d\n", oldstate, bus->clkstate));
#endif /* DHD_DEBUG */
return BCME_OK;
return 0;
}
int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
......@@ -793,7 +793,7 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
/* Done if we're already in the requested state */
if (sleep == bus->sleeping)
return BCME_OK;
return 0;
/* Going to sleep: set the alarm and turn off the lights... */
if (sleep) {
......@@ -865,7 +865,7 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
}
}
return BCME_OK;
return 0;
}
#if defined(OOB_INTR_ONLY)
......@@ -1115,7 +1115,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
ret = BCME_NORESOURCE;
} else {
ret = BCME_OK;
ret = 0;
}
dhd_os_sdunlock_txq(bus->dhd);
......@@ -1805,7 +1805,7 @@ static int dhdsdio_readshared(dhd_bus_t *bus, sdpcm_shared_t *sh)
return BCME_ERROR;
}
return BCME_OK;
return 0;
}
static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
......@@ -2020,7 +2020,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
/* Skip reading the console buffer if the index pointer
has not moved */
if (idx == c->last)
return BCME_OK;
return 0;
/* Read the console buffer */
addr = le32_to_cpu(c->log.buf);
......@@ -2058,13 +2058,13 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
}
break2:
return BCME_OK;
return 0;
}
#endif /* DHD_DEBUG */
int dhdsdio_downloadvars(dhd_bus_t *bus, void *arg, int len)
{
int bcmerror = BCME_OK;
int bcmerror = 0;
DHD_TRACE(("%s: Enter\n", __func__));
......@@ -2740,7 +2740,7 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
if (set && strcmp(name, "sd_divisor") == 0) {
if (bcmsdh_iovar_op(bus->sdh, "sd_divisor", NULL, 0,
&bus->sd_divisor, sizeof(s32),
false) != BCME_OK) {
false) != 0) {
bus->sd_divisor = -1;
DHD_ERROR(("%s: fail on %s get\n", __func__,
name));
......@@ -2753,7 +2753,7 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
if (set && strcmp(name, "sd_mode") == 0) {
if (bcmsdh_iovar_op(bus->sdh, "sd_mode", NULL, 0,
&bus->sd_mode, sizeof(s32),
false) != BCME_OK) {
false) != 0) {
bus->sd_mode = -1;
DHD_ERROR(("%s: fail on %s get\n", __func__,
name));
......@@ -2768,7 +2768,7 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
if (bcmsdh_iovar_op
(bus->sdh, "sd_blocksize", &fnum, sizeof(s32),
&bus->blocksize, sizeof(s32),
false) != BCME_OK) {
false) != 0) {
bus->blocksize = 0;
DHD_ERROR(("%s: fail on %s get\n", __func__,
"sd_blocksize"));
......@@ -5426,7 +5426,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
/* Query the SD clock speed */
if (bcmsdh_iovar_op(sdh, "sd_divisor", NULL, 0,
&bus->sd_divisor, sizeof(s32),
false) != BCME_OK) {
false) != 0) {
DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_divisor"));
bus->sd_divisor = -1;
} else {
......@@ -5436,7 +5436,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
/* Query the SD bus mode */
if (bcmsdh_iovar_op(sdh, "sd_mode", NULL, 0,
&bus->sd_mode, sizeof(s32), false) != BCME_OK) {
&bus->sd_mode, sizeof(s32), false) != 0) {
DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_mode"));
bus->sd_mode = -1;
} else {
......@@ -5447,7 +5447,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
/* Query the F2 block size, set roundup accordingly */
fnum = 2;
if (bcmsdh_iovar_op(sdh, "sd_blocksize", &fnum, sizeof(s32),
&bus->blocksize, sizeof(s32), false) != BCME_OK) {
&bus->blocksize, sizeof(s32), false) != 0) {
bus->blocksize = 0;
DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_blocksize"));
} else {
......@@ -5460,7 +5460,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
default to use if supported */
if (bcmsdh_iovar_op(sdh, "sd_rxchain", NULL, 0,
&bus->sd_rxchain, sizeof(s32),
false) != BCME_OK) {
false) != 0) {
bus->sd_rxchain = false;
} else {
DHD_INFO(("%s: bus module (through bcmsdh API) %s chaining\n",
......
......@@ -14892,10 +14892,10 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
}
if (wlc_phy_cal_txiqlo_nphy
(pi, target_gain, true, false) == BCME_OK) {
(pi, target_gain, true, false) == 0) {
if (wlc_phy_cal_rxiq_nphy
(pi, target_gain, 2,
false) == BCME_OK) {
false) == 0) {
wlc_phy_savecal_nphy(pi);
}
......@@ -22372,7 +22372,7 @@ wlc_phy_tx_tone_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
wlc_phy_runsamples_nphy(pi, num_samps, loops, wait, iqmode,
dac_test_mode, modify_bbmult);
return BCME_OK;
return 0;
}
static void
......@@ -23876,7 +23876,7 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
target_gain = pi->nphy_cal_target_gain;
}
if (BCME_OK ==
if (0 ==
wlc_phy_cal_txiqlo_nphy(pi, target_gain, fullcal, mphase)) {
if (PHY_IPA(pi))
wlc_phy_a4(pi, true);
......@@ -23888,7 +23888,7 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
wlapi_suspend_mac_and_wait(pi->sh->physhim);
wlc_phyreg_enter((wlc_phy_t *) pi);
if (BCME_OK == wlc_phy_cal_rxiq_nphy(pi, target_gain,
if (0 == wlc_phy_cal_rxiq_nphy(pi, target_gain,
(pi->
first_cal_after_assoc
|| (pi->
......@@ -23941,7 +23941,7 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
if (wlc_phy_cal_txiqlo_nphy
(pi, pi->nphy_cal_target_gain, fullcal,
true) != BCME_OK) {
true) != 0) {
wlc_phy_cal_perical_mphase_reset(pi);
break;
......@@ -23973,7 +23973,7 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
(pi->first_cal_after_assoc ||
(pi->cal_type_override ==
PHY_PERICAL_FULL)) ? 2 : 0,
false) == BCME_OK) {
false) == 0) {
wlc_phy_savecal_nphy(pi);
}
......@@ -24076,7 +24076,7 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain,
void *tbl_ptr;
bool ladder_updated[2];
u8 mphase_cal_lastphase = 0;
int bcmerror = BCME_OK;
int bcmerror = 0;
bool phyhang_avoid_state = false;
u16 tbl_tx_iqlo_cal_loft_ladder_20[] = {
......@@ -24202,13 +24202,13 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain,
if (pi->mphase_cal_phase_id > MPHASE_CAL_STATE_TXPHASE0) {
wlc_phy_runsamples_nphy(pi, phy_bw * 8, 0xffff, 0, 1, 0, false);
bcmerror = BCME_OK;
bcmerror = 0;
} else {
bcmerror =
wlc_phy_tx_tone_nphy(pi, tone_freq, max_val, 1, 0, false);
}
if (bcmerror == BCME_OK) {
if (bcmerror == 0) {
if (pi->mphase_cal_phase_id > MPHASE_CAL_STATE_TXPHASE0) {
tbl_ptr = pi->mphase_txcal_bestcoeffs;
......@@ -24529,7 +24529,7 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
u32 ii = 0, qq = 0;
s16 iq_nbits, qq_nbits, brsh, arsh;
s32 a, b, temp;
int bcmerror = BCME_OK;
int bcmerror = 0;
uint cal_retry = 0;
if (core_mask == 0x0)
......@@ -24628,7 +24628,7 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
}
}
if (bcmerror != BCME_OK) {
if (bcmerror != 0) {
printk("%s: Failed, cnt = %d\n", __func__, cal_retry);
if (cal_retry < CAL_RETRY_CNT) {
......@@ -25873,7 +25873,7 @@ wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, nphy_txgains_t target_gain,
wlc_phy_stay_in_carriersearch_nphy(pi, false);
return BCME_OK;
return 0;
}
static int
......@@ -25898,7 +25898,7 @@ wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, nphy_txgains_t target_gain,
u16 cal_gain[2];
nphy_iqcal_params_t cal_params[2];
u8 phy_bw;
int bcmerror = BCME_OK;
int bcmerror = 0;
bool first_playtone = true;
wlc_phy_stay_in_carriersearch_nphy(pi, true);
......@@ -26048,7 +26048,7 @@ wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, nphy_txgains_t target_gain,
0, 0, 0, true);
}
if (bcmerror == BCME_OK) {
if (bcmerror == 0) {
if (gain_pass < 3) {
wlc_phy_rx_iq_est_nphy(pi, est,
......@@ -26071,7 +26071,7 @@ wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, nphy_txgains_t target_gain,
wlc_phy_stopplayback_nphy(pi);
}
if (bcmerror != BCME_OK)
if (bcmerror != 0)
break;
}
......@@ -26087,7 +26087,7 @@ wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, nphy_txgains_t target_gain,
0xa7, orig_AfectrlCore);
write_phy_reg(pi, 0xa2, orig_RfseqCoreActv);
if (bcmerror != BCME_OK)
if (bcmerror != 0)
break;
}
......
......@@ -4040,7 +4040,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
~WSEC_PRIMARY_KEY;
key->flags |= WSEC_PRIMARY_KEY;
bsscfg->wsec_index = i;
bcmerror = BCME_OK;
bcmerror = 0;
}
}
break;
......@@ -4472,7 +4472,7 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
err = wlc_phy_txpower_get(wlc->band->pi, &qdbm,
&override);
if (err != BCME_OK)
if (err != 0)
return err;
/* Return qdbm units */
......@@ -7831,7 +7831,7 @@ int wlc_get_revision_info(struct wlc_info *wlc, void *buf, uint len)
rinfo->chippkg = wlc->pub->sih->chippkg;
}
return BCME_OK;
return 0;
}
void wlc_default_rateset(struct wlc_info *wlc, wlc_rateset_t *rs)
......@@ -8027,7 +8027,7 @@ wlc_duty_cycle_set(struct wlc_info *wlc, int duty_cycle, bool isOFDM,
else
wlc->tx_duty_cycle_cck = (u16) duty_cycle;
return BCME_OK;
return 0;
}
/* Read a single u16 from shared memory.
......
......@@ -225,7 +225,7 @@ static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask)
}
}
return BCME_OK;
return 0;
}
static int wlc_stf_spatial_policy_set(struct wlc_info *wlc, int val)
......@@ -241,7 +241,7 @@ static int wlc_stf_spatial_policy_set(struct wlc_info *wlc, int val)
wlc->stf->txchain : txcore_default[i];
wlc_stf_txcore_set(wlc, (u8) i, core_mask);
}
return BCME_OK;
return 0;
}
int wlc_stf_txchain_set(struct wlc_info *wlc, s32 int_val, bool force)
......@@ -251,7 +251,7 @@ int wlc_stf_txchain_set(struct wlc_info *wlc, s32 int_val, bool force)
uint i;
if (wlc->stf->txchain == txchain)
return BCME_OK;
return 0;
if ((txchain & ~wlc->stf->hw_txchain)
|| !(txchain & wlc->stf->hw_txchain))
......@@ -303,7 +303,7 @@ int wlc_stf_txchain_set(struct wlc_info *wlc, s32 int_val, bool force)
for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++)
wlc_stf_txcore_set(wlc, (u8) i, txcore_default[i]);
return BCME_OK;
return 0;
}
/* update wlc->stf->ss_opmode which represents the operational stf_ss mode we're using */
......@@ -371,7 +371,7 @@ void wlc_stf_detach(struct wlc_info *wlc)
int wlc_stf_ant_txant_validate(struct wlc_info *wlc, s8 val)
{
int bcmerror = BCME_OK;
int bcmerror = 0;
/* when there is only 1 tx_streams, don't allow to change the txant */
if (WLCISNPHY(wlc->band) && (wlc->stf->txstreams == 1))
......@@ -395,7 +395,7 @@ int wlc_stf_ant_txant_validate(struct wlc_info *wlc, s8 val)
break;
}
if (bcmerror == BCME_OK)
if (bcmerror == 0)
wlc->stf->txant = (s8) val;
return bcmerror;
......
......@@ -251,7 +251,6 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
* update osl files with os specific errorcode map
*/
#define BCME_OK 0 /* Success */
#define BCME_ERROR -1 /* Error generic */
#define BCME_BADARG -2 /* Bad Argument */
#define BCME_NOTUP -4 /* Not up */
......
......@@ -98,7 +98,7 @@ int nvram_append(void *si, char *varlst, uint varsz)
new->next = vars;
vars = new;
return BCME_OK;
return 0;
}
void nvram_exit(void *si)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册