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 <jbeulich@suse.com>
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -581,6 +581,31 @@ static char * __init split_string(char *
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 EF
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;