From 97bd7f26f631052ca27e3a1f4d8dcb10ffe89bf3 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 7 Apr 2026 09:00:01 +0200 Subject: [PATCH] EFI: move pre_parse() back next to get_value() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are siblings, so better would live close together. Sadly in 1f9540cd8eb6 ("EFI: move efi-boot.h inclusion point") I moved get_value() without also moving pre_parse(). Signed-off-by: Jan Beulich Acked-by: Marek Marczykowski-Górecki --- xen/common/efi/boot.c | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) 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;