diff mbox series

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

Message ID 1542117416-52357-1-git-send-email-yuehaibing@huawei.com (mailing list archive)
State Accepted
Commit d64cf54e89c86487c1369991af79d8331c3e8988
Headers show
Series [-next] powerpc64/ftrace: Drop pointless static qualifier in is_b_op() | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied
snowpatch_ozlabs/build-ppc64le success build succeded & removed 0 sparse warning(s)
snowpatch_ozlabs/build-ppc64be success build succeded & removed 0 sparse warning(s)
snowpatch_ozlabs/build-ppc64e success build succeded & removed 0 sparse warning(s)
snowpatch_ozlabs/build-pmac32 success build succeded & removed 0 sparse warning(s)
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked

Commit Message

Yue Haibing Nov. 13, 2018, 1:56 p.m. UTC
There is no need to have the 'intoffset' variable static since new value
always be assigned before use it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 arch/powerpc/kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Naveen N. Rao Nov. 13, 2018, 2:26 p.m. UTC | #1
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 <yuehaibing@huawei.com>
> ---
>  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 <naveen.n.rao@linux.vnet.ibm.com>

- Naveen
Michael Ellerman Nov. 27, 2018, 9:22 a.m. UTC | #2
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 <yuehaibing@huawei.com>
> Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

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

cheers
diff mbox series

Patch

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 */