linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan <adobriyan@gmail.com>
Subject: [PATCH 03/45] kstrtox: convert arch/arm/
Date: Sun,  5 Dec 2010 19:49:00 +0200	[thread overview]
Message-ID: <1291571382-2719-3-git-send-email-adobriyan@gmail.com> (raw)
In-Reply-To: <1291571382-2719-1-git-send-email-adobriyan@gmail.com>

In arch/arm/mach-omap2/board-omap3touchbook.c:
remove "tbr" parameter, it's unused.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 arch/arm/mach-omap2/board-omap3touchbook.c |   11 -----------
 arch/arm/mach-omap2/mux.c                  |   15 ++++++---------
 arch/arm/mach-pxa/balloon3.c               |    2 +-
 arch/arm/mach-pxa/viper.c                  |    3 +--
 arch/arm/mach-s3c2412/mach-jive.c          |    2 +-
 arch/arm/mach-ux500/mbox.c                 |   27 ++++++++-------------------
 arch/arm/mach-w90x900/cpu.c                |    5 +++--
 arch/arm/plat-omap/mcbsp.c                 |    4 ++--
 8 files changed, 22 insertions(+), 47 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 41104bb..6e57bda 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -62,8 +62,6 @@
 #define TB_BL_PWM_TIMER		9
 #define TB_KILL_POWER_GPIO	168
 
