summaryrefslogtreecommitdiff
path: root/tools/objtool/check.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2025-03-25 00:56:00 +0300
committerIngo Molnar <mingo@kernel.org>2025-03-25 11:20:27 +0300
commitd39f82a058c0269392a797cb04f2a6064e5dcab6 (patch)
tree77ac5c27bfd56e853ee870d0020e25899a48e2c0 /tools/objtool/check.c
parentc5995abe15476798b2e2f0163a33404c41aafc8f (diff)
downloadlinux-d39f82a058c0269392a797cb04f2a6064e5dcab6.tar.xz
objtool: Reduce CONFIG_OBJTOOL_WERROR verbosity
Remove the following from CONFIG_OBJTOOL_WERROR: * backtrace * "upgraded warnings to errors" message * cmdline args This makes the default output less cluttered and makes it easier to spot the actual warnings. Note the above options are still are available with --verbose or OBJTOOL_VERBOSE=1. Also, do the cmdline arg printing on all warnings, regardless of werror. 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/d61df69f64b396fa6b2a1335588aad7a34ea9e71.1742852846.git.jpoimboe@kernel.org
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r--tools/objtool/check.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index f4e7ee8e8fb5..ac21f2846ebc 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4732,9 +4732,6 @@ int check(struct objtool_file *file)
free_insns(file);
- if (opts.verbose)
- disas_warned_funcs(file);
-
if (opts.stats) {
printf("nr_insns_visited: %ld\n", nr_insns_visited);
printf("nr_cfi: %ld\n", nr_cfi);
@@ -4743,19 +4740,25 @@ int check(struct objtool_file *file)
}
out:
+ if (!ret && !warnings)
+ return 0;
+
+ if (opts.verbose) {
+ if (opts.werror && warnings)
+ WARN("%d warning(s) upgraded to errors", warnings);
+ print_args();
+ disas_warned_funcs(file);
+ }
+
/*
* CONFIG_OBJTOOL_WERROR upgrades all warnings (and errors) to actual
* errors.
*
- * Note that even "fatal" type errors don't actually return an error
- * without CONFIG_OBJTOOL_WERROR. That probably needs improved at some
- * point.
+ * Note that even fatal errors don't yet actually return an error
+ * without CONFIG_OBJTOOL_WERROR. That will be fixed soon-ish.
*/
- if (opts.werror && (ret || warnings)) {
- if (warnings)
- WARN("%d warning(s) upgraded to errors", warnings);
+ if (opts.werror)
return 1;
- }
return 0;
}