bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Monnet <quentin.monnet@netronome.com>
To: Andrii Nakryiko <andriin@fb.com>,
	bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
	daniel@iogearbox.net
Cc: andrii.nakryiko@gmail.com, kernel-team@fb.com
Subject: Re: [PATCH bpf-next 4/4] bpftool: avoid const discard compilation warning
Date: Fri, 17 Jan 2020 15:55:55 +0000	[thread overview]
Message-ID: <a1f6c13d-775c-6e48-6102-27332b5366a1@netronome.com> (raw)
In-Reply-To: <20200117060801.1311525-5-andriin@fb.com>

2020-01-16 22:08 UTC-0800 ~ Andrii Nakryiko <andriin@fb.com>
> Avoid compilation warning in bpftool when assigning disassembler_options by
> casting explicitly to non-const pointer.
> 
> Fixes: 3ddeac6705ab ("tools: bpftool: use 4 context mode for the NFP disasm")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> ---
>  tools/bpf/bpftool/jit_disasm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
> index bfed711258ce..22ef85b0f86c 100644
> --- a/tools/bpf/bpftool/jit_disasm.c
> +++ b/tools/bpf/bpftool/jit_disasm.c
> @@ -119,7 +119,7 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
>  	info.arch = bfd_get_arch(bfdf);
>  	info.mach = bfd_get_mach(bfdf);
>  	if (disassembler_options)
> -		info.disassembler_options = disassembler_options;
> +		info.disassembler_options = (char *)disassembler_options;
>  	info.buffer = image;
>  	info.buffer_length = len;
>  
> 

Thanks Andrii,

This fix has been proposed and discussed before:
https://lore.kernel.org/bpf/20190328141652.wssqboyekxmp6tkw@yubo-2/t/#u

I still believe that we should not add the cast.

Best regards,
Quentin

  reply	other threads:[~2020-01-17 15:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17  6:07 [PATCH bpf-next 0/4] Fix few unrelated small bugs and issues Andrii Nakryiko
2020-01-17  6:07 ` [PATCH bpf-next 1/4] libbpf: fix error handling bug in btf_dump__new Andrii Nakryiko
2020-01-17  6:07 ` [PATCH bpf-next 2/4] libbpf: simplify BTF initialization logic Andrii Nakryiko
2020-01-17  6:08 ` [PATCH bpf-next 3/4] libbpf: fix potential multiplication overflow in mmap() size calculation Andrii Nakryiko
2020-01-17  6:08 ` [PATCH bpf-next 4/4] bpftool: avoid const discard compilation warning Andrii Nakryiko
2020-01-17 15:55   ` Quentin Monnet [this message]
2020-01-17 19:03     ` Andrii Nakryiko
2020-01-17 16:35 ` [PATCH bpf-next 0/4] Fix few unrelated small bugs and issues Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1f6c13d-775c-6e48-6102-27332b5366a1@netronome.com \
    --to=quentin.monnet@netronome.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).