diff options
author | Dave Young <dyoung@redhat.com> | 2014-08-14 13:15:27 +0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-10-03 21:40:58 +0400 |
commit | 6ccc72b87b83ece31c2a75bbe07f440b0378f7a9 (patch) | |
tree | 777aaf2d1e492963dc65bff61c236edb31532650 /arch/x86/platform/efi/efi.c | |
parent | b2e0a54a1296a91b800f316df7bef7d1905e4fd0 (diff) | |
download | linux-6ccc72b87b83ece31c2a75bbe07f440b0378f7a9.tar.xz |
lib: Add a generic cmdline parse function parse_option_str
There should be a generic function to parse params like a=b,c
Adding parse_option_str in lib/cmdline.c which will return true
if there's specified option set in the params.
Also updated efi=old_map parsing code to use the new function
Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/platform/efi/efi.c')
-rw-r--r-- | arch/x86/platform/efi/efi.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index c90d3cd2728c..c73a7df5d37f 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -932,26 +932,8 @@ u64 efi_mem_attributes(unsigned long phys_addr) static int __init parse_efi_cmdline(char *str) { - if (*str == '=') - str++; - - while (*str) { - if (!strncmp(str, "old_map", 7)) { - set_bit(EFI_OLD_MEMMAP, &efi.flags); - str += strlen("old_map"); - } - - /* - * Skip any options we don't understand. Presumably - * they apply to the EFI boot stub. - */ - while (*str && *str != ',') - str++; - - /* If we hit a delimiter, skip it */ - if (*str == ',') - str++; - } + if (parse_option_str(str, "old_map")) + set_bit(EFI_OLD_MEMMAP, &efi.flags); return 0; } |