linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] x86: pass in size to early cmdline parsing
@ 2015-12-17 22:00 Dave Hansen
  2015-12-17 22:00 ` [PATCH 2/5] x86: test early command-line code Dave Hansen
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dave Hansen @ 2015-12-17 22:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dave Hansen, dave.hansen, bp, hpa, fenghua.yu, yu-cheng.yu


From: Dave Hansen <dave.hansen@linux.intel.com>

We will use this in a few patches to implement tests for early
parsing.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Cc: fenghua.yu@intel.com
Cc: yu-cheng.yu@intel.com
---

 b/arch/x86/lib/cmdline.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff -puN arch/x86/lib/cmdline.c~pass-in-cmdline-size arch/x86/lib/cmdline.c
--- a/arch/x86/lib/cmdline.c~pass-in-cmdline-size	2015-12-17 13:54:52.534928192 -0800
+++ b/arch/x86/lib/cmdline.c	2015-12-17 13:54:52.537928328 -0800
@@ -23,7 +23,8 @@ static inline int myisspace(u8 c)
  * Returns the position of that @option (starts counting with 1)
  * or 0 on not found.
  */
-int cmdline_find_option_bool(const char *cmdline, const char *option)
+static int __cmdline_find_option_bool(const char *cmdline,
+		int max_cmdline_size, const char *option)
 {
 	char c;
 	int len, pos = 0, wstart = 0;
@@ -37,7 +38,7 @@ int cmdline_find_option_bool(const char
 	if (!cmdline)
 		return -1;      /* No command line */
 
-	len = min_t(int, strlen(cmdline), COMMAND_LINE_SIZE);
+	len = min_t(int, strlen(cmdline), max_cmdline_size);
 	if (!len)
 		return 0;
 
@@ -82,3 +83,9 @@ int cmdline_find_option_bool(const char
 
 	return 0;	/* Buffer overrun */
 }
+
+int cmdline_find_option_bool(const char *cmdline, const char *option)
+{
+	return __cmdline_find_option_bool(cmdline, COMMAND_LINE_SIZE,
+			option);
+}
_

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-18  2:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 22:00 [PATCH 1/5] x86: pass in size to early cmdline parsing Dave Hansen
2015-12-17 22:00 ` [PATCH 2/5] x86: test early command-line code Dave Hansen
2015-12-17 22:44   ` kbuild test robot
2015-12-18  2:03   ` kbuild test robot
2015-12-17 22:00 ` [PATCH 3/5] x86: fix early command-line parsing when matching at end Dave Hansen
2015-12-17 22:00 ` [PATCH 4/5] x86: fix early command-line parsing, when partial word match Dave Hansen
2015-12-17 22:01 ` [PATCH 5/5] x86: simplify early command line parsing Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).