|
23 | 23 | #include <linux/static_call_types.h>
|
24 | 24 |
|
25 | 25 | struct alternative {
|
26 |
| - struct list_head list; |
| 26 | + struct alternative *next; |
27 | 27 | struct instruction *insn;
|
28 | 28 | bool skip_orig;
|
29 | 29 | };
|
@@ -397,7 +397,6 @@ static int decode_instructions(struct objtool_file *file)
|
397 | 397 | return -1;
|
398 | 398 | }
|
399 | 399 | memset(insn, 0, sizeof(*insn));
|
400 |
| - INIT_LIST_HEAD(&insn->alts); |
401 | 400 | INIT_LIST_HEAD(&insn->call_node);
|
402 | 401 |
|
403 | 402 | insn->sec = sec;
|
@@ -1780,7 +1779,6 @@ static int handle_group_alt(struct objtool_file *file,
|
1780 | 1779 | return -1;
|
1781 | 1780 | }
|
1782 | 1781 | memset(nop, 0, sizeof(*nop));
|
1783 |
| - INIT_LIST_HEAD(&nop->alts); |
1784 | 1782 |
|
1785 | 1783 | nop->sec = special_alt->new_sec;
|
1786 | 1784 | nop->offset = special_alt->new_off + special_alt->new_len;
|
@@ -1978,7 +1976,8 @@ static int add_special_section_alts(struct objtool_file *file)
|
1978 | 1976 | alt->insn = new_insn;
|
1979 | 1977 | alt->skip_orig = special_alt->skip_orig;
|
1980 | 1978 | orig_insn->ignore_alts |= special_alt->skip_alt;
|
1981 |
| - list_add_tail(&alt->list, &orig_insn->alts); |
| 1979 | + alt->next = orig_insn->alts; |
| 1980 | + orig_insn->alts = alt; |
1982 | 1981 |
|
1983 | 1982 | list_del(&special_alt->list);
|
1984 | 1983 | free(special_alt);
|
@@ -2037,7 +2036,8 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn,
|
2037 | 2036 | }
|
2038 | 2037 |
|
2039 | 2038 | alt->insn = dest_insn;
|
2040 |
| - list_add_tail(&alt->list, &insn->alts); |
| 2039 | + alt->next = insn->alts; |
| 2040 | + insn->alts = alt; |
2041 | 2041 | prev_offset = reloc->offset;
|
2042 | 2042 | }
|
2043 | 2043 |
|
@@ -3594,10 +3594,10 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
|
3594 | 3594 | if (propagate_alt_cfi(file, insn))
|
3595 | 3595 | return 1;
|
3596 | 3596 |
|
3597 |
| - if (!insn->ignore_alts && !list_empty(&insn->alts)) { |
| 3597 | + if (!insn->ignore_alts && insn->alts) { |
3598 | 3598 | bool skip_orig = false;
|
3599 | 3599 |
|
3600 |
| - list_for_each_entry(alt, &insn->alts, list) { |
| 3600 | + for (alt = insn->alts; alt; alt = alt->next) { |
3601 | 3601 | if (alt->skip_orig)
|
3602 | 3602 | skip_orig = true;
|
3603 | 3603 |
|
@@ -3796,11 +3796,11 @@ static int validate_entry(struct objtool_file *file, struct instruction *insn)
|
3796 | 3796 |
|
3797 | 3797 | insn->visited |= VISITED_ENTRY;
|
3798 | 3798 |
|
3799 |
| - if (!insn->ignore_alts && !list_empty(&insn->alts)) { |
| 3799 | + if (!insn->ignore_alts && insn->alts) { |
3800 | 3800 | struct alternative *alt;
|
3801 | 3801 | bool skip_orig = false;
|
3802 | 3802 |
|
3803 |
| - list_for_each_entry(alt, &insn->alts, list) { |
| 3803 | + for (alt = insn->alts; alt; alt = alt->next) { |
3804 | 3804 | if (alt->skip_orig)
|
3805 | 3805 | skip_orig = true;
|
3806 | 3806 |
|
|
0 commit comments