]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: Fix a compilation error with fallthrough marking
authorYonghong Song <yhs@fb.com>
Tue, 6 Oct 2020 04:34:27 +0000 (21:34 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 6 Oct 2020 18:45:03 +0000 (11:45 -0700)
commitd868b170c5ea22dad1e4642856b51a974383f0d8
tree0906753354be5f71cd036a9695062237430f4d3d
parentbe90b53de6faf019b890c4bef4262520a173bc11
samples/bpf: Fix a compilation error with fallthrough marking

Compiling samples/bpf hits an error related to fallthrough marking.
    ...
    CC  samples/bpf/hbm.o
  samples/bpf/hbm.c: In function ‘main’:
  samples/bpf/hbm.c:486:4: error: ‘fallthrough’ undeclared (first use in this function)
      fallthrough;
      ^~~~~~~~~~~

The "fallthrough" is not defined under tools/include directory.
Rather, it is "__fallthrough" is defined in linux/compiler.h.
Including "linux/compiler.h" and using "__fallthrough" fixed the issue.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201006043427.1891805-1-yhs@fb.com
samples/bpf/hbm.c