From: Arnd Bergmann Date: Fri, 25 May 2018 21:33:19 +0000 (+0200) Subject: bpf: btf: avoid -Wreturn-type warning X-Git-Tag: v4.19~872^2~9^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53c8036cb715f3577a7fe1db6e6ad06e8697b36f;p=platform%2Fkernel%2Flinux-rpi.git bpf: btf: avoid -Wreturn-type warning gcc warns about a noreturn function possibly returning in some configurations: kernel/bpf/btf.c: In function 'env_type_is_resolve_sink': kernel/bpf/btf.c:729:1: error: control reaches end of non-void function [-Werror=return-type] Using BUG() instead of BUG_ON() avoids that warning and otherwise does the exact same thing. Fixes: eb3f595dab40 ("bpf: btf: Validate type reference") Signed-off-by: Arnd Bergmann Acked-by: Song Liu Signed-off-by: Daniel Borkmann --- diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 7e90fd1..3d20aa1 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -749,7 +749,7 @@ static bool env_type_is_resolve_sink(const struct btf_verifier_env *env, !btf_type_is_array(next_type) && !btf_type_is_struct(next_type); default: - BUG_ON(1); + BUG(); } }