From: Lennart Poettering Date: Mon, 7 Jul 2025 16:26:59 +0000 (+0200) Subject: bootspec: boot_entry_source_to_json_string() to boot_entry_source_to_string() X-Git-Tag: v258-rc1~145^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F38106%2Fhead;p=thirdparty%2Fsystemd.git bootspec: boot_entry_source_to_json_string() to boot_entry_source_to_string() As with the previous changes for BootEntryType, let's also clean up the naming for BootEntrySource. --- diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 30d566e529e..7788d655163 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -57,12 +57,12 @@ static const char* const boot_entry_source_description_table[_BOOT_ENTRY_SOURCE_ DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source_description, BootEntrySource); -static const char* const boot_entry_source_json_table[_BOOT_ENTRY_SOURCE_MAX] = { +static const char* const boot_entry_source_table[_BOOT_ENTRY_SOURCE_MAX] = { [BOOT_ENTRY_ESP] = "esp", [BOOT_ENTRY_XBOOTLDR] = "xbootldr", }; -DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source_json, BootEntrySource); +DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source, BootEntrySource); static void boot_entry_addons_done(BootEntryAddons *addons) { assert(addons); @@ -1943,7 +1943,7 @@ int boot_entry_to_json(const BootConfig *c, size_t i, sd_json_variant **ret) { r = sd_json_variant_merge_objectbo( &v, SD_JSON_BUILD_PAIR("type", SD_JSON_BUILD_STRING(boot_entry_type_to_string(e->type))), - SD_JSON_BUILD_PAIR("source", SD_JSON_BUILD_STRING(boot_entry_source_json_to_string(e->source))), + SD_JSON_BUILD_PAIR("source", SD_JSON_BUILD_STRING(boot_entry_source_to_string(e->source))), SD_JSON_BUILD_PAIR_CONDITION(!!e->id, "id", SD_JSON_BUILD_STRING(e->id)), SD_JSON_BUILD_PAIR_CONDITION(!!e->path, "path", SD_JSON_BUILD_STRING(e->path)), SD_JSON_BUILD_PAIR_CONDITION(!!e->root, "root", SD_JSON_BUILD_STRING(e->root)), diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index bf4ecb33479..dd192b47228 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -95,7 +95,7 @@ const char* boot_entry_type_description_to_string(BootEntryType) _const_; const char* boot_entry_type_to_string(BootEntryType) _const_; const char* boot_entry_source_description_to_string(BootEntrySource) _const_; -const char* boot_entry_source_json_to_string(BootEntrySource) _const_; +const char* boot_entry_source_to_string(BootEntrySource) _const_; BootEntry* boot_config_find_entry(BootConfig *config, const char *id);