linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: gregkh@suse.de
Cc: "Roland Vossen" <rvossen@broadcom.com>,
	devel@linuxdriverproject.org, linux-wireless@vger.kernel.org,
	"Brett Rudley" <brudley@broadcom.com>,
	"Henry Ptasinski" <henryp@broadcom.com>
Subject: [PATCH 24/61] staging: brcm80211: delete ASSERTs in 4 files in brcmsmac dir
Date: Tue, 3 May 2011 11:35:24 +0200	[thread overview]
Message-ID: <1304415361-7813-25-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1304415361-7813-1-git-send-email-arend@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

wlc_antsel.c, wlc_channel.c, wlc_rate.c and wlc_stf.c are now
ASSERT free.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/wlc_antsel.c  |    3 ---
 drivers/staging/brcm80211/brcmsmac/wlc_channel.c |   18 ++----------------
 drivers/staging/brcm80211/brcmsmac/wlc_rate.c    |    6 ++----
 drivers/staging/brcm80211/brcmsmac/wlc_stf.c     |   19 ++-----------------
 4 files changed, 6 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_antsel.c b/drivers/staging/brcm80211/brcmsmac/wlc_antsel.c
index 0121ce3..89346fe 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_antsel.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_antsel.c
@@ -130,7 +130,6 @@ struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc)
 				asi->antsel_avail = false;
 				wiphy_err(wlc->wiphy, "wlc_antsel_attach: 2o3 "
 					  "board cfg invalid\n");
-				ASSERT(0);
 			}
 			break;
 		default:
@@ -298,8 +297,6 @@ static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
 	u8 ant_cfg;
 	u16 mimo_antsel;
 
-	ASSERT(asi->antsel_type != ANTSEL_NA);
-
 	/* 1) Update TX antconfig for all frames that are not unicast data
 	 *    (aka default TX)
 	 */
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_channel.c b/drivers/staging/brcm80211/brcmsmac/wlc_channel.c
index ec55ea5..345c197 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_channel.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_channel.c
@@ -594,8 +594,7 @@ struct chan20_info chan20_info[] = {
 static const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
 {
 	if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) {
-		ASSERT(locale_idx < ARRAY_SIZE(g_locale_2g_table));
-		return NULL;
+		return NULL; /* error condition */
 	}
 	return g_locale_2g_table[locale_idx];
 }
@@ -603,8 +602,7 @@ static const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
 static const locale_info_t *wlc_get_locale_5g(u8 locale_idx)
 {
 	if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) {
-		ASSERT(locale_idx < ARRAY_SIZE(g_locale_5g_table));
-		return NULL;
+		return NULL; /* error condition */
 	}
 	return g_locale_5g_table[locale_idx];
 }
@@ -656,8 +654,6 @@ wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc)
 	strncpy(country_abbrev, "X2", sizeof(country_abbrev) - 1);
 	country = wlc_country_lookup(wlc, country_abbrev);
 
-	ASSERT(country != NULL);
-
 	/* save default country for exiting 11d regulatory mode */
 	strncpy(wlc->country_default, country_abbrev, WLC_CNTRY_BUF_SZ - 1);
 
