diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index fa2e4abf00..0ddc7bfd12 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -581,6 +581,31 @@ static char * __init split_string(char *s) return NULL; } +static void __init pre_parse(const struct file *file) +{ + char *ptr = file->str, *end = ptr + file->size; + bool start = true, comment = false; + + for ( ; ptr < end; ++ptr ) + { + if ( iscntrl(*ptr) ) + { + comment = false; + start = true; + *ptr = 0; + } + else if ( comment || (start && isspace(*ptr)) ) + *ptr = 0; + else if ( *ptr == '#' || (start && *ptr == ';') ) + { + comment = true; + *ptr = 0; + } + else + start = 0; + } +} + static char *__init get_value(const struct file *file, const char *section, const char *item) { @@ -904,31 +929,6 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image, return true; } -static void __init pre_parse(const struct file *file) -{ - char *ptr = file->str, *end = ptr + file->size; - bool start = true, comment = false; - - for ( ; ptr < end; ++ptr ) - { - if ( iscntrl(*ptr) ) - { - comment = false; - start = true; - *ptr = 0; - } - else if ( comment || (start && isspace(*ptr)) ) - *ptr = 0; - else if ( *ptr == '#' || (start && *ptr == ';') ) - { - comment = true; - *ptr = 0; - } - else - start = 0; - } -} - static void __init init_secure_boot_mode(void) { static EFI_GUID __initdata gv_uuid = EFI_GLOBAL_VARIABLE;