linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: gregkh@suse.de
Cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org,
	"Roland Vossen" <rvossen@broadcom.com>,
	"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 08/31] staging: brcm80211: removed asserts from dhd_linux.c
Date: Wed, 6 Jul 2011 00:02:35 +0200	[thread overview]
Message-ID: <1309903378-29021-9-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1309903378-29021-1-git-send-email-arend@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   33 +-----------------------
 1 files changed, 1 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index afb1e32..0ea8084 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -235,7 +235,6 @@ static int brcmf_net2idx(struct brcmf_info *drvr_priv, struct net_device *net)
 {
 	int i = 0;
 
-	ASSERT(drvr_priv);
 	while (i < BRCMF_MAX_IFS) {
 		if (drvr_priv->iflist[i] && (drvr_priv->iflist[i]->net == net))
 			return i;
@@ -249,8 +248,6 @@ int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
 {
 	int i = BRCMF_MAX_IFS;
 
-	ASSERT(drvr_priv);
-
 	if (name == NULL || *name == '\0')
 		return 0;
 
@@ -268,8 +265,6 @@ char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx)
 {
 	struct brcmf_info *drvr_priv = drvr->info;
 
-	ASSERT(drvr_priv);
-
 	if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
 		BRCMF_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
 		return "<if_bad>";
@@ -297,7 +292,6 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
 	uint buflen;
 	int ret;
 
-	ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
 	dev = drvr_priv->iflist[ifidx]->net;
 	cnt = netdev_mc_count(dev);
 
@@ -437,13 +431,12 @@ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *a
 extern struct net_device *ap_net_dev;
 #endif
 
+/* Virtual interfaces only ((ifp && ifp->info && ifp->idx == true) */
 static void brcmf_op_if(struct brcmf_if *ifp)
 {
 	struct brcmf_info *drvr_priv;
 	int ret = 0, err = 0;
 
-	ASSERT(ifp && ifp->info && ifp->idx);	/* Virtual interfaces only */
-
 	drvr_priv = ifp->info;
 
 	BRCMF_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
@@ -509,7 +502,6 @@ static void brcmf_op_if(struct brcmf_if *ifp)
 		break;
 	default:
 		BRCMF_ERROR(("%s: bad op %d\n", __func__, ifp->state));
-		ASSERT(!ifp->state);
 		break;
 	}
 
@@ -601,7 +593,6 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
 	if (ifidx == BRCMF_BAD_IF)
 		return -1;
 
-	ASSERT(drvr_priv->sysioc_tsk);
 	memcpy(&drvr_priv->macvalue, sa->sa_data, ETH_ALEN);
 	drvr_priv->set_macaddress = true;
 	up(&drvr_priv->sysioc_sem);
@@ -618,7 +609,6 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
 	if (ifidx == BRCMF_BAD_IF)
 		return;
 
-	ASSERT(drvr_priv->sysioc_tsk);
 	drvr_priv->set_multicast = true;
 	up(&drvr_priv->sysioc_sem);
 }
@@ -711,7 +701,6 @@ void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool state)
 	BRCMF_TRACE(("%s: Enter\n", __func__));
 
 	drvr->txoff = state;
-	ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
 	net = drvr_priv->iflist[ifidx]->net;
 	if (state == ON)
 		netif_stop_queue(net);
@@ -759,7 +748,6 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
 		if (ifp == NULL)
 			ifp = drvr_priv->iflist[0];
 
-		ASSERT(ifp);
 		skb->dev = ifp->net;
 		skb->protocol = eth_type_trans(skb, skb->dev);
 
@@ -778,7 +766,6 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
 					  skb_mac_header(skb),
 					  &event, &data);
 
-		ASSERT(ifidx < BRCMF_MAX_IFS && drvr_priv->iflist[ifidx]);
 		if (drvr_priv->iflist[ifidx] &&
 		    !drvr_priv->iflist[ifidx]->state)
 			ifp = drvr_priv->iflist[ifidx];
@@ -833,7 +820,6 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
 		return NULL;
 
 	ifp = drvr_priv->iflist[ifidx];
