There is no need to jump to the "out" tag when "ret < 0", just return
directly to "ret".
Signed-off-by: Youling Tang
---
tools/objtool/check.c | 30 ++
1 file changed, 10 insertions(+), 20 deletions(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index e034a8f..b9bfcb5 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2799,19 +2799,19 @@ int check(const char *_objname, bool orc)
ret = decode_sections();
if (ret < 0)
- goto out;
+ return ret;
warnings += ret;
if (list_empty(_list))
- goto out;
+ return ret;
if (vmlinux && !validate_dup) {
ret = validate_vmlinux_functions();
if (ret < 0)
- goto out;
+ return ret;
warnings += ret;
- goto out;
+ return 0;
}
if (retpoline) {
@@ -2823,45 +2823,35 @@ int check(const char *_objname, bool orc)
ret = validate_functions();
if (ret < 0)
- goto out;
+ return ret;
warnings += ret;
ret = validate_unwind_hints(, NULL);
if (ret < 0)
- goto out;
+ return ret;
warnings += ret;
if (!warnings) {
ret = validate_reachable_instructions();
if (ret < 0)
- goto out;
+ return ret;
warnings += ret;
}
if (orc) {
ret = create_orc();
if (ret < 0)
- goto out;
+ return ret;
ret = create_orc_sections();
if (ret < 0)
- goto out;
+ return ret;
}
if (file.elf->changed) {
ret = elf_write(file.elf);
if (ret < 0)
- goto out;
- }
-
-out:
- if (ret < 0) {
- /*
-* Fatal error. The binary is corrupt or otherwise broken in
-* some way, or objtool itself is broken. Fail the kernel
-* build.
-*/
- return ret;
+ return ret;
}
return 0;
--
2.1.0