Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Franky Lin" <frankyl@broadcom.com>
To: gregkh@suse.de
Cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org
Subject: [PATCH v2 13/19] staging: brcm80211: removed two fullmac sparse spinlock warnings
Date: Thu, 22 Sep 2011 17:07:50 -0700	[thread overview]
Message-ID: <1316736476-23725-14-git-send-email-frankyl@broadcom.com> (raw)
In-Reply-To: <1316736476-23725-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

By deleting three redundant functions. The spinlock was related to
event queue operation. Event queue data members were also renamed
to make their function more clear.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |   49 ++++++++--------------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |    6 +-
 2 files changed, 20 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 2dd28a2..0bda00c 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -3181,21 +3181,6 @@ init_priv_mem_out:
 	return -ENOMEM;
 }
 
-static void brcmf_lock_eq(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	spin_lock_irq(&cfg_priv->eq_lock);
-}
-
-static void brcmf_unlock_eq(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	spin_unlock_irq(&cfg_priv->eq_lock);
-}
-
-static void brcmf_init_eq_lock(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	spin_lock_init(&cfg_priv->eq_lock);
-}
-
 /*
 * retrieve first queued event from head
 */
@@ -3205,13 +3190,13 @@ static struct brcmf_cfg80211_event_q *brcmf_deq_event(
 {
 	struct brcmf_cfg80211_event_q *e = NULL;
 
-	brcmf_lock_eq(cfg_priv);
-	if (likely(!list_empty(&cfg_priv->eq_list))) {
-		e = list_first_entry(&cfg_priv->eq_list,
-				     struct brcmf_cfg80211_event_q, eq_list);
-		list_del(&e->eq_list);
+	spin_lock_irq(&cfg_priv->evt_q_lock);
+	if (likely(!list_empty(&cfg_priv->evt_q_list))) {
+		e = list_first_entry(&cfg_priv->evt_q_list,
+				     struct brcmf_cfg80211_event_q, evt_q_list);
+		list_del(&e->evt_q_list);
 	}
-	brcmf_unlock_eq(cfg_priv);
+	spin_unlock_irq(&cfg_priv->evt_q_lock);
 
 	return e;
 }
@@ -3236,9 +3221,9 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
 	e->etype = event;
 	memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));
 
-	brcmf_lock_eq(cfg_priv);
-	list_add_tail(&e->eq_list, &cfg_priv->eq_list);
-	brcmf_unlock_eq(cfg_priv);
+	spin_lock_irq(&cfg_priv->evt_q_lock);
+	list_add_tail(&e->evt_q_list, &cfg_priv->evt_q_list);
+	spin_unlock_irq(&cfg_priv->evt_q_lock);
 
 	return err;
 }
@@ -3276,22 +3261,22 @@ static void brcmf_cfg80211_event_handler(struct work_struct *work)
 
 static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	brcmf_init_eq_lock(cfg_priv);
