[PATCH] objtool: remove unneeded variable from add_prefix_symbols()

baomingtong001@208suo.com posted 1 patch 2 years, 7 months ago
tools/objtool/check.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] objtool: remove unneeded variable from add_prefix_symbols()
Posted by baomingtong001@208suo.com 2 years, 7 months ago
fix the following coccicheck warning:

tools/objtool/check.c:4135:5-13: Unneeded variable: "warnings". Return 
"0".

Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
---
  tools/objtool/check.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index a13c257f80dd..d12de0e2cf00 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4132,7 +4132,6 @@ static int add_prefix_symbols(struct objtool_file 
*file)
  {
      struct section *sec;
      struct symbol *func;
-    int warnings = 0;

      for_each_sec(file, sec) {
          if (!(sec->sh.sh_flags & SHF_EXECINSTR))
@@ -4146,7 +4145,7 @@ static int add_prefix_symbols(struct objtool_file 
*file)
          }
      }

-    return warnings;
+    return 0;
  }

  static int validate_symbol(struct objtool_file *file, struct section 
*sec,