summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-11-27 14:47:32 +0100
committerMike Yuan <me@yhndnzj.com>2024-11-27 14:49:09 +0100
commit9a1276e0a26b9a42f4836658d9c22d101eb495a1 (patch)
treeaf41d66045de00914cfb240f657a404edbe4e2d9 /src/shared
parentshared/bootspec: use FOREACH_ELEMENT where appropriate, avoid unneeded memzero() (diff)
downloadsystemd-9a1276e0a26b9a42f4836658d9c22d101eb495a1.tar.xz
systemd-9a1276e0a26b9a42f4836658d9c22d101eb495a1.zip
shared/bootspec: mark _to_string funcs as _const_
Addresses https://github.com/systemd/systemd/pull/34959#discussion_r1860451777
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/bootspec.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h
index 6dda8549a1..95675214b2 100644
--- a/src/shared/bootspec.h
+++ b/src/shared/bootspec.h
@@ -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);
}