diff mbox series

[bpf-next] bpf_helpers_doc.py: Fix warning when compiling bpftool.

Message ID 20200313154650.13366-1-cneirabustos@gmail.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [bpf-next] bpf_helpers_doc.py: Fix warning when compiling bpftool. | expand

Commit Message

Carlos Antonio Neira Bustos March 13, 2020, 3:46 p.m. UTC
When compiling bpftool the following warning is found: 
"declaration of 'struct bpf_pidns_info' will not be visible outside of this function."
This patch adds struct bpf_pidns_info to type_fwds array to fix this.

Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
---
 scripts/bpf_helpers_doc.py | 1 +
 1 file changed, 1 insertion(+)

Comments

Quentin Monnet March 13, 2020, 4:20 p.m. UTC | #1
2020-03-13 12:46 UTC-0300 ~ Carlos Neira <cneirabustos@gmail.com>
> 
> When compiling bpftool the following warning is found: 
> "declaration of 'struct bpf_pidns_info' will not be visible outside of this function."
> This patch adds struct bpf_pidns_info to type_fwds array to fix this.
> 
> Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
> ---
>  scripts/bpf_helpers_doc.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py
> index c1e2b5410faa..f43d193aff3a 100755
> --- a/scripts/bpf_helpers_doc.py
> +++ b/scripts/bpf_helpers_doc.py
> @@ -400,6 +400,7 @@ class PrinterHelpers(Printer):
>              'struct bpf_fib_lookup',
>              'struct bpf_perf_event_data',
>              'struct bpf_perf_event_value',
> +            'struct bpf_pidns_info',
>              'struct bpf_sock',
>              'struct bpf_sock_addr',
>              'struct bpf_sock_ops',
> 

Note that the warning is not specific to bpftool (I just happened to
spot it when compiling this tool), it's for anything that uses libbpf,
or more generally, the generated header for helpers.

It is fixed by your patch, thank you!

Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Martin KaFai Lau March 13, 2020, 5:21 p.m. UTC | #2
On Fri, Mar 13, 2020 at 12:46:50PM -0300, Carlos Neira wrote:
> 
> When compiling bpftool the following warning is found: 
> "declaration of 'struct bpf_pidns_info' will not be visible outside of this function."
> This patch adds struct bpf_pidns_info to type_fwds array to fix this.
> 
> Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
Fixes: b4490c5c4e02 ("bpf: Added new helper bpf_get_ns_current_pid_tgid")
Acked-by: Martin KaFai Lau <kafai@fb.com>

Please add the Fixes tag next time.  Other than tracking,
it will be easier for review purpose also.
Carlos Antonio Neira Bustos March 13, 2020, 6:23 p.m. UTC | #3
On Fri, Mar 13, 2020 at 10:21:19AM -0700, Martin KaFai Lau wrote:
> On Fri, Mar 13, 2020 at 12:46:50PM -0300, Carlos Neira wrote:
> > 
> > When compiling bpftool the following warning is found: 
> > "declaration of 'struct bpf_pidns_info' will not be visible outside of this function."
> > This patch adds struct bpf_pidns_info to type_fwds array to fix this.
> > 
> > Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
> Fixes: b4490c5c4e02 ("bpf: Added new helper bpf_get_ns_current_pid_tgid")
> Acked-by: Martin KaFai Lau <kafai@fb.com>
> 
> Please add the Fixes tag next time.  Other than tracking,
> it will be easier for review purpose also.

Thanks, I will do that in the future.

Bests
Daniel Borkmann March 13, 2020, 8:13 p.m. UTC | #4
On 3/13/20 7:23 PM, Carlos Antonio Neira Bustos wrote:
> On Fri, Mar 13, 2020 at 10:21:19AM -0700, Martin KaFai Lau wrote:
>> On Fri, Mar 13, 2020 at 12:46:50PM -0300, Carlos Neira wrote:
>>>
>>> When compiling bpftool the following warning is found:
>>> "declaration of 'struct bpf_pidns_info' will not be visible outside of this function."
>>> This patch adds struct bpf_pidns_info to type_fwds array to fix this.
>>>
>>> Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
>> Fixes: b4490c5c4e02 ("bpf: Added new helper bpf_get_ns_current_pid_tgid")
>> Acked-by: Martin KaFai Lau <kafai@fb.com>
>>
>> Please add the Fixes tag next time.  Other than tracking,
>> it will be easier for review purpose also.
> 
> Thanks, I will do that in the future.

Applied, thanks!
diff mbox series

Patch

diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py
index c1e2b5410faa..f43d193aff3a 100755
--- a/scripts/bpf_helpers_doc.py
+++ b/scripts/bpf_helpers_doc.py
@@ -400,6 +400,7 @@  class PrinterHelpers(Printer):
             'struct bpf_fib_lookup',
             'struct bpf_perf_event_data',
             'struct bpf_perf_event_value',
+            'struct bpf_pidns_info',
             'struct bpf_sock',
             'struct bpf_sock_addr',
             'struct bpf_sock_ops',