-static unsigned long touchbook_revision;
-
 static struct mtd_partition omap3touchbook_nand_partitions[] = {
 	/* All the partition sizes are listed in terms of NAND block size */
 	{
@@ -495,15 +493,6 @@ static void omap3_touchbook_poweroff(void)
 	gpio_direction_output(TB_KILL_POWER_GPIO, 0);
 }
 
-static int __init early_touchbook_revision(char *p)
-{
-	if (!p)
-		return 0;
-
-	return strict_strtoul(p, 10, &touchbook_revision);
-}
-early_param("tbr", early_touchbook_revision);
-
 static struct omap_musb_board_data musb_board_data = {
 	.interface_type		= MUSB_INTERFACE_ULPI,
 	.mode			= MUSB_OTG,
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 074536a..5e2886d 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -336,7 +336,7 @@ static ssize_t omap_mux_dbg_signal_write(struct file *file,
 	char buf[OMAP_MUX_MAX_ARG_CHAR];
 	struct seq_file *seqf;
 	struct omap_mux *m;
-	unsigned long val;
+	u16 val;
 	int buf_size, ret;
 
 	if (count > OMAP_MUX_MAX_ARG_CHAR)
@@ -348,17 +348,14 @@ static ssize_t omap_mux_dbg_signal_write(struct file *file,
 	if (copy_from_user(buf, user_buf, buf_size))
 		return -EFAULT;
 
-	ret = strict_strtoul(buf, 0x10, &val);
+	ret = kstrtou16(buf, 0x10, &val);
 	if (ret < 0)
 		return ret;
 
-	if (val > 0xffff)
-		return -EINVAL;
-
 	seqf = file->private_data;
 	m = seqf->private;
 
-	omap_mux_write((u16)val, m->reg_offset);
+	omap_mux_write(val, m->reg_offset);
 	*ppos += count;
 
 	return count;
@@ -535,18 +532,18 @@ static void __init omap_mux_set_cmdline_signals(void)
 
 	while ((token = strsep(&next_opt, ",")) != NULL) {
 		char *keyval, *name;
-		unsigned long val;
 
 		keyval = token;
 		name = strsep(&keyval, "=");
 		if (name) {
+			u16 val;
 			int res;
 
-			res = strict_strtoul(keyval, 0x10, &val);
+			res = kstrtou16(keyval, 0x10, &val);
 			if (res < 0)
 				continue;
 
-			omap_mux_init_signal(name, (u16)val);
+			omap_mux_init_signal(name, val);
 		}
 	}
 
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 21e1889..3748d65 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -91,7 +91,7 @@ int __init parse_balloon3_features(char *arg)
 	if (!arg)
 		return 0;
 
-	return strict_strtoul(arg, 0, &balloon3_features_present);
+	return kstrtoul(arg, 0, &balloon3_features_present);
 }
 early_param("balloon3_features", parse_balloon3_features);
 
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 438fc9a..d99ee1b 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -767,8 +767,7 @@ static unsigned long viper_tpm;
 
 static int __init viper_tpm_setup(char *str)
 {
-	strict_strtoul(str, 10, &viper_tpm);
-	return 1;
+	return !kstrtoul(str, 10, &viper_tpm);
 }
 
 __setup("tpm=", viper_tpm_setup);
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 923e01b..a21b119 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -240,7 +240,7 @@ static int __init jive_mtdset(char *options)
 	if (options == NULL || options[0] == '\0')
 		return 0;
 
-	if (strict_strtoul(options, 10, &set)) {
+	if (kstrtoul(options, 10, &set)) {
 		printk(KERN_ERR "failed to parse mtdset=%s\n", options);
 		return 0;
 	}
diff --git a/arch/arm/mach-ux500/mbox.c b/arch/arm/mach-ux500/mbox.c
index 6343538..946a6f5 100644
--- a/arch/arm/mach-ux500/mbox.c
+++ b/arch/arm/mach-ux500/mbox.c
@@ -122,29 +122,18 @@ static ssize_t mbox_write_fifo(struct device *dev,
 			       const char *buf,
 			       size_t count)
 {
-	unsigned long mbox_mess;
-	unsigned long nbr_sends;
-	unsigned long i;
-	char int_buf[16];
-	char *token;
-	char *val;
-
 	struct mbox *mbox = (struct mbox *) dev->platform_data;
+	unsigned int mbox_mess, nbr_sends;
+	unsigned int i;
 
-	strncpy((char *) &int_buf, buf, sizeof(int_buf));
-	token = (char *) &int_buf;
-
-	/* Parse message */
-	val = strsep(&token, " ");
-	if ((val == NULL) || (strict_strtoul(val, 16, &mbox_mess) != 0))
-		mbox_mess = 0xDEADBEEF;
-
-	val = strsep(&token, " ");
-	if ((val == NULL) || (strict_strtoul(val, 10, &nbr_sends) != 0))
+	if (sscanf(buf, "%u %u", &mbox_mess, &nbr_sends) != 2) {
 		nbr_sends = 1;
+		if (sscanf(buf, "%u", &mbox_mess) != 1)
+			return -EINVAL;
+	}
 
-	dev_dbg(dev, "Will write 0x%lX %ld times using data struct at 0x%X\n",
-		mbox_mess, nbr_sends, (u32) mbox);
+	dev_dbg(dev, "Will write 0x%X %u times using data struct at %p\n",
+		mbox_mess, nbr_sends, mbox);
 
 	for (i = 0; i < nbr_sends; i++)
 		mbox_send(mbox, mbox_mess, true);
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c
index 83c5632..67f015c 100644
--- a/arch/arm/mach-w90x900/cpu.c
+++ b/arch/arm/mach-w90x900/cpu.c
@@ -170,12 +170,13 @@ static int __init nuc900_set_clkval(unsigned int cpufreq)
 }
 static int __init nuc900_set_cpufreq(char *str)
 {
-	unsigned long cpufreq, val;
+	unsigned int cpufreq, val;
 
 	if (!*str)
 		return 0;
 
-	strict_strtoul(str, 0, &cpufreq);
+	if (kstrtouint(str, 0, &cpufreq) < 0)
+		return 0;
 
 	nuc900_clock_source(NULL, "ext");
 
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index eac4b97..e049ad3 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -1483,10 +1483,10 @@ static ssize_t prop##_store(struct device *dev,				\
 				const char *buf, size_t size)		\
 {									\
 	struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);		\
-	unsigned long val;						\
+	u16 val;							\
 	int status;							\
 									\
-	status = strict_strtoul(buf, 0, &val);				\
+	status = kstrtou16(buf, 0, &val);				\
 	if (status)							\
 		return status;						\
 									\
-- 
1.7.2.2


  parent reply	other threads:[~2010-12-05 17:50 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-05 17:48 [PATCH 01/45] kstrtox: converting strings to integers done (hopefully) right Alexey Dobriyan
2010-12-05 17:48 ` [PATCH 02/45] kstrtox: convert arch/x86/ Alexey Dobriyan
2010-12-05 17:49 ` Alexey Dobriyan [this message]
2010-12-05 17:49 ` [PATCH 04/45] kstrtox: convert kernel/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 05/45] kstrtox: kernel/trace/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 06/45] kstrtox: convert mm/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 07/45] kstrtox: convert fs/fuse/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 08/45] kstrtox: convert fs/nfs/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 09/45] kstrtox: convert fs/proc/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 10/45] kstrtox: convert security/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 11/45] kstrtox: convert block/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 12/45] kstrtox: convert drivers/acpi/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 13/45] kstrtox: convert drivers/ata/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 14/45] kstrtox: convert drivers/base/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 15/45] kstrtox: convert drivers/block/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 16/45] kstrtox: convert drivers/bluetooth/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 17/45] kstrtox: convert drivers/clocksource/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 18/45] kstrtox: convert drivers/edac/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 19/45] kstrtox: convert drivers/gpio/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 20/45] kstrtox: convert drivers/gpu/drm/nouveau/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 21/45] kstrtox: convert drivers/hid/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 22/45] kstrtox: convert drivers/hwmon/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 23/45] kstrtox: convert drivers/ide/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 24/45] kstrtox: convert drivers/infiniband/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 25/45] kstrtox: convert drivers/input/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 26/45] kstrtox: convert drivers/isdn/ Alexey Dobriyan
2010-12-06  0:10   ` Tilman Schmidt
2010-12-06 20:10     ` Alexey Dobriyan
2010-12-07 10:06       ` Tilman Schmidt
2010-12-05 17:49 ` [PATCH 27/45] kstrtox: convert drivers/leds/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 28/45] kstrtox: convert drivers/md/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 29/45] kstrtox: convert drivers/mfd/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 30/45] kstrtox: convert drivers/misc/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 31/45] kstrtox: convert drivers/mmc/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 32/45] kstrtox: convert drivers/net/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 33/45] kstrtox: convert drivers/net/wireless/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 34/45] kstrtox: convert drivers/pci/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 35/45] kstrtox: convert drivers/platform/x86/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 36/45] kstrtox: convert drivers/power/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 37/45] kstrtox: convert drivers/regulator/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 38/45] kstrtox: convert drivers/rtc/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 39/45] kstrtox: convert drivers/scsi/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 40/45] kstrtox: convert drivers/ssb/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 41/45] kstrtox: convert drivers/usb/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 42/45] kstrtox: convert drivers/video/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 43/45] kstrtox: convert drivers/w1/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 44/45] kstrtox: convert sound/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 45/45] kstrtox: convert net/ Alexey Dobriyan
2010-12-06  0:25 ` [PATCH 01/45] kstrtox: converting strings to integers done (hopefully) right Jesper Juhl
2010-12-06 15:16   ` Alexey Dobriyan
2010-12-07  9:04     ` Arnd Bergmann
2010-12-07  9:32       ` Alexey Dobriyan
2010-12-07  9:45         ` Arnd Bergmann
2010-12-08  8:51           ` Alexey Dobriyan

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=1291571382-2719-3-git-send-email-adobriyan@gmail.com \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 03/45] kstrtox: convert arch/arm/' \
    /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

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox