Skip to content

Commit d93ee05

Browse files
t-8chjpoimboe
authored andcommitted
objtool: Make struct entries[] static and const
This data is not modified and not used outside of special.c. Also adapt its users to the constness. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20221216-objtool-memory-v2-1-17968f85a464@weissschuh.net Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
1 parent cd955bd commit d93ee05

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools/objtool/special.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct special_entry {
2626
unsigned char key; /* jump_label key */
2727
};
2828

29-
struct special_entry entries[] = {
29+
static const struct special_entry entries[] = {
3030
{
3131
.sec = ".altinstructions",
3232
.group = true,
@@ -65,7 +65,7 @@ static void reloc_to_sec_off(struct reloc *reloc, struct section **sec,
6565
*off = reloc->sym->offset + reloc->addend;
6666
}
6767

68-
static int get_alt_entry(struct elf *elf, struct special_entry *entry,
68+
static int get_alt_entry(struct elf *elf, const struct special_entry *entry,
6969
struct section *sec, int idx,
7070
struct special_alt *alt)
7171
{
@@ -139,7 +139,7 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry,
139139
*/
140140
int special_get_alts(struct elf *elf, struct list_head *alts)
141141
{
142-
struct special_entry *entry;
142+
const struct special_entry *entry;
143143
struct section *sec;
144144
unsigned int nr_entries;
145145
struct special_alt *alt;

0 commit comments

Comments
 (0)