linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Noss <cnoss@gmx.de>
To: linux-wireless@vger.kernel.org, gregkh@suse.de
Cc: arend@broadcom.com, rvossen@broadcom.com, henryp@broadcom.com,
	brudley@broadcom.com, devel@linuxdriverproject.org
Subject: [PATCH] staging: brcm80211: use correct pointer types in bcm_pktq_flush
Date: Sun, 15 May 2011 22:50:46 +0200	[thread overview]
Message-ID: <1305492646-20122-1-git-send-email-cnoss@gmx.de> (raw)
In-Reply-To: <4DD02F72.3070905@broadcom.com>

to clarify the intention:

On Sun, May 15, 2011 at 09:54:26PM +0200, Arend van Spriel wrote:
> On 05/15/2011 08:10 PM, Hauke Mehrtens wrote:
[...]
>> Why don't you use the correct pointer type here instead of casting then
>> around and the parameter names are meaningless too.
>>
>> static bool cb_del_ampdu_pkt(struct sk_buff *mpdu, struct
>> cb_del_ampdu_pars *ampdu_pars)
[...]
> Actually this is a generic callback mechanism in which an additional
> parameter can be passed, which can be of *any* type hence a void pointer
> seems justified here and a meaningless name is used. I do agree that the
> txi parameter will always be a struct sk_buff and should be indicated as
> such.

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Clemens Noss <cnoss@gmx.de>
---
 drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c |    3 +--
 drivers/staging/brcm80211/include/bcmutils.h   |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c b/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c
index 0d93bd6..b1bc1a6 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c
@@ -1225,9 +1225,8 @@ void wlc_ampdu_shm_upd(struct ampdu_info *ampdu)
 /*
  * callback function that helps flushing ampdu packets from a priority queue
  */
-static bool cb_del_ampdu_pkt(void *p, void *arg_a)
+static bool cb_del_ampdu_pkt(struct sk_buff *mpdu, void *arg_a)
 {
-	struct sk_buff *mpdu = (struct sk_buff *)p;
 	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(mpdu);
 	struct cb_del_ampdu_pars *ampdu_pars =
 				 (struct cb_del_ampdu_pars *)arg_a;
diff --git a/drivers/staging/brcm80211/include/bcmutils.h b/drivers/staging/brcm80211/include/bcmutils.h
index 1d57934..4dc190b 100644
--- a/drivers/staging/brcm80211/include/bcmutils.h
+++ b/drivers/staging/brcm80211/include/bcmutils.h
@@ -74,7 +74,7 @@
 #define PKTQ_PREC_ITER(pq, prec)        for (prec = (pq)->num_prec - 1; prec >= 0; prec--)
 
 /* fn(pkt, arg).  return true if pkt belongs to if */
-	typedef bool(*ifpkt_cb_t) (void *, void *);
+typedef bool(*ifpkt_cb_t) (struct sk_buff *, void *);
 
 /* operations on a specific precedence in packet queue */
 
-- 
1.7.4.5


  reply	other threads:[~2011-05-15 20:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-15 17:04 [PATCH] staging: brcm80211: fix cast to pointer from integer Clemens Noss
2011-05-15 18:10 ` Hauke Mehrtens
2011-05-15 19:54   ` Arend van Spriel
2011-05-15 20:50     ` Clemens Noss [this message]
2011-05-16 11:11       ` [PATCH] staging: brcm80211: use correct pointer types in bcm_pktq_flush Roland Vossen
2011-05-15 19:59 ` [PATCH] staging: brcm80211: fix cast to pointer from integer 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=1305492646-20122-1-git-send-email-cnoss@gmx.de \
    --to=cnoss@gmx.de \
    --cc=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).