]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/bootspec: mark _to_string funcs as _const_ 35381/head
authorMike Yuan <me@yhndnzj.com>
Wed, 27 Nov 2024 13:47:32 +0000 (14:47 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 27 Nov 2024 13:49:09 +0000 (14:49 +0100)
Addresses https://github.com/systemd/systemd/pull/34959#discussion_r1860451777

src/shared/bootspec.h

index 6dda8549a1b608f0944f92d4588faf62283c8079..95675214b2ad0866605eb0ddf800878eed7d4078 100644 (file)
@@ -98,11 +98,11 @@ typedef struct BootConfig {
                 .selected_entry = -1, \
         }
 
-const char* boot_entry_type_to_string(BootEntryType);
-const char* boot_entry_type_json_to_string(BootEntryType);
+const char* boot_entry_type_to_string(BootEntryType) _const_;
+const char* boot_entry_type_json_to_string(BootEntryType) _const_;
 
-const char* boot_entry_source_to_string(BootEntrySource);
-const char* boot_entry_source_json_to_string(BootEntrySource);
+const char* boot_entry_source_to_string(BootEntrySource) _const_;
+const char* boot_entry_source_json_to_string(BootEntrySource) _const_;
 
 BootEntry* boot_config_find_entry(BootConfig *config, const char *id);
 
@@ -137,7 +137,6 @@ int boot_config_select_special_entries(BootConfig *config, bool skip_efivars);
 
 static inline const char* boot_entry_title(const BootEntry *entry) {
         assert(entry);
-
         return ASSERT_PTR(entry->show_title ?: entry->title ?: entry->id);
 }