All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Make some symbols static
@ 2021-05-19  6:41 Pu Lehui
  2021-05-19 17:13 ` Song Liu
  2021-05-19 18:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Pu Lehui @ 2021-05-19  6:41 UTC (permalink / raw)
  To: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend, kpsingh
  Cc: netdev, bpf, linux-kernel, pulehui

The sparse tool complains as follows:

kernel/bpf/syscall.c:4567:29: warning:
 symbol 'bpf_sys_bpf_proto' was not declared. Should it be static?
kernel/bpf/syscall.c:4592:29: warning:
 symbol 'bpf_sys_close_proto' was not declared. Should it be static?

This symbol is not used outside of syscall.c, so marks it static.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
---
 kernel/bpf/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 2361d97e2c67..73d15bc62d8c 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -4564,7 +4564,7 @@ BPF_CALL_3(bpf_sys_bpf, int, cmd, void *, attr, u32, attr_size)
 	return __sys_bpf(cmd, KERNEL_BPFPTR(attr), attr_size);
 }
 
-const struct bpf_func_proto bpf_sys_bpf_proto = {
+static const struct bpf_func_proto bpf_sys_bpf_proto = {
 	.func		= bpf_sys_bpf,
 	.gpl_only	= false,
 	.ret_type	= RET_INTEGER,
@@ -4589,7 +4589,7 @@ BPF_CALL_1(bpf_sys_close, u32, fd)
 	return close_fd(fd);
 }
 
-const struct bpf_func_proto bpf_sys_close_proto = {
+static const struct bpf_func_proto bpf_sys_close_proto = {
 	.func		= bpf_sys_close,
 	.gpl_only	= false,
 	.ret_type	= RET_INTEGER,
-- 
2.17.1


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

* Re: [PATCH bpf-next] bpf: Make some symbols static
  2021-05-19  6:41 [PATCH bpf-next] bpf: Make some symbols static Pu Lehui
@ 2021-05-19 17:13 ` Song Liu
  2021-05-19 18:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2021-05-19 17:13 UTC (permalink / raw)
  To: Pu Lehui
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Martin Lau,
	Yonghong Song, john.fastabend, kpsingh, netdev, bpf,
	linux-kernel



> On May 18, 2021, at 11:41 PM, Pu Lehui <pulehui@huawei.com> wrote:
> 
> The sparse tool complains as follows:
> 
> kernel/bpf/syscall.c:4567:29: warning:
> symbol 'bpf_sys_bpf_proto' was not declared. Should it be static?
> kernel/bpf/syscall.c:4592:29: warning:
> symbol 'bpf_sys_close_proto' was not declared. Should it be static?
> 
> This symbol is not used outside of syscall.c, so marks it static.
> 
> Signed-off-by: Pu Lehui <pulehui@huawei.com>

Acked-by: Song Liu <songliubraving@fb.com>

> ---
> kernel/bpf/syscall.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 2361d97e2c67..73d15bc62d8c 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -4564,7 +4564,7 @@ BPF_CALL_3(bpf_sys_bpf, int, cmd, void *, attr, u32, attr_size)
> 	return __sys_bpf(cmd, KERNEL_BPFPTR(attr), attr_size);
> }
> 
> -const struct bpf_func_proto bpf_sys_bpf_proto = {
> +static const struct bpf_func_proto bpf_sys_bpf_proto = {
> 	.func		= bpf_sys_bpf,
> 	.gpl_only	= false,
> 	.ret_type	= RET_INTEGER,
> @@ -4589,7 +4589,7 @@ BPF_CALL_1(bpf_sys_close, u32, fd)
> 	return close_fd(fd);
> }
> 
> -const struct bpf_func_proto bpf_sys_close_proto = {
> +static const struct bpf_func_proto bpf_sys_close_proto = {
> 	.func		= bpf_sys_close,
> 	.gpl_only	= false,
> 	.ret_type	= RET_INTEGER,
> -- 
> 2.17.1
> 


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

* Re: [PATCH bpf-next] bpf: Make some symbols static
  2021-05-19  6:41 [PATCH bpf-next] bpf: Make some symbols static Pu Lehui
  2021-05-19 17:13 ` Song Liu
@ 2021-05-19 18:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-19 18:00 UTC (permalink / raw)
  To: Pu Lehui
  Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, netdev, bpf, linux-kernel

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

On Wed, 19 May 2021 14:41:16 +0800 you wrote:
> The sparse tool complains as follows:
> 
> kernel/bpf/syscall.c:4567:29: warning:
>  symbol 'bpf_sys_bpf_proto' was not declared. Should it be static?
> kernel/bpf/syscall.c:4592:29: warning:
>  symbol 'bpf_sys_close_proto' was not declared. Should it be static?
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpf: Make some symbols static
    https://git.kernel.org/bpf/bpf-next/c/3a2daa724864

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-05-19 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19  6:41 [PATCH bpf-next] bpf: Make some symbols static Pu Lehui
2021-05-19 17:13 ` Song Liu
2021-05-19 18:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.