Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] arch/i386: Replace custom macro with isdigit()

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

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Tobias Klauser and committed by
Linus Torvalds
6f673d83 64ccd0cf

+3 -4
+3 -4
arch/i386/kernel/reboot.c
··· 11 11 #include <linux/mc146818rtc.h> 12 12 #include <linux/efi.h> 13 13 #include <linux/dmi.h> 14 + #include <linux/ctype.h> 14 15 #include <asm/uaccess.h> 15 16 #include <asm/apic.h> 16 17 #include <asm/desc.h> ··· 29 28 30 29 #ifdef CONFIG_SMP 31 30 static int reboot_cpu = -1; 32 - /* shamelessly grabbed from lib/vsprintf.c for readability */ 33 - #define is_digit(c) ((c) >= '0' && (c) <= '9') 34 31 #endif 35 32 static int __init reboot_setup(char *str) 36 33 { ··· 48 49 break; 49 50 #ifdef CONFIG_SMP 50 51 case 's': /* "smp" reboot by executing reset on BSP or other CPU*/ 51 - if (is_digit(*(str+1))) { 52 + if (isdigit(*(str+1))) { 52 53 reboot_cpu = (int) (*(str+1) - '0'); 53 - if (is_digit(*(str+2))) 54 + if (isdigit(*(str+2))) 54 55 reboot_cpu = reboot_cpu*10 + (int)(*(str+2) - '0'); 55 56 } 56 57 /* we will leave sorting out the final value