mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 2/6] s390: xpram module parameter parsing - take 2.
@ 2006-07-18 11:53 Martin Schwidefsky
  0 siblings, 0 replies; only message in thread
From: Martin Schwidefsky @ 2006-07-18 11:53 UTC (permalink / raw)
  To: linux-kernel, heiko.carstens

From: Heiko Carstens <heiko.carstens@de.ibm.com>

[S390] xpram module parameter parsing - take 2.

Don't use memparse since the default size modifier is 'k'.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 drivers/s390/block/xpram.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff -urpN linux-2.6/drivers/s390/block/xpram.c linux-2.6-patched/drivers/s390/block/xpram.c
--- linux-2.6/drivers/s390/block/xpram.c	2006-07-18 13:40:28.000000000 +0200
+++ linux-2.6-patched/drivers/s390/block/xpram.c	2006-07-18 13:40:43.000000000 +0200
@@ -304,6 +304,7 @@ static int __init xpram_setup_sizes(unsi
 {
 	unsigned long mem_needed;
 	unsigned long mem_auto;
+	unsigned long long size;
 	int mem_auto_no;
 	int i;
 
@@ -321,9 +322,19 @@ static int __init xpram_setup_sizes(unsi
 	mem_needed = 0;
 	mem_auto_no = 0;
 	for (i = 0; i < xpram_devs; i++) {
-		if (sizes[i])
-			xpram_sizes[i] =
-				(memparse(sizes[i], &sizes[i]) + 3) & -4UL;
+		if (sizes[i]) {
+			size = simple_strtoull(sizes[i], &sizes[i], 0);
+			switch (sizes[i][0]) {
+			case 'g':
+			case 'G':
+				size <<= 20;
+				break;
+			case 'm':
+			case 'M':
+				size <<= 10;
+			}
+			xpram_sizes[i] = (size + 3) & -4UL;
+		}
 		if (xpram_sizes[i])
 			mem_needed += xpram_sizes[i];
 		else

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-18 11:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-18 11:53 [patch 2/6] s390: xpram module parameter parsing - take 2 Martin Schwidefsky

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

all inboxes | Powered by JetHome®