@@ -708,7 +704,6 @@ wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
 					&mapped_regrev);
 	} else {
 		/* find the matching built-in country definition */
-		ASSERT(0);
 		country = wlc_country_lookup_direct(ccode, regrev);
 		strncpy(mapped_ccode, ccode, WLC_CNTRY_BUF_SZ);
 		mapped_regrev = regrev;
@@ -738,8 +733,6 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
 	struct wlc_info *wlc = wlc_cm->wlc;
 	char prev_country_abbrev[WLC_CNTRY_BUF_SZ];
 
-	ASSERT(country != NULL);
-
 	/* save current country state */
 	wlc_cm->country = country;
 
@@ -824,7 +817,6 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
 		*mapped_regrev = srom_regrev;
 		mapped = 0;
 		wiphy_err(wlc->wiphy, "srom_code == ccode %s\n", __func__);
-		ASSERT(0);
 	} else {
 		mapped =
 		    wlc_country_aggregate_map(wlc_cm, ccode, mapped_ccode,
@@ -837,7 +829,6 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
 	/* if there is not an exact rev match, default to rev zero */
 	if (country == NULL && *mapped_regrev != 0) {
 		*mapped_regrev = 0;
-		ASSERT(0);
 		country =
 		    wlc_country_lookup_direct(mapped_ccode, *mapped_regrev);
 	}
@@ -874,8 +865,6 @@ static const country_info_t *wlc_country_lookup_direct(const char *ccode,
 			return &cntry_locales[i].country;
 		}
 	}
-
-	ASSERT(0);
 	return NULL;
 }
 
@@ -896,12 +885,10 @@ wlc_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country)
 		li = BAND_5G(band->bandtype) ?
 		    wlc_get_locale_5g(country->locale_5G) :
 		    wlc_get_locale_2g(country->locale_2G);
-		ASSERT(li);
 		wlc_cm->bandstate[band->bandunit].locale_flags = li->flags;
 		li_mimo = BAND_5G(band->bandtype) ?
 		    wlc_get_mimo_5g(country->locale_mimo_5G) :
 		    wlc_get_mimo_2g(country->locale_mimo_2G);
-		ASSERT(li_mimo);
 
 		/* merge the mimo non-mimo locale flags */
 		wlc_cm->bandstate[band->bandunit].locale_flags |=
@@ -1509,7 +1496,6 @@ wlc_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec, bool dualband)
 	if (wf_chspec_malformed(chspec)) {
 		wiphy_err(wlc->wiphy, "wl%d: malformed chanspec 0x%x\n",
 			wlc->pub->unit, chspec);
-		ASSERT(0);
 		return false;
 	}
 
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_rate.c b/drivers/staging/brcm80211/brcmsmac/wlc_rate.c
index 8c1b8f0..50a9fb5 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_rate.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_rate.c
@@ -315,7 +315,6 @@ wlc_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
 	count = 0;
 	for (i = 0; i < hw_rs->count; i++) {
 		r = hw_rs->rates[i] & WLC_RATE_MASK;
-		ASSERT(r <= WLC_MAXRATE);
 		if (rateset[r])
 			rs->rates[count++] = rateset[r];
 	}
@@ -364,8 +363,7 @@ ratespec_t BCMFASTPATH wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
 		case PRXS0_STDN:
 			/* fallthru */
 		default:
-			/* not supported */
-			ASSERT(0);
+			/* not supported, error condition */
 			break;
 		}
 		if (PLCP3_ISSGI(plcp[3]))
@@ -451,7 +449,7 @@ wlc_rateset_default(wlc_rateset_t *rs_tgt, const wlc_rateset_t *rs_hw,
 	} else if (PHYTYPE_IS(phy_type, PHY_TYPE_G)) {
 		rs_dflt = &cck_ofdm_rates;
 	} else {
-		ASSERT(0);	/* should not happen */
+		/* should not happen, error condition */
 		rs_dflt = &cck_rates;	/* force cck */
 	}
 
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_stf.c b/drivers/staging/brcm80211/brcmsmac/wlc_stf.c
index c006ab5..6eff7ef 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_stf.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_stf.c
@@ -69,9 +69,6 @@ const u8 txcore_default[5] = {
 
 static void wlc_stf_stbc_rx_ht_update(struct wlc_info *wlc, int val)
 {
-	ASSERT((val == HT_CAP_RX_STBC_NO)
-	       || (val == HT_CAP_RX_STBC_ONE_STREAM));
-
 	/* MIMOPHYs rev3-6 cannot receive STBC with only one rx core active */
 	if (WLC_STF_SS_STBC_RX(wlc)) {
 		if ((wlc->stf->rxstreams == 1) && (val != HT_CAP_RX_STBC_NO))
@@ -196,8 +193,6 @@ static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask)
 	WL_TRACE("wl%d: %s: Nsts %d core_mask %x\n",
 		 wlc->pub->unit, __func__, Nsts, core_mask);
 
-	ASSERT((Nsts > 0) && (Nsts <= MAX_STREAMS_SUPPORTED));
-
 	if (WLC_BITSCNT(core_mask) > wlc->stf->txstreams) {
 		core_mask = 0;
 	}
@@ -208,8 +203,6 @@ static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask)
 		core_mask = wlc->stf->txchain;
 	}
 
