Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: suppress -Wcast-function-type warning #265

Closed
wants to merge 2 commits into from

Commits on Nov 6, 2020

  1. adding ci files

    kernel-patches-bot committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    bafec06 View commit details
    Browse the repository at this point in the history
  2. bpf: suppress -Wcast-function-type warning

    Building with -Wextra shows lots of warnings in the bpf
    code such as
    
    kernel/bpf/verifier.c: In function ‘jit_subprogs’:
    include/linux/filter.h:345:4: warning: cast between incompatible function types from ‘unsigned int (*)(const void *, const struct bpf_insn *)’ to ‘u64 (*)(u64,  u64,  u64,  u64,  u64)’ {aka ‘long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)’} [-Wcast-function-type]
      345 |   ((u64 (*)(u64, u64, u64, u64, u64))(x))
          |    ^
    kernel/bpf/verifier.c:10706:16: note: in expansion of macro ‘BPF_CAST_CALL’
    10706 |    insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) -
          |                ^~~~~~~~~~~~~
    
    This appears to be intentional, so change the cast in a way that
    suppresses the warning.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Andrii Nakryiko <andrii@kernel.org>
    arndb authored and kernel-patches-bot committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    811ef92 View commit details
    Browse the repository at this point in the history