public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] arch/mips/alchemy: change strict_strtol to strict_strtoul
@ 2008-11-25 13:12 Julia Lawall
  2008-11-25 16:00 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2008-11-25 13:12 UTC (permalink / raw)
  To: ralf, linux-mips, linux-kernel, kernel-janitors

From: Julia Lawall <julia@diku.dk>

Since memsize is unsigned, it would seem better to use strict_strtoul that
strict_strtol.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@s2@
long e;
position p;
@@

strict_strtol@p(...,&e)

@@
position p != s2.p;
type T;
T e;
@@

- strict_strtol@p
+ strict_strtoul
  (...,&e)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---

 arch/mips/alchemy/db1x00/init.c  |    2 +-
 arch/mips/alchemy/mtx-1/init.c   |    2 +-
 arch/mips/alchemy/pb1000/init.c  |    2 +-
 arch/mips/alchemy/pb1100/init.c  |    2 +-
 arch/mips/alchemy/pb1200/init.c  |    2 +-
 arch/mips/alchemy/pb1500/init.c  |    2 +-
 arch/mips/alchemy/pb1550/init.c  |    2 +-
 arch/mips/alchemy/xxs1500/init.c |    2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff -u -p a/arch/mips/alchemy/db1x00/init.c b/arch/mips/alchemy/db1x00/init.c
--- a/arch/mips/alchemy/db1x00/init.c
+++ b/arch/mips/alchemy/db1x00/init.c
@@ -57,6 +57,6 @@ void __init prom_init(void)
 	if (!memsize_str)
 		memsize = 0x04000000;
 	else
-		strict_strtol(memsize_str, 0, &memsize);
+		strict_strtoul(memsize_str, 0, &memsize);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
diff -u -p a/arch/mips/alchemy/mtx-1/init.c b/arch/mips/alchemy/mtx-1/init.c
--- a/arch/mips/alchemy/mtx-1/init.c
+++ b/arch/mips/alchemy/mtx-1/init.c
@@ -55,6 +55,6 @@ void __init prom_init(void)
 	if (!memsize_str)
 		memsize = 0x04000000;
 	else
-		strict_strtol(memsize_str, 0, &memsize);
+		strict_strtoul(memsize_str, 0, &memsize);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
diff -u -p a/arch/mips/alchemy/pb1000/init.c b/arch/mips/alchemy/pb1000/init.c
--- a/arch/mips/alchemy/pb1000/init.c
+++ b/arch/mips/alchemy/pb1000/init.c
@@ -52,6 +52,6 @@ void __init prom_init(void)
 	if (!memsize_str)
 		memsize = 0x04000000;
 	else
-		strict_strtol(memsize_str, 0, &memsize);
+		strict_strtoul(memsize_str, 0, &memsize);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
diff -u -p a/arch/mips/alchemy/pb1100/init.c b/arch/mips/alchemy/pb1100/init.c
--- a/arch/mips/alchemy/pb1100/init.c
+++ b/arch/mips/alchemy/pb1100/init.c
@@ -54,7 +54,7 @@ void __init prom_init(void)
 	if (!memsize_str)
 		memsize = 0x04000000;
 	else
-		strict_strtol(memsize_str, 0, &memsize);
+		strict_strtoul(memsize_str, 0, &memsize);
 
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
diff -u -p a/arch/mips/alchemy/pb1200/init.c b/arch/mips/alchemy/pb1200/init.c
--- a/arch/mips/alchemy/pb1200/init.c
+++ b/arch/mips/alchemy/pb1200/init.c
@@ -53,6 +53,6 @@ void __init prom_init(void)
 	if (!memsize_str)
 		memsize = 0x08000000;
 	else
-		strict_strtol(memsize_str, 0, &memsize);
+		strict_strtoul(memsize_str, 0, &memsize);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
diff -u -p a/arch/mips/alchemy/pb1500/init.c b/arch/mips/alchemy/pb1500/init.c
--- a/arch/mips/alchemy/pb1500/init.c
+++ b/arch/mips/alchemy/pb1500/init.c
@@ -53,6 +53,6 @@ void __init prom_init(void)
 	if (!memsize_str)
 		memsize = 0x04000000;
 	else
-		strict_strtol(memsize_str, 0, &memsize);
+		strict_strtoul(memsize_str, 0, &memsize);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
diff -u -p a/arch/mips/alchemy/pb1550/init.c b/arch/mips/alchemy/pb1550/init.c
--- a/arch/mips/alchemy/pb1550/init.c
+++ b/arch/mips/alchemy/pb1550/init.c
@@ -53,6 +53,6 @@ void __init prom_init(void)
 	if (!memsize_str)
 		memsize = 0x08000000;
 	else
-		strict_strtol(memsize_str, 0, &memsize);
+		strict_strtoul(memsize_str, 0, &memsize);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
diff -u -p a/arch/mips/alchemy/xxs1500/init.c b/arch/mips/alchemy/xxs1500/init.c
--- a/arch/mips/alchemy/xxs1500/init.c
+++ b/arch/mips/alchemy/xxs1500/init.c
@@ -53,6 +53,6 @@ void __init prom_init(void)
 	if (!memsize_str)
 		memsize = 0x04000000;
 	else
-		strict_strtol(memsize_str, 0, &memsize);
+		strict_strtoul(memsize_str, 0, &memsize);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/5] arch/mips/alchemy: change strict_strtol to strict_strtoul
  2008-11-25 13:12 [PATCH 1/5] arch/mips/alchemy: change strict_strtol to strict_strtoul Julia Lawall
@ 2008-11-25 16:00 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2008-11-25 16:00 UTC (permalink / raw)
  To: Julia Lawall; +Cc: linux-mips, linux-kernel, kernel-janitors

On Tue, Nov 25, 2008 at 02:12:32PM +0100, Julia Lawall wrote:

> Since memsize is unsigned, it would seem better to use strict_strtoul that
> strict_strtol.

Thanks, applied.

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-25 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-25 13:12 [PATCH 1/5] arch/mips/alchemy: change strict_strtol to strict_strtoul Julia Lawall
2008-11-25 16:00 ` Ralf Baechle

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