linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] arch/ppc: Replace custom macro with isdigit()
@ 2005-09-10 12:16 Tobias Klauser
  2005-09-10 13:26 ` Paul Mackerras
  2005-09-10 16:23 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Tobias Klauser @ 2005-09-10 12:16 UTC (permalink / raw)
  To: kernel-janitors; +Cc: akpm, linuxppc-dev

Replace the custom is_digit() macro with isdigit() from <linux/ctype.h>

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>

---

 arch/ppc/boot/common/misc-common.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff -urpN -X dontdiff linux-2.6.13/arch/ppc/boot/common/misc-common.c linux-2.6.13~macro_removal/arch/ppc/boot/common/misc-common.c
--- linux-2.6.13/arch/ppc/boot/common/misc-common.c	2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13~macro_removal/arch/ppc/boot/common/misc-common.c	2005-09-10 12:38:31.000000000 +0200
@@ -16,6 +16,7 @@
 
 #include <stdarg.h>	/* for va_ bits */
 #include <linux/config.h>
+#include <linux/ctype.h>
 #include <linux/string.h>
 #include <linux/zlib.h>
 #include "nonstdio.h"
@@ -301,8 +302,6 @@ _printk(char const *fmt, ...)
 	return;
 }
 
-#define is_digit(c) ((c >= '0') && (c <= '9'))
-
 void
 _vprintk(void(*putc)(const char), const char *fmt0, va_list ap)
 {
@@ -329,7 +328,7 @@ _vprintk(void(*putc)(const char), const 
 			{
 				zero_fill = FALSE;
 			}
-			while (is_digit(c))
+			while (isdigit(c))
 			{
 				left_prec = (left_prec * 10) + (c - '0');
 				c = *fmt0++;
@@ -338,7 +337,7 @@ _vprintk(void(*putc)(const char), const 
 			{
 				c = *fmt0++;
 				zero_fill++;
-				while (is_digit(c))
+				while (isdigit(c))
 				{
 					right_prec = (right_prec * 10) + (c - '0');
 					c = *fmt0++;

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

* Re: [PATCH 2/4] arch/ppc: Replace custom macro with isdigit()
  2005-09-10 12:16 [PATCH 2/4] arch/ppc: Replace custom macro with isdigit() Tobias Klauser
@ 2005-09-10 13:26 ` Paul Mackerras
  2005-09-10 16:23 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2005-09-10 13:26 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: akpm, kernel-janitors, linuxppc-dev, trini

Tobias Klauser writes:

> Replace the custom is_digit() macro with isdigit() from <linux/ctype.h>

NAK.  No point pulling in 256 bytes of _ctype array when all we use it
for is two '0' <= c <= '9' comparisons.

In fact Tom Rini maintains this code, so it's his opinion that counts.

Paul.

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

* Re: [PATCH 2/4] arch/ppc: Replace custom macro with isdigit()
  2005-09-10 12:16 [PATCH 2/4] arch/ppc: Replace custom macro with isdigit() Tobias Klauser
  2005-09-10 13:26 ` Paul Mackerras
@ 2005-09-10 16:23 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2005-09-10 16:23 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: akpm, kernel-janitors, linuxppc-dev

On Sat, Sep 10, 2005 at 02:16:33PM +0200, Tobias Klauser wrote:

> Replace the custom is_digit() macro with isdigit() from <linux/ctype.h>
> 
> Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>

NAK, in the boot code we don't want to be adding dependanies on external
things without good reason to.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

end of thread, other threads:[~2005-09-10 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-10 12:16 [PATCH 2/4] arch/ppc: Replace custom macro with isdigit() Tobias Klauser
2005-09-10 13:26 ` Paul Mackerras
2005-09-10 16:23 ` Tom Rini

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