netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] tools: bpftool: add missing bpf_prog_linfo forward declaration
@ 2018-12-19 22:51 Stanislav Fomichev
  2018-12-19 22:54 ` Stanislav Fomichev
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Fomichev @ 2018-12-19 22:51 UTC (permalink / raw)
  To: netdev
  Cc: davem, ast, daniel, kafai, jakub.kicinski, quentin.monnet,
	Stanislav Fomichev

When building bpftool without HAVE_LIBBFD_SUPPORT I see the following
warnings:
main.h:164:23: warning: ‘struct bpf_prog_linfo’ declared inside
parameter list will not be visible outside of this definition or
declaration
          const struct bpf_prog_linfo *prog_linfo,
                       ^~~~~~~~~~~~~~

Move bpf_prog_linfo around so both HAVE_LIBBFD_SUPPORT and
!HAVE_LIBBFD_SUPPORT see it.

Fixes: b053b439b72ad152 ("bpf: libbpf: bpftool: Print bpf_line_info
during prog dump")

Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
 tools/bpf/bpftool/main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
index d2beb88f0e2e..9487345b04a7 100644
--- a/tools/bpf/bpftool/main.h
+++ b/tools/bpf/bpftool/main.h
@@ -147,8 +147,8 @@ int prog_parse_fd(int *argc, char ***argv);
 int map_parse_fd(int *argc, char ***argv);
 int map_parse_fd_and_info(int *argc, char ***argv, void *info, __u32 *info_len);
 
-#ifdef HAVE_LIBBFD_SUPPORT
 struct bpf_prog_linfo;
+#ifdef HAVE_LIBBFD_SUPPORT
 void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
 		       const char *arch, const char *disassembler_options,
 		       const struct btf *btf,
-- 
2.20.0.405.gbc1bbc6f85-goog

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

* Re: [PATCH bpf-next] tools: bpftool: add missing bpf_prog_linfo forward declaration
  2018-12-19 22:51 [PATCH bpf-next] tools: bpftool: add missing bpf_prog_linfo forward declaration Stanislav Fomichev
@ 2018-12-19 22:54 ` Stanislav Fomichev
  0 siblings, 0 replies; 2+ messages in thread
From: Stanislav Fomichev @ 2018-12-19 22:54 UTC (permalink / raw)
  To: netdev; +Cc: davem, ast, daniel, kafai, jakub.kicinski, quentin.monnet

On Wed, Dec 19, 2018 at 2:51 PM Stanislav Fomichev <sdf@google.com> wrote:
>
> When building bpftool without HAVE_LIBBFD_SUPPORT I see the following
> warnings:
> main.h:164:23: warning: ‘struct bpf_prog_linfo’ declared inside
> parameter list will not be visible outside of this definition or
> declaration
>           const struct bpf_prog_linfo *prog_linfo,
>                        ^~~~~~~~~~~~~~
>
> Move bpf_prog_linfo around so both HAVE_LIBBFD_SUPPORT and
> !HAVE_LIBBFD_SUPPORT see it.
>
> Fixes: b053b439b72ad152 ("bpf: libbpf: bpftool: Print bpf_line_info
> during prog dump")
>
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---
>  tools/bpf/bpftool/main.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
> index d2beb88f0e2e..9487345b04a7 100644
> --- a/tools/bpf/bpftool/main.h
> +++ b/tools/bpf/bpftool/main.h
> @@ -147,8 +147,8 @@ int prog_parse_fd(int *argc, char ***argv);
>  int map_parse_fd(int *argc, char ***argv);
>  int map_parse_fd_and_info(int *argc, char ***argv, void *info, __u32 *info_len);
>
> -#ifdef HAVE_LIBBFD_SUPPORT
>  struct bpf_prog_linfo;
> +#ifdef HAVE_LIBBFD_SUPPORT
>  void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
>                        const char *arch, const char *disassembler_options,
>                        const struct btf *btf,
> --
> 2.20.0.405.gbc1bbc6f85-goog
>
Looks like its fixed already, please ignore!

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

end of thread, other threads:[~2018-12-19 22:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 22:51 [PATCH bpf-next] tools: bpftool: add missing bpf_prog_linfo forward declaration Stanislav Fomichev
2018-12-19 22:54 ` Stanislav Fomichev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).