-	INIT_LIST_HEAD(&cfg_priv->eq_list);
+	spin_lock_init(&cfg_priv->evt_q_lock);
+	INIT_LIST_HEAD(&cfg_priv->evt_q_list);
 }
 
 static void brcmf_flush_eq(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	struct brcmf_cfg80211_event_q *e;
 
-	brcmf_lock_eq(cfg_priv);
-	while (!list_empty(&cfg_priv->eq_list)) {
-		e = list_first_entry(&cfg_priv->eq_list,
-				     struct brcmf_cfg80211_event_q, eq_list);
-		list_del(&e->eq_list);
+	spin_lock_irq(&cfg_priv->evt_q_lock);
+	while (!list_empty(&cfg_priv->evt_q_list)) {
+		e = list_first_entry(&cfg_priv->evt_q_list,
+				     struct brcmf_cfg80211_event_q, evt_q_list);
+		list_del(&e->evt_q_list);
 		kfree(e);
 	}
-	brcmf_unlock_eq(cfg_priv);
+	spin_unlock_irq(&cfg_priv->evt_q_lock);
 }
 
 static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 79806c0..14a32e1 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -199,7 +199,7 @@ struct brcmf_cfg80211_ie {
 
 /* event queue for cfg80211 main event */
 struct brcmf_cfg80211_event_q {
-	struct list_head eq_list;
+	struct list_head evt_q_list;
 	u32 etype;
 	struct brcmf_event_msg emsg;
 	s8 edata[1];
@@ -282,8 +282,8 @@ struct brcmf_cfg80211_priv {
 	struct cfg80211_scan_request *scan_request;	/* scan request
 							 object */
 	struct brcmf_cfg80211_event_loop el;	/* main event loop */
-	struct list_head eq_list;	/* used for event queue */
-	spinlock_t eq_lock;	/* for event queue synchronization */
+	struct list_head evt_q_list;	/* used for event queue */
+	spinlock_t	 evt_q_lock;	/* for event queue synchronization */
 	struct mutex usr_sync;	/* maily for dongle up/down synchronization */
 	struct brcmf_scan_results *bss_list;	/* bss_list holding scanned
 						 ap information */
-- 
1.7.1



  parent reply	other threads:[~2011-09-23  0:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23  0:07 [PATCH v2 00/19] staging: brcm80211: 7th reaction for mainline patch #2 Franky Lin
2011-09-23  0:07 ` [PATCH v2 01/19] staging: brcm80211: sparse endianness warnings on dongle events Franky Lin
2011-09-23  0:07 ` [PATCH v2 02/19] staging: brcm80211: various fulmac sparse endianness fixes Franky Lin
2011-09-23  0:07 ` [PATCH v2 03/19] staging: brcm80211: sparse endianness warnings for struct brcmf_proto_cdc_ioctl Franky Lin
2011-09-23  0:07 ` [PATCH v2 04/19] staging: brcm80211: sparse endianness warnings for struct sdpcm_shared Franky Lin
2011-09-23  0:07 ` [PATCH v2 05/19] staging: brcm80211: more fullmac sparse endianness scan related changes Franky Lin
2011-09-23  0:07 ` [PATCH v2 06/19] staging: brcm80211: remove unconditional code blocks from brcmfmac Franky Lin
2011-09-23  0:07 ` [PATCH v2 07/19] staging: brcm80211: remove event handler thread from fullmac Franky Lin
2011-09-23  0:07 ` [PATCH v2 08/19] staging: brcm80211: remove fullmac module_param brcmf_dongle_memsize Franky Lin
2011-09-23  0:07 ` [PATCH v2 09/19] staging: brcm80211: remove fullmac module_param brcmf_sdiod_drive_strength Franky Lin
2011-09-23  0:07 ` [PATCH v2 10/19] staging: brcm80211: remove fullmac module_param for watchdog Franky Lin
2011-09-23  0:07 ` [PATCH v2 11/19] staging: brcm80211: remove fullmac module_param brcmf_idletime Franky Lin
2011-09-23  0:07 ` [PATCH v2 12/19] staging: brcm80211: remove global variables for data frame boundary Franky Lin
2011-09-23  0:07 ` Franky Lin [this message]
2011-09-23  0:07 ` [PATCH v2 14/19] staging: brcm80211: added endianness check flag to fullmac Makefile Franky Lin
2011-09-23  0:07 ` [PATCH v2 15/19] staging: brcm80211: removed likely/unlikely calls Franky Lin
2011-09-23  0:07 ` [PATCH v2 16/19] staging: brcm80211: removed log after kzalloc()/kmalloc() failure Franky Lin
2011-09-23  0:07 ` [PATCH v2 17/19] staging: brcm80211: clarified fullmac io and event codes Franky Lin
2011-09-23  0:07 ` [PATCH v2 18/19] staging: brcm80211: consistent naming of struct net_device *ndev Franky Lin
2011-09-23  0:07 ` [PATCH v2 19/19] staging: brcm80211: simplified internal ioctl function once more Franky Lin

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=1316736476-23725-14-git-send-email-frankyl@broadcom.com \
    --to=frankyl@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=linux-wireless@vger.kernel.org \
    /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