-	ASSERT(!core_mask || Nsts <= WLC_BITSCNT(core_mask));
-
 	wlc->stf->txcore[Nsts] = core_mask;
 	/* Nsts = 1..4, txcore index = 1..4 */
 	if (Nsts == 1) {
@@ -323,9 +316,6 @@ int wlc_stf_ss_update(struct wlc_info *wlc, struct wlcband *band)
 	if (WLC_STBC_CAP_PHY(wlc) &&
 	    wlc->stf->ss_algosel_auto
 	    && (wlc->stf->ss_algo_channel != (u16) -1)) {
-		ASSERT(isset(&wlc->stf->ss_algo_channel, PHY_TXC1_MODE_CDD)
-		       || isset(&wlc->stf->ss_algo_channel,
-				PHY_TXC1_MODE_SISO));
 		upd_stf_ss = (wlc->stf->no_cddstbc || (wlc->stf->txstreams == 1)
 			      || isset(&wlc->stf->ss_algo_channel,
 				       PHY_TXC1_MODE_SISO)) ? PHY_TXC1_MODE_SISO
@@ -425,9 +415,6 @@ static void _wlc_stf_phy_txant_upd(struct wlc_info *wlc)
 	s8 txant;
 
 	txant = (s8) wlc->stf->txant;
-	ASSERT(txant == ANT_TX_FORCE_0 || txant == ANT_TX_FORCE_1
-	       || txant == ANT_TX_LAST_RX);
-
 	if (WLC_PHY_11N_CAP(wlc->band)) {
 		if (txant == ANT_TX_FORCE_0) {
 			wlc->stf->phytxant = PHY_TXC_ANT_0;
@@ -443,8 +430,8 @@ static void _wlc_stf_phy_txant_upd(struct wlc_info *wlc)
 			if (WLCISLCNPHY(wlc->band) || WLCISSSLPNPHY(wlc->band))
 				wlc->stf->phytxant = PHY_TXC_LCNPHY_ANT_LAST;
 			else {
-				/* keep this assert to catch out of sync wlc->stf->txcore */
-				ASSERT(wlc->stf->txchain > 0);
+				/* catch out of sync wlc->stf->txcore */
+				WARN_ON(wlc->stf->txchain <= 0);
 				wlc->stf->phytxant =
 				    wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
 			}
@@ -508,7 +495,6 @@ static u16 _wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec)
 	u16 phytxant = wlc->stf->phytxant;
 
 	if (RSPEC_STF(rspec) != PHY_TXC1_MODE_SISO) {
-		ASSERT(wlc->stf->txstreams > 1);
 		phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
 	} else if (wlc->stf->txant == ANT_TX_DEF)
 		phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
@@ -528,7 +514,6 @@ u16 wlc_stf_d11hdrs_phyctl_txant(struct wlc_info *wlc, ratespec_t rspec)
 
 	/* for non-siso rates or default setting, use the available chains */
 	if (WLCISNPHY(wlc->band)) {
-		ASSERT(wlc->stf->txchain != 0);
 		phytxant = _wlc_stf_phytxchain_sel(wlc, rspec);
 		mask = PHY_TXC_HTANT_MASK;
 	}
-- 
1.7.4.1



  parent reply	other threads:[~2011-05-03  9:36 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03  9:35 [PATCH 00/61] staging: brcm80211: resubmit after flush of patch queue Arend van Spriel
2011-05-03  9:35 ` [PATCH 01/61] staging: brcm80211: fixed error in non-DHD_DEBUG fullmac build Arend van Spriel
2011-05-03  9:35 ` [PATCH 02/61] staging: brcm80211: made error codes in bcmutils.h positive Arend van Spriel
2011-05-03  9:35 ` [PATCH 03/61] staging: brcm80211: bugfix for fullmac return codes Arend van Spriel
2011-05-03  9:35 ` [PATCH 04/61] staging: brcm80211: removed WL_NONE Arend van Spriel
2011-05-03  9:35 ` [PATCH 05/61] staging: brcm80211: making wiphy object accessible from wlc and phy Arend van Spriel
2011-05-03  9:35 ` [PATCH 06/61] staging: brcm80211: replaced WL_ERROR in two files Arend van Spriel
2011-05-03  9:35 ` [PATCH 07/61] staging: brcm80211: replaced WL_ERROR in wlc_ampdu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 08/61] staging: brcm80211: replaced WL_ERROR in wlc_bmac.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 09/61] staging: brcm80211: replaced WL_ERROR in wlc_main.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 10/61] staging: brcm80211: replaced WL_ERROR in rest of softmac Arend van Spriel
2011-05-03  9:35 ` [PATCH 11/61] staging: brcm80211: remove unnecessary if statements from bss_info_changed Arend van Spriel
2011-05-03  9:35 ` [PATCH 12/61] staging: brcm80211: remove wl_ops_set_rts_threshold Arend van Spriel
2011-05-03  9:35 ` [PATCH 13/61] staging: brcm80211: rename rate related definitions Arend van Spriel
2011-05-03  9:35 ` [PATCH 14/61] staging: brcm80211: honour basic rate configuration from mac80211 Arend van Spriel
2011-05-03  9:35 ` [PATCH 15/61] staging: brcm80211: removed ASSERTs from wlc_main.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 16/61] staging: brcm80211: removed ASSERTs from wlc_ampdu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 17/61] staging: brcm80211: removed ASSERTs from wlc_bmac.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 18/61] staging: brcm80211: removed error string function Arend van Spriel
2011-05-03  9:35 ` [PATCH 19/61] staging: brcm80211: replace error codes part 1 Arend van Spriel
2011-05-03  9:35 ` [PATCH 20/61] staging: brcm80211: replace error codes part 2 Arend van Spriel
2011-05-03  9:35 ` [PATCH 21/61] staging: brcm80211: made fullmac error codes more consistent Arend van Spriel
2011-05-03  9:35 ` [PATCH 22/61] staging: brcm80211: removed ASSERTs from util dir, part 1 Arend van Spriel
2011-05-03  9:35 ` [PATCH 23/61] staging: brcm80211: removed ASSERTs from util dir, part 2 Arend van Spriel
2011-05-03  9:35 ` Arend van Spriel [this message]
2011-05-03  9:35 ` [PATCH 25/61] staging: brcm80211: removed all ASSERTs from wl_mac80211.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 26/61] staging: brcm80211: removed all ASSERTs from wlc_ampdu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 27/61] staging: brcm80211: removed remaining ASSERTs from phy Arend van Spriel
2011-05-03  9:35 ` [PATCH 28/61] staging: brcm80211: implement flush driver callback for mac80211 Arend van Spriel
2011-05-03  9:35 ` [PATCH 29/61] staging: brcm80211: rename active_queue identifier Arend van Spriel
2011-05-03  9:35 ` [PATCH 30/61] staging: brcm80211: remove queue info parameter from wlc_send_q Arend van Spriel
2011-05-03  9:35 ` [PATCH 31/61] staging: brcm80211: provide TSF value in receive status Arend van Spriel
2011-05-03  9:35 ` [PATCH 32/61] staging: brcm80211: remove tsf retrieval from wlc_bmac.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 33/61] staging: brcm80211: remove retrieval function for tsf in wlc_main.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 34/61] Revert "staging: brcm80211: separate hndpmu functionality for brcmsmac driver" Arend van Spriel
2011-05-03  9:35 ` [PATCH 35/61] staging: brcm80211: remove unused functions from hndpmu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 36/61] staging: brcm80211: remove use of si_* functions from wlc_phy_lcn.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 37/61] staging: brcm80211: separate hndpmu functionality for brcmsmac driver Arend van Spriel
2011-05-03  9:35 ` [PATCH 38/61] staging: brcm80211: remove dependency between aiutils and siutils sources Arend van Spriel
2011-05-03  9:35 ` [PATCH 39/61] staging: brcm80211: fix checkpatch warnings in si_pmu_spuravoid_pllupdate Arend van Spriel
2011-05-03  9:35 ` [PATCH 40/61] staging: brcm80211: remove zero initialization of static in si_pmu_ilp_clock Arend van Spriel
2011-05-03  9:35 ` [PATCH 41/61] staging: brcm80211: fix checkpatch warning in si_pmu_res_init Arend van Spriel
2011-05-03  9:35 ` [PATCH 42/61] staging: brcm80211: fix checkpatch issues in si_pmu_measure_alpclk Arend van Spriel
2011-05-03  9:35 ` [PATCH 43/61] staging: brcm80211: fix checkpatch warning in si_pmu_otp_power Arend van Spriel
2011-05-03  9:35 ` [PATCH 44/61] staging: brcm80211: cleanup definitions in aiutils header file Arend van Spriel
2011-05-03  9:35 ` [PATCH 45/61] staging: brcm80211: cleanup code in source file aiutils.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 46/61] staging: brcm80211: move aiutils source files to brcmsmac folder Arend van Spriel
2011-05-03  9:35 ` [PATCH 47/61] staging: brcm80211: remove check on interconnect type in ai_setcore Arend van Spriel
2011-05-03  9:35 ` [PATCH 48/61] staging: brcm80211: use local variable for socitype during ai_scan Arend van Spriel
2011-05-03  9:35 ` [PATCH 49/61] staging: brcm80211: remove socitype member for struct si_pub definition Arend van Spriel
2011-05-03  9:35 ` [PATCH 50/61] staging: brcm80211: removed ASSERTs from aiutils.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 51/61] staging: brcm80211: removed ASSERTs from wlc_pmu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 52/61] staging: brcm80211: moved ASSERT logic to fullmac driver Arend van Spriel
2011-05-03  9:35 ` [PATCH 53/61] staging: brcm80211: replace hndcrc16 with crc-ccitt function Arend van Spriel
2011-05-03  9:35 ` [PATCH 54/61] staging: brcm80211: remove unused hndcrc32 function Arend van Spriel
2011-05-03  9:35 ` [PATCH 55/61] staging: brcm80211: remove CRC_INNER_LOOP macro Arend van Spriel
2011-05-03  9:35 ` [PATCH 56/61] staging: brcm80211: move qmath sources to phy directory Arend van Spriel
2011-05-03  9:35 ` [PATCH 57/61] staging: brcm80211: remove unused functions from wlc_phy_qmath.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 58/61] staging: brcm80211: replaced WL_TRACE by BCMMSG Arend van Spriel
2011-05-03  9:35 ` [PATCH 59/61] staging: brcm80211: replaced WL_AMPDU_* with BCMMSG Arend van Spriel
2011-05-03  9:36 ` [PATCH 60/61] staging: brcm80211: got rid of WL_FFPLD message log macro Arend van Spriel
2011-05-03  9:36 ` [PATCH 61/61] staging: brcm80211: removed function wlc_calloc() Arend van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304415361-7813-25-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=brudley@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=henryp@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rvossen@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).