From: Alexander Kuleshov <kuleshovmail@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Alexander Kuleshov <kuleshovmail@gmail.com>
Subject: [PATCH v2] x86,setup: Rename myisspace to isspace and move it to ctype.h
Date: Sat, 3 Jan 2015 13:10:05 +0600 [thread overview]
Message-ID: <1420269005-2290-1-git-send-email-kuleshovmail@gmail.com> (raw)
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
arch/x86/boot/cmdline.c | 19 +++++++------------
arch/x86/boot/ctype.h | 5 +++++
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/x86/boot/cmdline.c b/arch/x86/boot/cmdline.c
index 625d21b..bc1e25f 100644
--- a/arch/x86/boot/cmdline.c
+++ b/arch/x86/boot/cmdline.c
@@ -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;
}
diff --git a/arch/x86/boot/ctype.h b/arch/x86/boot/ctype.h
index 25e1340..eb909b5 100644
--- a/arch/x86/boot/ctype.h
+++ b/arch/x86/boot/ctype.h
@@ -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
--
2.2.1.202.g44ae4ee.dirty
next reply other threads:[~2015-01-03 7:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-03 7:10 Alexander Kuleshov [this message]
2015-01-03 12:05 ` [PATCH v2] x86,setup: Rename myisspace to isspace and move it to ctype.h Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420269005-2290-1-git-send-email-kuleshovmail@gmail.com \
--to=kuleshovmail@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox