]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Fix missing BUILD_BUG_ON() declaration
authorTony Ambardar <tony.ambardar@gmail.com>
Tue, 23 Jul 2024 05:54:36 +0000 (22:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:29:16 +0000 (16:29 +0200)
commitbedda119babcfa518f07d62e3b46af99d19c87bf
tree5b8cc8bae0ce391509d0a2548a6195df0a3e07f0
parent4bff8cc537ce4f37b3ec47de7db9523b6c95c11e
selftests/bpf: Fix missing BUILD_BUG_ON() declaration

[ Upstream commit 6495eb79ca7d15bd87c38d77307e8f9b6b7bf4ef ]

Explicitly include '<linux/build_bug.h>' to fix errors seen compiling with
gcc targeting mips64el/musl-libc:

  user_ringbuf.c: In function 'test_user_ringbuf_loop':
  user_ringbuf.c:426:9: error: implicit declaration of function 'BUILD_BUG_ON' [-Werror=implicit-function-declaration]
    426 |         BUILD_BUG_ON(total_samples <= c_max_entries);
        |         ^~~~~~~~~~~~
  cc1: all warnings being treated as errors

Fixes: e5a9df51c746 ("selftests/bpf: Add selftests validating the user ringbuf")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/b28575f9221ec54871c46a2e87612bb4bbf46ccd.1721713597.git.tony.ambardar@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/user_ringbuf.c