From 6238b47b58480cd9c092600c05338dbe261b71ce Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 2 Aug 2010 21:03:46 -0700 Subject: x86, setup: move isdigit.h to ctype.h, header files on top. It is a subset of functionality, so name it ctype.h. Also, reorganize header files so #include statements are clustered near the top as they should be. Signed-off-by: H. Peter Anvin LKML-Reference: <4C5752F2.8030206@kernel.org> --- arch/x86/boot/ctype.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 arch/x86/boot/ctype.h (limited to 'arch/x86/boot/ctype.h') diff --git a/arch/x86/boot/ctype.h b/arch/x86/boot/ctype.h new file mode 100644 index 00000000000..25e13403193 --- /dev/null +++ b/arch/x86/boot/ctype.h @@ -0,0 +1,21 @@ +#ifndef BOOT_ISDIGIT_H + +#define BOOT_ISDIGIT_H + +static inline int isdigit(int ch) +{ + return (ch >= '0') && (ch <= '9'); +} + +static inline int isxdigit(int ch) +{ + if (isdigit(ch)) + return true; + + if ((ch >= 'a') && (ch <= 'f')) + return true; + + return (ch >= 'A') && (ch <= 'F'); +} + +#endif -- cgit v1.2.3