diff mbox series

[bpf-next] bpf: Make symbol 'bpf_task_storage_busy' static

Message ID 20210311131505.1901509-1-weiyongjun1@huawei.com (mailing list archive)
State Accepted
Delegated to: BPF
Headers show
Series [bpf-next] bpf: Make symbol 'bpf_task_storage_busy' static | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers fail 1 blamed authors not CCed: kafai@fb.com; 4 maintainers not CCed: john.fastabend@gmail.com yhs@fb.com kafai@fb.com kpsingh@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 2 this patch: 1
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 1
netdev/header_inline success Link

Commit Message

Wei Yongjun March 11, 2021, 1:15 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

The sparse tool complains as follows:

kernel/bpf/bpf_task_storage.c:23:1: warning:
 symbol '__pcpu_scope_bpf_task_storage_busy' was not declared. Should it be static?

This symbol is not used outside of bpf_task_storage.c, so this
commit marks it static.

Fixes: bc235cdb423a ("bpf: Prevent deadlock from recursive bpf_task_storage_[get|delete]")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 kernel/bpf/bpf_task_storage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Song Liu March 12, 2021, 1:27 a.m. UTC | #1
> On Mar 11, 2021, at 5:15 AM, 'Wei Yongjun <weiyongjun1@huawei.com> wrote:
> 
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> The sparse tool complains as follows:
> 
> kernel/bpf/bpf_task_storage.c:23:1: warning:
> symbol '__pcpu_scope_bpf_task_storage_busy' was not declared. Should it be static?
> 
> This symbol is not used outside of bpf_task_storage.c, so this
> commit marks it static.
> 
> Fixes: bc235cdb423a ("bpf: Prevent deadlock from recursive bpf_task_storage_[get|delete]")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

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

Thanks for the fix!

> ---
> kernel/bpf/bpf_task_storage.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c
> index fd3c74ef608e..3ce75758d394 100644
> --- a/kernel/bpf/bpf_task_storage.c
> +++ b/kernel/bpf/bpf_task_storage.c
> @@ -20,7 +20,7 @@
> 
> DEFINE_BPF_STORAGE_CACHE(task_cache);
> 
> -DEFINE_PER_CPU(int, bpf_task_storage_busy);
> +static DEFINE_PER_CPU(int, bpf_task_storage_busy);
> 
> static void bpf_task_storage_lock(void)
> {
>
diff mbox series

Patch

diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c
index fd3c74ef608e..3ce75758d394 100644
--- a/kernel/bpf/bpf_task_storage.c
+++ b/kernel/bpf/bpf_task_storage.c
@@ -20,7 +20,7 @@ 
 
 DEFINE_BPF_STORAGE_CACHE(task_cache);
 
-DEFINE_PER_CPU(int, bpf_task_storage_busy);
+static DEFINE_PER_CPU(int, bpf_task_storage_busy);
 
 static void bpf_task_storage_lock(void)
 {