Skip to content

Commit 6f673d8

Browse files
Tobias KlauserLinus Torvalds
authored andcommitted
[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>
1 parent 64ccd0c commit 6f673d8

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎arch/i386/kernel/reboot.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/mc146818rtc.h>
1212
#include <linux/efi.h>
1313
#include <linux/dmi.h>
14+
#include <linux/ctype.h>
1415
#include <asm/uaccess.h>
1516
#include <asm/apic.h>
1617
#include <asm/desc.h>
@@ -28,8 +29,6 @@ static int reboot_thru_bios;
2829

2930
#ifdef CONFIG_SMP
3031
static int reboot_cpu = -1;
31-
/* shamelessly grabbed from lib/vsprintf.c for readability */
32-
#define is_digit(c) ((c) >= '0' && (c) <= '9')
3332
#endif
3433
static int __init reboot_setup(char *str)
3534
{
@@ -49,9 +48,9 @@ static int __init reboot_setup(char *str)
4948
break;
5049
#ifdef CONFIG_SMP
5150
case 's': /* "smp" reboot by executing reset on BSP or other CPU*/
52-
if (is_digit(*(str+1))) {
51+
if (isdigit(*(str+1))) {
5352
reboot_cpu = (int) (*(str+1) - '0');
54-
if (is_digit(*(str+2)))
53+
if (isdigit(*(str+2)))
5554
reboot_cpu = reboot_cpu*10 + (int)(*(str+2) - '0');
5655
}
5756
/* we will leave sorting out the final value

0 commit comments

Comments
 (0)