Skip to contentSkip to conversation

x86,setup: Rename myisspace to isspace and move it to ctype.h

PATCH Superseded Alexander Kuleshov 1 participant 1 message Jan 3, 2015 x86

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86,setup: Rename myisspace to isspace and move it to ctype.h

isspace is a subset of ctype.h functionality, so move it to ctype.h

---
 arch/x86/boot/cmdline.c | 19 +++++++------------
 arch/x86/boot/ctype.h   |  9 +++++++--
 2 files changed, 14 insertions(+), 14 deletions(-)
arch/x86/boot/cmdline.c +7 -12
index 625d21b..bc1e25f 100644
@@ -14,11 +14,6 @@
 
 #include "boot.h"
 
-static inline int myisspace(u8 c)
-{
-	return c <= ' ';	/* Close enough approximation */
-}
-
 /*
  * Find a non-boolean option, that is, "option=argument".  In accordance
  * with standard Linux practice, if this option is repeated, this returns
@@ -50,7 +45,7 @@ int __cmdline_find_option(unsigned long cmdline_ptr, const char *option, char *b
 	while (cptr < 0x10000 && (c = rdfs8(cptr++))) {
 		switch (state) {
 		case st_wordstart:
-			if (myisspace(c))
+			if (isspace(c))
 				break;
 
 			/* else */
@@ -63,7 +58,7 @@ int __cmdline_find_option(unsigned long cmdline_ptr, const char *option, char *b
 				len = 0;
 				bufptr = buffer;
 				state = st_bufcpy;
-			} else if (myisspace(c)) {
+			} else if (isspace(c)) {
 				state = st_wordstart;
 			} else if (c != *opptr++) {
 				state = st_wordskip;
@@ -71,12 +66,12 @@ int __cmdline_find_option(unsigned long cmdline_ptr, const char *option, char *b
 			break;
 
 		case st_wordskip:
-			if (myisspace(c))
+			if (isspace(c))
 				state = st_wordstart;
 			break;
 
 		case st_bufcpy:
-			if (myisspace(c)) {
+			if (isspace(c)) {
 				state = st_wordstart;
 			} else {
 				if (len < bufsize-1)
@@ -125,7 +120,7 @@ int __cmdline_find_option_bool(unsigned long cmdline_ptr, const char *option)
 		case st_wordstart:
 			if (!c)
 				return 0;
-			else if (myisspace(c))
+			else if (isspace(c))
 				break;
 
 			state = st_wordcmp;
@@ -135,7 +130,7 @@ int __cmdline_find_option_bool(unsigned long cmdline_ptr, const char *option)
 
 		case st_wordcmp:
 			if (!*opptr)
-				if (!c || myisspace(c))
+				if (!c || isspace(c))
 					return wstart;
 				else
 					state = st_wordskip;
@@ -148,7 +143,7 @@ int __cmdline_find_option_bool(unsigned long cmdline_ptr, const char *option)
 		case st_wordskip:
 			if (!c)
 				return 0;
-			else if (myisspace(c))
+			else if (isspace(c))
 				state = st_wordstart;
 			break;
 		}
arch/x86/boot/ctype.h +7 -2
index 25e1340..c172741 100644
@@ -1,6 +1,6 @@
-#ifndef BOOT_ISDIGIT_H
+#ifndef BOOT_CTYPE_H
 
-#define BOOT_ISDIGIT_H
+#define BOOT_CTYPE_H
 
 static inline int isdigit(int ch)
 {
@@ -18,4 +18,9 @@ static inline int isxdigit(int ch)
 	return (ch >= 'A') && (ch <= 'F');
 }
 
+static inline int isspace(u8 c)
+{
+	return c <= ' ';	/* Close enough approximation */
+}
+
 #endif
Signature · 1 line
2.2.1.202.g44ae4ee.dirty