2018-11-13 13:48:33

by Yue Haibing

[permalink] [raw]
Subject: [PATCH -next] powerpc64/ftrace: Drop pointless static qualifier in is_b_op()

There is no need to have the 'intoffset' variable static since new value
always be assigned before use it.

Signed-off-by: YueHaibing <[email protected]>
---
arch/powerpc/kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
index 4bf051d..65248d4 100644
--- a/arch/powerpc/kernel/trace/ftrace.c
+++ b/arch/powerpc/kernel/trace/ftrace.c
@@ -107,7 +107,7 @@ static int is_b_op(unsigned int op)

static unsigned long find_bl_target(unsigned long ip, unsigned int op)
{
- static int offset;
+ int offset;

offset = (op & 0x03fffffc);
/* make it signed */





2018-11-13 14:27:33

by Naveen N. Rao

[permalink] [raw]
Subject: Re: [PATCH -next] powerpc64/ftrace: Drop pointless static qualifier in is_b_op()

YueHaibing wrote:
> There is no need to have the 'intoffset' variable static since new value
> always be assigned before use it.
>
> Signed-off-by: YueHaibing <[email protected]>
> ---
> arch/powerpc/kernel/trace/ftrace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
> index 4bf051d..65248d4 100644
> --- a/arch/powerpc/kernel/trace/ftrace.c
> +++ b/arch/powerpc/kernel/trace/ftrace.c
> @@ -107,7 +107,7 @@ static int is_b_op(unsigned int op)
>
> static unsigned long find_bl_target(unsigned long ip, unsigned int op)
> {
> - static int offset;
> + int offset;

That seems to go all the way back to the original commit by Steven.
Good catch.
Reviewed-by: Naveen N. Rao <[email protected]>

- Naveen



2018-11-27 13:03:51

by Michael Ellerman

[permalink] [raw]
Subject: Re: [-next] powerpc64/ftrace: Drop pointless static qualifier in is_b_op()

On Tue, 2018-11-13 at 13:56:56 UTC, YueHaibing wrote:
> There is no need to have the 'intoffset' variable static since new value
> always be assigned before use it.
>
> Signed-off-by: YueHaibing <[email protected]>
> Reviewed-by: Naveen N. Rao <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/d64cf54e89c86487c1369991af79d8

cheers