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/boot.h | 3 +-- arch/x86/boot/compressed/misc.h | 1 + arch/x86/boot/compressed/string.c | 2 -- arch/x86/boot/ctype.h | 21 +++++++++++++++++++++ arch/x86/boot/isdigit.h | 21 --------------------- 5 files changed, 23 insertions(+), 25 deletions(-) create mode 100644 arch/x86/boot/ctype.h delete mode 100644 arch/x86/boot/isdigit.h (limited to 'arch/x86/boot') diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index 00cf51c..c7093bd 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h @@ -28,6 +28,7 @@ #include "bitops.h" #include #include +#include "ctype.h" /* Useful macros */ #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) @@ -200,8 +201,6 @@ static inline int memcmp_gs(const void *s1, addr_t s2, size_t len) return diff; } -#include "isdigit.h" - /* Heap -- available for dynamic lists. */ extern char _end[]; extern char *HEAP; diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h index a267849..3f19c81 100644 --- a/arch/x86/boot/compressed/misc.h +++ b/arch/x86/boot/compressed/misc.h @@ -20,6 +20,7 @@ #include #define BOOT_BOOT_H +#include "../ctype.h" /* misc.c */ extern struct boot_params *real_mode; /* Pointer to real-mode data */ diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c index 7995c6a..19b3e69 100644 --- a/arch/x86/boot/compressed/string.c +++ b/arch/x86/boot/compressed/string.c @@ -1,4 +1,2 @@ #include "misc.h" - -#include "../isdigit.h" #include "../string.c" diff --git a/arch/x86/boot/ctype.h b/arch/x86/boot/ctype.h new file mode 100644 index 0000000..25e1340 --- /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 diff --git a/arch/x86/boot/isdigit.h b/arch/x86/boot/isdigit.h deleted file mode 100644 index 25e1340..0000000 --- a/arch/x86/boot/isdigit.h +++ /dev/null @@ -1,21 +0,0 @@ -#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.1