Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "objtool: Increase per-function WARN_FUNC() rate limit"

This reverts commit 0a7fb6f07e3ad497d31ae9a2082d2cacab43d54a.

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

authored by

Josh Poimboeuf and committed by
Ingo Molnar
c5610071 188d90f8

+6 -14
+2 -2
tools/objtool/check.c
··· 3545 3545 3546 3546 WARN("%s() falls through to next function %s()", 3547 3547 func->name, insn_func(insn)->name); 3548 - func->warnings++; 3548 + func->warned = 1; 3549 3549 3550 3550 return 1; 3551 3551 } ··· 4576 4576 char *funcs = NULL, *tmp; 4577 4577 4578 4578 for_each_sym(file, sym) { 4579 - if (sym->warnings) { 4579 + if (sym->warned) { 4580 4580 if (!funcs) { 4581 4581 funcs = malloc(strlen(sym->name) + 1); 4582 4582 if (!funcs) {
+1 -1
tools/objtool/include/objtool/elf.h
··· 65 65 u8 return_thunk : 1; 66 66 u8 fentry : 1; 67 67 u8 profiling_func : 1; 68 + u8 warned : 1; 68 69 u8 embedded_insn : 1; 69 70 u8 local_label : 1; 70 71 u8 frame_pointer : 1; 71 72 u8 ignore : 1; 72 - u8 warnings : 2; 73 73 struct list_head pv_target; 74 74 struct reloc *relocs; 75 75 };
+3 -11
tools/objtool/include/objtool/warn.h
··· 57 57 free(_str); \ 58 58 }) 59 59 60 - #define WARN_LIMIT 2 61 - 62 60 #define WARN_INSN(insn, format, ...) \ 63 61 ({ \ 64 62 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) \ 67 64 WARN_FUNC(format, _insn->sec, _insn->offset, \ 68 65 ##__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; \ 76 68 }) 77 69 78 70 #define BT_INSN(insn, format, ...) \