linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: gregkh@suse.de
Cc: "Arend van Spriel" <arend@broadcom.com>,
	linux-wireless@vger.kernel.org, devel@linuxdriverproject.org
Subject: [PATCH 08/19] staging: brcm80211: replace simple_strtoul usage in brcmsmac
Date: Mon, 18 Jul 2011 16:29:54 +0200	[thread overview]
Message-ID: <1310999405-10062-9-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1310999405-10062-1-git-send-email-arend@broadcom.com>

The usage of simple_strtoul is not preferred. Instead kstrtoul
should be used. This patch fixes this for the brcmsmac driver.

Cc: linux-wireless@vger.kernel.org
Cc: devel@linuxdriverproject.org
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c        |   16 +++++++++-------
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c |    7 ++++---
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 0d80e59..e5c675d 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -4287,16 +4287,17 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
 #endif
 	if (bustype != SI_BUS) {
 		char *var;
+		unsigned long res;
 
 		var = getvar(vars, "vendid");
-		if (var) {
-			vendor = (u16) simple_strtoul(var, NULL, 0);
+		if (var && !kstrtoul(var, 0, &res)) {
+			vendor = (u16)res;
 			wiphy_err(wiphy, "Overriding vendor id = 0x%x\n",
 				  vendor);
 		}
 		var = getvar(vars, "devid");
-		if (var) {
-			u16 devid = (u16) simple_strtoul(var, NULL, 0);
+		if (var && !kstrtoul(var, 0, &res)) {
+			u16 devid = (u16)res;
 			if (devid != 0xffff) {
 				device = devid;
 				wiphy_err(wiphy, "Overriding device id = 0x%x"
@@ -9596,10 +9597,11 @@ char *getvar(char *vars, const char *name)
 int getintvar(char *vars, const char *name)
 {
 	char *val;
+	unsigned long res;
 
 	val = getvar(vars, name);
-	if (val == NULL)
-		return 0;
+	if (val && !kstrtoul(val, 0, &res))
+		return res;
 
-	return simple_strtoul(val, NULL, 0);
+	return 0;
 }
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 582df4a..22f7bfc 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -174,12 +174,13 @@ char *phy_getvar(struct brcms_phy *pi, const char *name)
 int phy_getintvar(struct brcms_phy *pi, const char *name)
 {
 	char *val;
+	unsigned long res;
 
 	val = PHY_GETVAR(pi, name);
-	if (val == NULL)
-		return 0;
+	if (val && !kstrtoul(val, 0, &res))
+		return res;
 
-	return simple_strtoul(val, NULL, 0);
+	return 0;
 }
 
 void wlc_phyreg_enter(struct brcms_phy_pub *pih)
-- 
1.7.4.1



  parent reply	other threads:[~2011-07-18 14:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18 14:29 [PATCH 00/19] checkpatch changes and brcmfmac cleanup Arend van Spriel
2011-07-18 14:29 ` [PATCH 01/19] staging: brcm80211: fix for checkpatch warnings in phy directory Arend van Spriel
2011-07-18 14:29 ` [PATCH 02/19] staging: brcm80211: resolved checkpatch warnings in LCN phy Arend van Spriel
2011-07-18 14:29 ` [PATCH 03/19] staging: brcm80211: resolved checkpatch warnings in N phy Arend van Spriel
2011-07-18 14:29 ` [PATCH 04/19] staging: brcm80211: fixed build issue for big endian platforms Arend van Spriel
2011-07-18 14:29 ` [PATCH 05/19] staging: brcm80211: remove MIPS specific 'sync' instruction in fullmac Arend van Spriel
2011-07-18 14:29 ` [PATCH 06/19] staging: brcm80211: removed R_REG and OR_REG macro's from fullmac Arend van Spriel
2011-07-18 14:29 ` [PATCH 07/19] staging: brcm80211: removed global variable from sdio fullmac Arend van Spriel
2011-07-18 14:29 ` Arend van Spriel [this message]
2011-07-18 14:29 ` [PATCH 09/19] staging: brcm80211: remove private timeout functions in fullmac Arend van Spriel
2011-07-18 14:29 ` [PATCH 10/19] staging: brcm80211: move brcmf_mmc_suspend to sdio layer " Arend van Spriel
2011-07-18 14:29 ` [PATCH 11/19] staging: brcm80211: remove global wait queue head sdioh_spinwait_sleep Arend van Spriel
2011-07-18 14:29 ` [PATCH 12/19] staging: brcm80211: remove code for unsupported chip Arend van Spriel
2011-07-18 19:42   ` Dan Carpenter
2011-07-18 21:18     ` Franky Lin
2011-07-18 21:34       ` Pavel Roskin
2011-07-18 22:23         ` Franky Lin
2011-07-19  5:44         ` Dan Carpenter
2011-07-19 12:36           ` Pavel Roskin
2011-07-18 14:29 ` [PATCH 13/19] staging: brcm80211: get rid of sd debug message macro in fullmac Arend van Spriel
2011-07-18 14:30 ` [PATCH 14/19] staging: brcm80211: remove structure sdio_hc in brcmfmac Arend van Spriel
2011-07-18 14:30 ` [PATCH 15/19] staging: brcm80211: remove SDLX_MSG from brcmfmac Arend van Spriel
2011-07-18 14:30 ` [PATCH 16/19] staging: brcm80211: remove BRCMF_SD_* debug macros " Arend van Spriel
2011-07-18 14:30 ` [PATCH 17/19] staging: brcm80211: absorb brcmf_sdcard_attach into brcmf_sdio_probe Arend van Spriel
2011-07-18 14:30 ` [PATCH 18/19] staging: brcm80211: absorb brcmf_sdcard_detach into brcmf_sdio_remove Arend van Spriel
2011-07-18 14:30 ` [PATCH 19/19] staging: brcm80211: replace simple_strtoul usage in brcmfmac 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=1310999405-10062-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 \
    /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).