2019-04-10 13:57:58

by Yue Haibing

[permalink] [raw]
Subject: [PATCH] MIPS: eBPF: Make ebpf_to_mips_reg() static

From: YueHaibing <[email protected]>

Fix sparse warning:

arch/mips/net/ebpf_jit.c:196:5: warning:
symbol 'ebpf_to_mips_reg' was not declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
---
arch/mips/net/ebpf_jit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c
index 3548a69..dfd5a4b 100644
--- a/arch/mips/net/ebpf_jit.c
+++ b/arch/mips/net/ebpf_jit.c
@@ -193,8 +193,9 @@ enum which_ebpf_reg {
* separate frame pointer, so BPF_REG_10 relative accesses are
* adjusted to be $sp relative.
*/
-int ebpf_to_mips_reg(struct jit_ctx *ctx, const struct bpf_insn *insn,
- enum which_ebpf_reg w)
+static int ebpf_to_mips_reg(struct jit_ctx *ctx,
+ const struct bpf_insn *insn,
+ enum which_ebpf_reg w)
{
int ebpf_reg = (w == src_reg || w == src_reg_no_fp) ?
insn->src_reg : insn->dst_reg;
--
2.7.4



2019-04-10 19:00:50

by Yonghong Song

[permalink] [raw]
Subject: Re: [PATCH] MIPS: eBPF: Make ebpf_to_mips_reg() static



On 4/10/19 6:49 AM, Yue Haibing wrote:
> From: YueHaibing <[email protected]>
>
> Fix sparse warning:
>
> arch/mips/net/ebpf_jit.c:196:5: warning:
> symbol 'ebpf_to_mips_reg' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>

Acked-by: Yonghong Song <[email protected]>

2019-04-11 20:02:04

by Daniel Borkmann

[permalink] [raw]
Subject: Re: [PATCH] MIPS: eBPF: Make ebpf_to_mips_reg() static

On 04/10/2019 03:49 PM, Yue Haibing wrote:
> From: YueHaibing <[email protected]>
>
> Fix sparse warning:
>
> arch/mips/net/ebpf_jit.c:196:5: warning:
> symbol 'ebpf_to_mips_reg' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>

Applied, thanks!