From: Song Liu <songliubraving@fb.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>, Martin Lau <kafai@fb.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH, net-next 1/2] bpf: btf: avoid -Wreturn-type warning
Date: Fri, 25 May 2018 21:53:11 +0000 [thread overview]
Message-ID: <97F843D7-7E81-44B3-AE97-112ABFE8E892@fb.com> (raw)
In-Reply-To: <20180525213331.2115471-1-arnd@arndb.de>
> On May 25, 2018, at 2:33 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>
> 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 <arnd@arndb.de>
> ---
> kernel/bpf/btf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 9cbeabb5aca3..2822a0cf4f48 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();
> }
> }
>
> --
> 2.9.0
>
Acked-by: Song Liu <songliubraving@fb.com>
next prev parent reply other threads:[~2018-05-25 21:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 21:33 Arnd Bergmann
2018-05-25 21:33 ` [PATCH, net-next 2/2] bpf: avoid -Wmaybe-uninitialized warning Arnd Bergmann
2018-05-25 21:54 ` Song Liu
2018-05-27 22:37 ` Daniel Borkmann
2018-05-25 21:53 ` Song Liu [this message]
2018-05-27 22:36 ` [PATCH, net-next 1/2] bpf: btf: avoid -Wreturn-type warning Daniel Borkmann
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=97F843D7-7E81-44B3-AE97-112ABFE8E892@fb.com \
--to=songliubraving@fb.com \
--cc=arnd@arndb.de \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®