Skip to content

Commit c561007

Browse files
jpoimboeIngo Molnar
authored andcommitted
Revert "objtool: Increase per-function WARN_FUNC() rate limit"
This reverts commit 0a7fb6f. The "skipping duplicate warnings" warning is technically not an actual warning, which can cause confusion. This feature isn't all that useful anyway. It's exceedingly rare for a function to have more than one unrelated warning. Suggested-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/e5abe5e858acf1a9207a5dfa0f37d17ac9dca872.1743481539.git.jpoimboe@kernel.org
1 parent 188d90f commit c561007

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

tools/objtool/check.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,7 +3545,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
35453545

35463546
WARN("%s() falls through to next function %s()",
35473547
func->name, insn_func(insn)->name);
3548-
func->warnings++;
3548+
func->warned = 1;
35493549

35503550
return 1;
35513551
}
@@ -4576,7 +4576,7 @@ static void disas_warned_funcs(struct objtool_file *file)
45764576
char *funcs = NULL, *tmp;
45774577

45784578
for_each_sym(file, sym) {
4579-
if (sym->warnings) {
4579+
if (sym->warned) {
45804580
if (!funcs) {
45814581
funcs = malloc(strlen(sym->name) + 1);
45824582
if (!funcs) {

tools/objtool/include/objtool/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ struct symbol {
6565
u8 return_thunk : 1;
6666
u8 fentry : 1;
6767
u8 profiling_func : 1;
68+
u8 warned : 1;
6869
u8 embedded_insn : 1;
6970
u8 local_label : 1;
7071
u8 frame_pointer : 1;
7172
u8 ignore : 1;
72-
u8 warnings : 2;
7373
struct list_head pv_target;
7474
struct reloc *relocs;
7575
};

tools/objtool/include/objtool/warn.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,14 @@ static inline char *offstr(struct section *sec, unsigned long offset)
5757
free(_str); \
5858
})
5959

60-
#define WARN_LIMIT 2
61-
6260
#define WARN_INSN(insn, format, ...) \
6361
({ \
6462
struct instruction *_insn = (insn); \
65-
BUILD_BUG_ON(WARN_LIMIT > 2); \
66-
if (!_insn->sym || _insn->sym->warnings < WARN_LIMIT) { \
63+
if (!_insn->sym || !_insn->sym->warned) \
6764
WARN_FUNC(format, _insn->sec, _insn->offset, \
6865
##__VA_ARGS__); \
69-
if (_insn->sym) \
70-
_insn->sym->warnings++; \
71-
} else if (_insn->sym && _insn->sym->warnings == WARN_LIMIT) { \
72-
WARN_FUNC("skipping duplicate warning(s)", \
73-
_insn->sec, _insn->offset); \
74-
_insn->sym->warnings++; \
75-
} \
66+
if (_insn->sym) \
67+
_insn->sym->warned = 1; \
7668
})
7769

7870
#define BT_INSN(insn, format, ...) \

0 commit comments

Comments
 (0)