From: Arend van Spriel <arend@broadcom.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Arend van Spriel <arend@broadcom.com>
Subject: [PATCH 09/14] brcmutil: use define for boardrev string function
Date: Sun, 25 Jan 2015 20:31:38 +0100 [thread overview]
Message-ID: <1422214303-7816-10-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1422214303-7816-1-git-send-email-arend@broadcom.com>
Introducing a define that the caller of brcmu_boardrev_str() can
use to allocate enough room for buffer passed to the function.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmsmac/debug.c | 2 +-
drivers/net/wireless/brcm80211/brcmutil/utils.c | 5 +++--
drivers/net/wireless/brcm80211/include/brcmu_utils.h | 2 ++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/debug.c b/drivers/net/wireless/brcm80211/brcmsmac/debug.c
index c9a8b93..7a1fbb2 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/debug.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/debug.c
@@ -78,7 +78,7 @@ int brcms_debugfs_hardware_read(struct seq_file *s, void *data)
struct brcms_hardware *hw = drvr->wlc->hw;
struct bcma_device *core = hw->d11core;
struct bcma_bus *bus = core->bus;
- char boardrev[10];
+ char boardrev[BRCMU_BOARDREV_LEN];
seq_printf(s, "chipnum 0x%x\n"
"chiprev 0x%x\n"
diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c
index 906e89d..34937d8 100644
--- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
@@ -267,10 +267,11 @@ char *brcmu_boardrev_str(u32 brev, char *buf)
char c;
if (brev < 0x100) {
- snprintf(buf, 8, "%d.%d", (brev & 0xf0) >> 4, brev & 0xf);
+ snprintf(buf, BRCMU_BOARDREV_LEN, "%d.%d",
+ (brev & 0xf0) >> 4, brev & 0xf);
} else {
c = (brev & 0xf000) == 0x1000 ? 'P' : 'A';
- snprintf(buf, 8, "%c%03x", c, brev & 0xfff);
+ snprintf(buf, BRCMU_BOARDREV_LEN, "%c%03x", c, brev & 0xfff);
}
return buf;
}
diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
index a043e29..197317b 100644
--- a/drivers/net/wireless/brcm80211/include/brcmu_utils.h
+++ b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
@@ -218,6 +218,8 @@ void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...)
}
#endif
+#define BRCMU_BOARDREV_LEN 8
+
char *brcmu_boardrev_str(u32 brev, char *buf);
#endif /* _BRCMU_UTILS_H_ */
--
1.9.1
next prev parent reply other threads:[~2015-01-25 19:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-25 19:31 [PATCH 00/14] brcm80211: sdio suspend rework and other fixes Arend van Spriel
2015-01-25 19:31 ` [PATCH 01/14] brcmfmac: Relax scheduling of msgbuf worker on high throughput Arend van Spriel
2015-01-29 8:01 ` [01/14] brcmfmac: Relax scheduling of msgbuf worker on highthroughput Kalle Valo
2015-01-25 19:31 ` [PATCH 02/14] brcmfmac: prevent possible deadlock on resuming SDIO device Arend van Spriel
2015-01-25 19:31 ` [PATCH 03/14] brcmfmac: use SDIO DPC for control frames Arend van Spriel
2015-01-25 19:31 ` [PATCH 04/14] brcmfmac: pass DEAUTH/DISASSOC reason code to user-space Arend van Spriel
2015-01-25 19:31 ` [PATCH 05/14] brcmfmac: wait for driver to go idle during suspend Arend van Spriel
2015-01-25 19:31 ` [PATCH 06/14] brcmfmac: SDIO: avoid using bus state for private states Arend van Spriel
2015-01-25 19:31 ` [PATCH 07/14] brcmfmac: Reopen netdev queue on bus state data Arend van Spriel
2015-01-25 19:31 ` [PATCH 08/14] brcmfmac: do not load firmware when device is already running Arend van Spriel
2015-01-25 19:31 ` Arend van Spriel [this message]
2015-01-25 19:31 ` [PATCH 10/14] brcmfmac: determine chip info when not provided by bus layer Arend van Spriel
2015-01-25 19:31 ` [PATCH 11/14] brcmfmac: always obtain device revision info upon intialization Arend van Spriel
2015-01-25 19:31 ` [PATCH 12/14] brcmfmac: show firmware release info in ethtool driver info Arend van Spriel
2015-01-25 19:31 ` [PATCH 13/14] brcmfmac: store revinfo retrieval result Arend van Spriel
2015-01-25 19:31 ` [PATCH 14/14] brcmfmac: fix nvram processing 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=1422214303-7816-10-git-send-email-arend@broadcom.com \
--to=arend@broadcom.com \
--cc=kvalo@codeaurora.org \
--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;
as well as URLs for NNTP newsgroup(s).