mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] objtool: remove unused parameter
@ 2024-01-19  4:02 alexs
  2024-02-01 11:57 ` kuiliang Shi
  0 siblings, 1 reply; 2+ messages in thread
From: alexs @ 2024-01-19  4:02 UTC (permalink / raw)
  To: Josh Poimboeuf, Peter Zijlstra, linux-kernel; +Cc: Alex Shi

From: Alex Shi <alexs@kernel.org>

Remove unused file parameter from init_insn_state(), insn from
has_modified_stack_frame().

Signed-off-by: Alex Shi <alexs@kernel.org>
To: linux-kernel@vger.kernel.org
To: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
---
 tools/objtool/check.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 548ec3cd7c00..ecc56a5ad174 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -274,8 +274,7 @@ static void init_cfi_state(struct cfi_state *cfi)
 	cfi->drap_offset = -1;
 }
 
-static void init_insn_state(struct objtool_file *file, struct insn_state *state,
-			    struct section *sec)
+static void init_insn_state(struct insn_state *state, struct section *sec)
 {
 	memset(state, 0, sizeof(*state));
 	init_cfi_state(&state->cfi);
@@ -2681,7 +2680,7 @@ static bool is_special_call(struct instruction *insn)
 	return false;
 }
 
-static bool has_modified_stack_frame(struct instruction *insn, struct insn_state *state)
+static bool has_modified_stack_frame(struct insn_state *state)
 {
 	struct cfi_state *cfi = &state->cfi;
 	int i;
@@ -3474,7 +3473,7 @@ static int validate_sibling_call(struct objtool_file *file,
 				 struct instruction *insn,
 				 struct insn_state *state)
 {
-	if (insn_func(insn) && has_modified_stack_frame(insn, state)) {
+	if (insn_func(insn) && has_modified_stack_frame(state)) {
 		WARN_INSN(insn, "sibling call from callable instruction with modified stack frame");
 		return 1;
 	}
@@ -3504,7 +3503,7 @@ static int validate_return(struct symbol *func, struct instruction *insn, struct
 		return 1;
 	}
 
-	if (func && has_modified_stack_frame(insn, state)) {
+	if (func && has_modified_stack_frame(state)) {
 		WARN_INSN(insn, "return with modified stack frame");
 		return 1;
 	}
@@ -3814,7 +3813,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec)
 	if (!file->hints)
 		return 0;
 
-	init_insn_state(file, &state, sec);
+	init_insn_state(&state, sec);
 
 	if (sec) {
 		sec_for_each_insn(file, sec, insn)
@@ -4221,7 +4220,7 @@ static int validate_section(struct objtool_file *file, struct section *sec)
 		if (func->type != STT_FUNC)
 			continue;
 
-		init_insn_state(file, &state, sec);
+		init_insn_state(&state, sec);
 		set_func_state(&state.cfi);
 
 		warnings += validate_symbol(file, sec, func, &state);
-- 
2.43.0


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

* Re: [PATCH] objtool: remove unused parameter
  2024-01-19  4:02 [PATCH] objtool: remove unused parameter alexs
@ 2024-02-01 11:57 ` kuiliang Shi
  0 siblings, 0 replies; 2+ messages in thread
From: kuiliang Shi @ 2024-02-01 11:57 UTC (permalink / raw)
  To: alexs, Josh Poimboeuf, Peter Zijlstra, linux-kernel

ping

On 1/19/24 12:02 PM, alexs@kernel.org wrote:
> From: Alex Shi <alexs@kernel.org>
> 
> Remove unused file parameter from init_insn_state(), insn from
> has_modified_stack_frame().
> 
> Signed-off-by: Alex Shi <alexs@kernel.org>
> To: linux-kernel@vger.kernel.org
> To: Peter Zijlstra <peterz@infradead.org>
> To: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
>  tools/objtool/check.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 548ec3cd7c00..ecc56a5ad174 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -274,8 +274,7 @@ static void init_cfi_state(struct cfi_state *cfi)
>  	cfi->drap_offset = -1;
>  }
>  
> -static void init_insn_state(struct objtool_file *file, struct insn_state *state,
> -			    struct section *sec)
> +static void init_insn_state(struct insn_state *state, struct section *sec)
>  {
>  	memset(state, 0, sizeof(*state));
>  	init_cfi_state(&state->cfi);
> @@ -2681,7 +2680,7 @@ static bool is_special_call(struct instruction *insn)
>  	return false;
>  }
>  
> -static bool has_modified_stack_frame(struct instruction *insn, struct insn_state *state)
> +static bool has_modified_stack_frame(struct insn_state *state)
>  {
>  	struct cfi_state *cfi = &state->cfi;
>  	int i;
> @@ -3474,7 +3473,7 @@ static int validate_sibling_call(struct objtool_file *file,
>  				 struct instruction *insn,
>  				 struct insn_state *state)
>  {
> -	if (insn_func(insn) && has_modified_stack_frame(insn, state)) {
> +	if (insn_func(insn) && has_modified_stack_frame(state)) {
>  		WARN_INSN(insn, "sibling call from callable instruction with modified stack frame");
>  		return 1;
>  	}
> @@ -3504,7 +3503,7 @@ static int validate_return(struct symbol *func, struct instruction *insn, struct
>  		return 1;
>  	}
>  
> -	if (func && has_modified_stack_frame(insn, state)) {
> +	if (func && has_modified_stack_frame(state)) {
>  		WARN_INSN(insn, "return with modified stack frame");
>  		return 1;
>  	}
> @@ -3814,7 +3813,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec)
>  	if (!file->hints)
>  		return 0;
>  
> -	init_insn_state(file, &state, sec);
> +	init_insn_state(&state, sec);
>  
>  	if (sec) {
>  		sec_for_each_insn(file, sec, insn)
> @@ -4221,7 +4220,7 @@ static int validate_section(struct objtool_file *file, struct section *sec)
>  		if (func->type != STT_FUNC)
>  			continue;
>  
> -		init_insn_state(file, &state, sec);
> +		init_insn_state(&state, sec);
>  		set_func_state(&state.cfi);
>  
>  		warnings += validate_symbol(file, sec, func, &state);

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

end of thread, other threads:[~2024-02-01 11:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-19  4:02 [PATCH] objtool: remove unused parameter alexs
2024-02-01 11:57 ` kuiliang Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®