diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-23 17:45:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-23 17:45:09 -0400 |
commit | 8c81f48e16fbe103e682d7ee7b2f16d065c42954 (patch) | |
tree | 1eac3abf36ed9330b3d5f9e550d1ccbc0c174f9b /lib | |
parent | 5de551e0eeddf470928e9fee59825a3645641bc7 (diff) | |
parent | 75b128573b275d5a5a7210b98c4b8cb3b39c12e7 (diff) |
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 EFI updates from Peter Anvin:
"This patchset falls under the "maintainers that grovel" clause in the
v3.18-rc1 announcement. We had intended to push it late in the merge
window since we got it into the -tip tree relatively late.
Many of these are relatively simple things, but there are a couple of
key bits, especially Ard's and Matt's patches"
* 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
rtc: Disable EFI rtc for x86
efi: rtc-efi: Export platform:rtc-efi as module alias
efi: Delete the in_nmi() conditional runtime locking
efi: Provide a non-blocking SetVariable() operation
x86/efi: Adding efi_printks on memory allocationa and pci.reads
x86/efi: Mark initialization code as such
x86/efi: Update comment regarding required phys mapped EFI services
x86/efi: Unexport add_efi_memmap variable
x86/efi: Remove unused efi_call* macros
efi: Resolve some shadow warnings
arm64: efi: Format EFI memory type & attrs with efi_md_typeattr_format()
ia64: efi: Format EFI memory type & attrs with efi_md_typeattr_format()
x86: efi: Format EFI memory type & attrs with efi_md_typeattr_format()
efi: Introduce efi_md_typeattr_format()
efi: Add macro for EFI_MEMORY_UCE memory attribute
x86/efi: Clear EFI_RUNTIME_SERVICES if failing to enter virtual mode
arm64/efi: Do not enter virtual mode if booting with efi=noruntime or noefi
arm64/efi: uefi_init error handling fix
efi: Add kernel param efi=noruntime
lib: Add a generic cmdline parse function parse_option_str
...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cmdline.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/cmdline.c b/lib/cmdline.c index 76a712e6e20e..8f13cf73c2ec 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c | |||
@@ -160,3 +160,32 @@ unsigned long long memparse(const char *ptr, char **retptr) | |||
160 | return ret; | 160 | return ret; |
161 | } | 161 | } |
162 | EXPORT_SYMBOL(memparse); | 162 | EXPORT_SYMBOL(memparse); |
163 | |||
164 | /** | ||
165 | * parse_option_str - Parse a string and check an option is set or not | ||
166 | * @str: String to be parsed | ||
167 | * @option: option name | ||
168 | * | ||
169 | * This function parses a string containing a comma-separated list of | ||
170 | * strings like a=b,c. | ||
171 | * | ||
172 | * Return true if there's such option in the string, or return false. | ||
173 | */ | ||
174 | bool parse_option_str(const char *str, const char *option) | ||
175 | { | ||
176 | while (*str) { | ||
177 | if (!strncmp(str, option, strlen(option))) { | ||
178 | str += strlen(option); | ||
179 | if (!*str || *str == ',') | ||
180 | return true; | ||
181 | } | ||
182 | |||
183 | while (*str && *str != ',') | ||
184 | str++; | ||
185 | |||
186 | if (*str == ',') | ||
187 | str++; | ||
188 | } | ||
189 | |||
190 | return false; | ||
191 | } | ||