From: "Arend van Spriel" <arend@broadcom.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: "Linux Wireless List" <linux-wireless@vger.kernel.org>,
"Hante Meuleman" <meuleman@broadcom.com>,
"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 03/11] brcmfmac: use define instead of hardcoded values.
Date: Thu, 27 Sep 2012 14:17:49 +0200 [thread overview]
Message-ID: <1348748277-21460-4-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1348748277-21460-1-git-send-email-arend@broadcom.com>
From: Hante Meuleman <meuleman@broadcom.com>
brcmf_parse_tlvs was using hardcoded values.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
.../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index fad6d05..63dbb2a 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -48,6 +48,8 @@
#define BRCMF_PNO_SCAN_COMPLETE 1
#define BRCMF_PNO_SCAN_INCOMPLETE 0
+#define TLV_HDR_LEN 2 /* header length */
+
#define BRCMF_ASSOC_PARAMS_FIXED_SIZE \
(sizeof(struct brcmf_assoc_params_le) - sizeof(u16))
@@ -2610,15 +2612,15 @@ static struct brcmf_tlv *brcmf_parse_tlvs(void *buf, int buflen, uint key)
totlen = buflen;
/* find tagged parameter */
- while (totlen >= 2) {
+ while (totlen >= TLV_HDR_LEN) {
int len = elt->len;
/* validate remaining totlen */
- if ((elt->id == key) && (totlen >= (len + 2)))
+ if ((elt->id == key) && (totlen >= (len + TLV_HDR_LEN)))
return elt;
- elt = (struct brcmf_tlv *) ((u8 *) elt + (len + 2));
- totlen -= (len + 2);
+ elt = (struct brcmf_tlv *) ((u8 *) elt + (len + TLV_HDR_LEN));
+ totlen -= (len + TLV_HDR_LEN);
}
return NULL;
--
1.7.9.5
next prev parent reply other threads:[~2012-09-27 12:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 12:17 [PATCH 00/11] brcmfmac: cleanup and support for AP mode Arend van Spriel
2012-09-27 12:17 ` [PATCH 01/11] brcmfmac: use wait_event_timeout for fw control packets over usb Arend van Spriel
2012-09-27 12:17 ` [PATCH 02/11] brcmfmac: use different fw api for encryption,auth. config Arend van Spriel
2012-09-27 12:17 ` Arend van Spriel [this message]
2012-09-27 12:17 ` [PATCH 04/11] brcmfmac: notify common driver about usb tx completion Arend van Spriel
2012-09-27 12:17 ` [PATCH 05/11] brcmfmac: get rid of extern keyword in wl_cfg80211.h Arend van Spriel
2012-09-27 12:17 ` [PATCH 06/11] brcmfmac: use brcmf_cfg80211_priv to interface with wl_cfg80211 code Arend van Spriel
2012-09-27 12:17 ` [PATCH 07/11] brcmfmac: remove two obsolete structure definitions Arend van Spriel
2012-09-27 12:17 ` [PATCH 08/11] brcmfmac: add hostap supoort Arend van Spriel
2012-09-27 12:17 ` [PATCH 09/11] brcmfmac: rename structure brcmf_cfg80211_priv Arend van Spriel
2012-09-27 12:17 ` [PATCH 10/11] brcmfmac: remove brcmf_read_prof() function Arend van Spriel
2012-09-27 12:17 ` [PATCH 11/11] brcmfmac: remove brcmf_update_prof() function 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=1348748277-21460-4-git-send-email-arend@broadcom.com \
--to=arend@broadcom.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=meuleman@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).