From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <linmiaohe@huawei.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<pabeni@redhat.com>, <kuniyu@amazon.com>
Subject: Re: [PATCH] net: skbuff: fix missing a __noreturn annotation warning
Date: Fri, 26 May 2023 21:00:38 -0700 [thread overview]
Message-ID: <20230527040038.6783-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20230527110409.497408-1-linmiaohe@huawei.com>
From: Miaohe Lin <linmiaohe@huawei.com>
Date: Sat, 27 May 2023 19:04:09 +0800
> Add __noreturn annotation to fix the warning:
> net/core/skbuff.o: warning: objtool: skb_push+0x3c: skb_panic() is missing a __noreturn annotation
> net/core/skbuff.o: warning: objtool: skb_put+0x4e: skb_panic() is missing a __noreturn annotation
What arch are you using ?
IIUC, BUG() should have an annotation for objtool, for
example, __builtin_unreachable() for x86.
Maybe the arch is missing such an annotation ?
Also I'm curious why objtool complains about only skb_push(),
there should be more non-inline functions that has BUG().
Thanks,
Kuniyuki
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> net/core/skbuff.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 6724a84ebb09..12b525aa4783 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -181,8 +181,8 @@ EXPORT_SYMBOL_GPL(drop_reasons_unregister_subsys);
> * Keep out of line to prevent kernel bloat.
> * __builtin_return_address is not used because it is not always reliable.
> */
> -static void skb_panic(struct sk_buff *skb, unsigned int sz, void *addr,
> - const char msg[])
> +static void __noreturn skb_panic(struct sk_buff *skb, unsigned int sz, void *addr,
> + const char msg[])
> {
> pr_emerg("%s: text:%px len:%d put:%d head:%px data:%px tail:%#lx end:%#lx dev:%s\n",
> msg, addr, skb->len, sz, skb->head, skb->data,
> --
> 2.27.0
next prev parent reply other threads:[~2023-05-27 4:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-27 11:04 [PATCH] net: skbuff: fix missing a __noreturn annotation warning Miaohe Lin
2023-05-27 4:00 ` Kuniyuki Iwashima [this message]
2023-05-27 9:22 ` Miaohe Lin
2023-05-30 10:28 ` Paolo Abeni
2023-06-03 3:09 ` Miaohe Lin
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=20230527040038.6783-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).