mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bpf: Remove unneeded variable
       [not found] ` <e980bbb2536d4c35ce90a4666b3e8bf6@208suo.com>
@ 2023-06-14  6:29   ` xuanzhenggang001
  2023-06-16 16:30     ` Andrii Nakryiko
  0 siblings, 1 reply; 2+ messages in thread
From: xuanzhenggang001 @ 2023-06-14  6:29 UTC (permalink / raw)
  To: davem, dsahern, tglx, mingo, bp, dave.hansen
  Cc: x86, hpa, bpf, netdev, linux-kernel

Fix the following coccicheck warning:

arch/x86/net/bpf_jit_comp32.c:1274:5-8: Unneeded variable: "cnt".

Signed-off-by: Zhenggang Xuan <xuanzhenggang001@208suo.com>
---
  arch/x86/net/bpf_jit_comp32.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/net/bpf_jit_comp32.c 
b/arch/x86/net/bpf_jit_comp32.c
index 429a89c5468b..bc71329ac5ed 100644
--- a/arch/x86/net/bpf_jit_comp32.c
+++ b/arch/x86/net/bpf_jit_comp32.c
@@ -1271,7 +1271,6 @@ static void emit_epilogue(u8 **pprog, u32 
stack_depth)
  static int emit_jmp_edx(u8 **pprog, u8 *ip)
  {
      u8 *prog = *pprog;
-    int cnt = 0;

  #ifdef CONFIG_RETPOLINE
      EMIT1_off32(0xE9, (u8 *)__x86_indirect_thunk_edx - (ip + 5));
@@ -1280,7 +1279,7 @@ static int emit_jmp_edx(u8 **pprog, u8 *ip)
  #endif
      *pprog = prog;

-    return cnt;
+    return 0;
  }

  /*

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

* Re: [PATCH] bpf: Remove unneeded variable
  2023-06-14  6:29   ` [PATCH] bpf: Remove unneeded variable xuanzhenggang001
@ 2023-06-16 16:30     ` Andrii Nakryiko
  0 siblings, 0 replies; 2+ messages in thread
From: Andrii Nakryiko @ 2023-06-16 16:30 UTC (permalink / raw)
  To: xuanzhenggang001
  Cc: davem, dsahern, tglx, mingo, bp, dave.hansen, x86, hpa, bpf,
	netdev, linux-kernel

On Tue, Jun 13, 2023 at 11:29 PM <xuanzhenggang001@208suo.com> wrote:
>
> Fix the following coccicheck warning:
>
> arch/x86/net/bpf_jit_comp32.c:1274:5-8: Unneeded variable: "cnt".
>
> Signed-off-by: Zhenggang Xuan <xuanzhenggang001@208suo.com>
> ---
>   arch/x86/net/bpf_jit_comp32.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/x86/net/bpf_jit_comp32.c
> b/arch/x86/net/bpf_jit_comp32.c
> index 429a89c5468b..bc71329ac5ed 100644
> --- a/arch/x86/net/bpf_jit_comp32.c
> +++ b/arch/x86/net/bpf_jit_comp32.c
> @@ -1271,7 +1271,6 @@ static void emit_epilogue(u8 **pprog, u32
> stack_depth)
>   static int emit_jmp_edx(u8 **pprog, u8 *ip)
>   {
>       u8 *prog = *pprog;
> -    int cnt = 0;
>
>   #ifdef CONFIG_RETPOLINE
>       EMIT1_off32(0xE9, (u8 *)__x86_indirect_thunk_edx - (ip + 5));

EMIT macroses are updating this cnt. Have you tested this patch by any chance?

> @@ -1280,7 +1279,7 @@ static int emit_jmp_edx(u8 **pprog, u8 *ip)
>   #endif
>       *pprog = prog;
>
> -    return cnt;
> +    return 0;
>   }
>
>   /*
>

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

end of thread, other threads:[~2023-06-16 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230610124403.36396-1-denghuilong@cdjrlc.com>
     [not found] ` <e980bbb2536d4c35ce90a4666b3e8bf6@208suo.com>
2023-06-14  6:29   ` [PATCH] bpf: Remove unneeded variable xuanzhenggang001
2023-06-16 16:30     ` Andrii Nakryiko

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®