linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* powerpc: delete prom_strtoul and prom_memparse
@ 2008-10-21  4:03 Milton Miller
  2008-10-21  6:17 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Milton Miller @ 2008-10-21  4:03 UTC (permalink / raw)
  To: Ben Herrenschmidt; +Cc: linuxppc-dev

These functions should have been static, and inspection shows they
are no longer used.   (We used to parse mem= but we now defer that
to early_param).

Signed-off-by: Milton Miller <miltonm@bga.com>
---
This version removes them

Index: next.git/arch/powerpc/kernel/prom_init.c
===================================================================
--- next.git.orig/arch/powerpc/kernel/prom_init.c	2008-10-20 17:51:15.000000000 -0500
+++ next.git/arch/powerpc/kernel/prom_init.c	2008-10-20 22:40:16.000000000 -0500
@@ -487,67 +487,6 @@ static int __init prom_setprop(phandle n
 	return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd);
 }
 
-/* We can't use the standard versions because of RELOC headaches. */
-#define isxdigit(c)	(('0' <= (c) && (c) <= '9') \
-			 || ('a' <= (c) && (c) <= 'f') \
-			 || ('A' <= (c) && (c) <= 'F'))
-
-#define isdigit(c)	('0' <= (c) && (c) <= '9')
-#define islower(c)	('a' <= (c) && (c) <= 'z')
-#define toupper(c)	(islower(c) ? ((c) - 'a' + 'A') : (c))
-
-unsigned long prom_strtoul(const char *cp, const char **endp)
-{
-	unsigned long result = 0, base = 10, value;
-
-	if (*cp == '0') {
-		base = 8;
-		cp++;
-		if (toupper(*cp) == 'X') {
-			cp++;
-			base = 16;
-		}
-	}
-
-	while (isxdigit(*cp) &&
-	       (value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) {
-		result = result * base + value;
-		cp++;
-	}
-
-	if (endp)
-		*endp = cp;
-
-	return result;
-}
-
-unsigned long prom_memparse(const char *ptr, const char **retptr)
-{
-	unsigned long ret = prom_strtoul(ptr, retptr);
-	int shift = 0;
-
-	/*
-	 * We can't use a switch here because GCC *may* generate a
-	 * jump table which won't work, because we're not running at
-	 * the address we're linked at.
-	 */
-	if ('G' == **retptr || 'g' == **retptr)
-		shift = 30;
-
-	if ('M' == **retptr || 'm' == **retptr)
-		shift = 20;
-
-	if ('K' == **retptr || 'k' == **retptr)
-		shift = 10;
-
-	if (shift) {
-		ret <<= shift;
-		(*retptr)++;
-	}
-
-	return ret;
-}
-
 /*
  * Early parsing of the command line passed to the kernel, used for
  * "mem=x" and the options that affect the iommu

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

* Re: powerpc: delete prom_strtoul and prom_memparse
  2008-10-21  4:03 powerpc: delete prom_strtoul and prom_memparse Milton Miller
@ 2008-10-21  6:17 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2008-10-21  6:17 UTC (permalink / raw)
  To: Milton Miller; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

On Mon, 2008-10-20 at 23:03 -0500, Milton Miller wrote:
> These functions should have been static, and inspection shows they
> are no longer used.   (We used to parse mem= but we now defer that
> to early_param).

Actually the last user was the crashkernel= handling, but that was
removed a while ago too, my bad.

Acked-by: Michael Ellerman <michael@ellerman.id.au>

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2008-10-21  6:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-21  4:03 powerpc: delete prom_strtoul and prom_memparse Milton Miller
2008-10-21  6:17 ` Michael Ellerman

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).