Skip to contentSkip to conversation

objtool: remove unneeded variable from add_prefix_symbols()

PATCH New [email protected] 1 participant 1 message Jun 14, 2023 1 message not in the archive objtool

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 objtool: remove unneeded variable from add_prefix_symbols()

fix the following coccicheck warning:

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

---
 tools/objtool/check.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/objtool/check.c +1 -2
index a13c257f80dd..d12de0e2cf00 100644
@@ -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,