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 ...
This commit is contained in:
@@ -160,3 +160,32 @@ unsigned long long memparse(const char *ptr, char **retptr)
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(memparse);
|
||||
|
||||
/**
|
||||
* parse_option_str - Parse a string and check an option is set or not
|
||||
* @str: String to be parsed
|
||||
* @option: option name
|
||||
*
|
||||
* This function parses a string containing a comma-separated list of
|
||||
* strings like a=b,c.
|
||||
*
|
||||
* Return true if there's such option in the string, or return false.
|
||||
*/
|
||||
bool parse_option_str(const char *str, const char *option)
|
||||
{
|
||||
while (*str) {
|
||||
if (!strncmp(str, option, strlen(option))) {
|
||||
str += strlen(option);
|
||||
if (!*str || *str == ',')
|
||||
return true;
|
||||
}
|
||||
|
||||
while (*str && *str != ',')
|
||||
str++;
|
||||
|
||||
if (*str == ',')
|
||||
str++;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user