-	ASSERT(drvr_priv && ifp);
 
 	if (drvr_priv->pub.up) {
 		/* Use the protocol to get dongle stats */
@@ -1247,8 +1233,6 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
 
 	BRCMF_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
 
-	ASSERT(drvr_priv && (ifidx < BRCMF_MAX_IFS));
-
 	ifp = drvr_priv->iflist[ifidx];
 	if (!ifp) {
 		ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
@@ -1268,7 +1252,6 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
 	if (handle == NULL) {
 		ifp->state = BRCMF_E_IF_ADD;
 		ifp->idx = ifidx;
-		ASSERT(drvr_priv->sysioc_tsk);
 		up(&drvr_priv->sysioc_sem);
 	} else
 		ifp->net = (struct net_device *)handle;
@@ -1282,7 +1265,6 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
 
 	BRCMF_TRACE(("%s: idx %d\n", __func__, ifidx));
 
-	ASSERT(drvr_priv && ifidx && (ifidx < BRCMF_MAX_IFS));
 	ifp = drvr_priv->iflist[ifidx];
 	if (!ifp) {
 		BRCMF_ERROR(("%s: Null interface\n", __func__));
@@ -1291,7 +1273,6 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
 
 	ifp->state = BRCMF_E_IF_DEL;
 	ifp->idx = ifidx;
-	ASSERT(drvr_priv->sysioc_tsk);
 	up(&drvr_priv->sysioc_sem);
 }
 
@@ -1399,8 +1380,6 @@ int brcmf_bus_start(struct brcmf_pub *drvr)
 	/* Room for "event_msgs" + '\0' + bitvec */
 	char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
 
-	ASSERT(drvr_priv);
-
 	BRCMF_TRACE(("%s:\n", __func__));
 
 	/* Bring up the bus */
@@ -1475,12 +1454,7 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
 
 	BRCMF_TRACE(("%s: ifidx %d\n", __func__, ifidx));
 
-	ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
-
 	net = drvr_priv->iflist[ifidx]->net;
-	ASSERT(net);
-
-	ASSERT(!net->netdev_ops);
 	net->netdev_ops = &brcmf_netdev_ops_pri;
 
 	/*
@@ -1557,7 +1531,6 @@ void brcmf_detach(struct brcmf_pub *drvr)
 					brcmf_del_if(drvr_priv, i);
 
 			ifp = drvr_priv->iflist[0];
-			ASSERT(ifp);
 			if (ifp->net->netdev_ops == &brcmf_netdev_ops_pri) {
 				brcmf_netdev_stop(ifp->net);
 				unregister_netdev(ifp->net);
@@ -1685,14 +1658,10 @@ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktd
 {
 	int bcmerror = 0;
 
-	ASSERT(drvr_priv != NULL);
-
 	bcmerror = brcmf_c_host_event(drvr_priv, ifidx, pktdata, event, data);
 	if (bcmerror != 0)
 		return bcmerror;
 
-	ASSERT(drvr_priv->iflist[*ifidx] != NULL);
-	ASSERT(drvr_priv->iflist[*ifidx]->net != NULL);
 	if (drvr_priv->iflist[*ifidx]->net)
 		brcmf_cfg80211_event(drvr_priv->iflist[*ifidx]->net,
 				     event, *data);
-- 
1.7.4.1



  parent reply	other threads:[~2011-07-05 22:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 22:02 [PATCH 00/31] staging: brcm80211: fullmac cleanup and checkpatch fixes Arend van Spriel
2011-07-05 22:02 ` [PATCH 01/31] staging: brcm80211: clean up checkpatch error Arend van Spriel
2011-07-05 22:02 ` [PATCH 02/31] staging: brcm80211: removed occurrences of 'dhd' Arend van Spriel
2011-07-05 22:02 ` [PATCH 03/31] staging: brcm80211: removed unused #ifdef sections in fullmac Arend van Spriel
2011-07-05 22:02 ` [PATCH 04/31] staging: brcm80211: rename macros in dhd_dbg.h Arend van Spriel
2011-07-05 22:02 ` [PATCH 05/31] staging: brcm80211: removed asserts from two fullmac files Arend van Spriel
2011-07-05 22:02 ` [PATCH 06/31] staging: brcm80211: removed asserts from bcmsdh.c Arend van Spriel
2011-07-05 22:02 ` [PATCH 07/31] staging: brcm80211: removed asserts from dhd_cdc.c and dhd_common.c Arend van Spriel
2011-07-06  9:24   ` Dan Carpenter
2011-07-06 14:27     ` Roland Vossen
2011-07-05 22:02 ` Arend van Spriel [this message]
2011-07-05 22:02 ` [PATCH 09/31] staging: brcm80211: removed asserts from dhd_sdio.c Arend van Spriel
2011-07-05 22:02 ` [PATCH 10/31] staging: brcm80211: removed remains of assert mechanism in fullmac Arend van Spriel
2011-07-05 22:02 ` [PATCH 11/31] staging: brcm80211: replaced various typedefs in softmac Arend van Spriel
2011-07-05 22:02 ` [PATCH 12/31] staging: brcm80211: replaced typedef phy_info_t by struct brcms_phy Arend van Spriel
2011-07-05 22:02 ` [PATCH 13/31] staging: brcm80211: replaced typedef wlc_phy_t with struct brcms_phy_pub Arend van Spriel
2011-07-05 22:02 ` [PATCH 14/31] staging: brcm80211: replaced typedef tx_power_t by struct brcms_tx_power Arend van Spriel
2011-07-05 22:02 ` [PATCH 15/31] staging: brcm80211: renamed structures in softmac Arend van Spriel
2011-07-05 22:02 ` [PATCH 16/31] staging: brcm80211: remove checkpatch warnings 'suspect code indent' Arend van Spriel
2011-07-05 22:02 ` [PATCH 17/31] staging: brcm80211: made name lookup arrays more const Arend van Spriel
2011-07-05 22:02 ` [PATCH 18/31] staging: brcm80211: remove checkpatch warnings from phy_n.c Arend van Spriel
2011-07-05 22:02 ` [PATCH 19/31] staging: brcm80211: replaced Broadcom specific acronym WLC Arend van Spriel
2011-07-05 22:02 ` [PATCH 20/31] staging: brcm80211: deleted two fullmac source files Arend van Spriel
2011-07-05 22:02 ` [PATCH 21/31] staging: brcm80211: merged dngl_stats.h into dhd.h Arend van Spriel
2011-07-05 22:02 ` [PATCH 22/31] staging: brcm80211: merged sbsdio.h into sdio_host.h Arend van Spriel
2011-07-05 22:02 ` [PATCH 23/31] staging: brcm80211: merged bcmsdbus.h " Arend van Spriel
2011-07-05 22:02 ` [PATCH 24/31] staging: brcm80211: moved fullmac definitions from .h to .c files Arend van Spriel
2011-07-05 22:02 ` [PATCH 25/31] staging: brcm80211: removed #ifdef SDIOH_API_ACCESS_RETRY_LIMIT Arend van Spriel
2011-07-05 22:02 ` [PATCH 26/31] staging: brcm80211: replace occurrences of __attribute__((packed)) Arend van Spriel
2011-07-05 22:02 ` [PATCH 27/31] staging: brcm80211: remove several externs from dhd_linux.c Arend van Spriel
2011-07-05 22:02 ` [PATCH 28/31] staging: brcm80211: remove external definitions from phy_lcn.c Arend van Spriel
2011-07-05 22:02 ` [PATCH 29/31] staging: brcm80211: remove macro WLBANDINITFN from brcmsmac Arend van Spriel
2011-07-05 22:02 ` [PATCH 30/31] staging: brcm80211: simpler string handling in brcmf_c_pktfilter_offload_set() Arend van Spriel
2011-07-05 22:02 ` [PATCH 31/31] staging: brcm80211: added newlines to some debug macros in bcmsdh_sdmmc.c 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=1309903378-29021-9-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --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).