LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools: Remove unnecessary variables
@ 2023-05-30  7:56 Lu Hongfei
  2023-05-30 23:10 ` Josh Poimboeuf
  2023-06-09  7:47 ` [tip: objtool/core] " tip-bot2 for Lu Hongfei
  0 siblings, 2 replies; 3+ messages in thread
From: Lu Hongfei @ 2023-05-30  7:56 UTC (permalink / raw
  To: Josh Poimboeuf, Peter Zijlstra, open list; +Cc: opensource.kernel, luhongfei

There are several places where warnings variables are not needed,
remove them and directly return 0.

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
---
 tools/objtool/check.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 tools/objtool/check.c

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 0fcf99c91400..b60af6965c1d
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3841,7 +3841,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec)
 static int validate_unret(struct objtool_file *file, struct instruction *insn)
 {
 	struct instruction *next, *dest;
-	int ret, warnings = 0;
+	int ret;
 
 	for (;;) {
 		next = next_insn_to_validate(file, insn);
@@ -3943,7 +3943,7 @@ static int validate_unret(struct objtool_file *file, struct instruction *insn)
 		insn = next;
 	}
 
-	return warnings;
+	return 0;
 }
 
 /*
@@ -4178,7 +4178,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))
@@ -4192,7 +4191,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,
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools: Remove unnecessary variables
  2023-05-30  7:56 [PATCH] tools: Remove unnecessary variables Lu Hongfei
@ 2023-05-30 23:10 ` Josh Poimboeuf
  2023-06-09  7:47 ` [tip: objtool/core] " tip-bot2 for Lu Hongfei
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Poimboeuf @ 2023-05-30 23:10 UTC (permalink / raw
  To: Lu Hongfei; +Cc: Peter Zijlstra, open list, opensource.kernel

On Tue, May 30, 2023 at 03:56:49PM +0800, Lu Hongfei wrote:
> There are several places where warnings variables are not needed,
> remove them and directly return 0.
> 
> Signed-off-by: Lu Hongfei <luhongfei@vivo.com>

Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>

-- 
Josh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: objtool/core] tools: Remove unnecessary variables
  2023-05-30  7:56 [PATCH] tools: Remove unnecessary variables Lu Hongfei
  2023-05-30 23:10 ` Josh Poimboeuf
@ 2023-06-09  7:47 ` tip-bot2 for Lu Hongfei
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Lu Hongfei @ 2023-06-09  7:47 UTC (permalink / raw
  To: linux-tip-commits; +Cc: Lu Hongfei, Josh Poimboeuf, x86, linux-kernel

The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     d49d1666aab51ad3caf79f414aff6b641837a6ea
Gitweb:        https://git.kernel.org/tip/d49d1666aab51ad3caf79f414aff6b641837a6ea
Author:        Lu Hongfei <luhongfei@vivo.com>
AuthorDate:    Tue, 30 May 2023 15:56:49 +08:00
Committer:     Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Wed, 07 Jun 2023 09:27:11 -07:00

tools: Remove unnecessary variables

There are several places where warnings variables are not needed,
remove them and directly return 0.

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
Link: https://lore.kernel.org/r/20230530075649.21661-1-luhongfei@vivo.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 tools/objtool/check.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index a13c257..4b869de 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3799,7 +3799,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec)
 static int validate_unret(struct objtool_file *file, struct instruction *insn)
 {
 	struct instruction *next, *dest;
-	int ret, warnings = 0;
+	int ret;
 
 	for (;;) {
 		next = next_insn_to_validate(file, insn);
@@ -3897,7 +3897,7 @@ static int validate_unret(struct objtool_file *file, struct instruction *insn)
 		insn = next;
 	}
 
-	return warnings;
+	return 0;
 }
 
 /*
@@ -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,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-09  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-30  7:56 [PATCH] tools: Remove unnecessary variables Lu Hongfei
2023-05-30 23:10 ` Josh Poimboeuf
2023-06-09  7:47 ` [tip: objtool/core] " tip-bot2 for Lu Hongfei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).