From: Randy Dunlap <rdunlap@infradead.org>
To: David Howells <dhowells@redhat.com>,
Zheng Zengkai <zhengzengkai@huawei.com>
Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org,
huawei.libin@huawei.com
Subject: Re: [PATCH] afs: fix no return statement in function returning non-void
Date: Thu, 27 May 2021 12:48:04 -0700 [thread overview]
Message-ID: <2bc0f5fd-2519-7b53-7535-99054607ea4c@infradead.org> (raw)
In-Reply-To: <02f8940c-e1af-fffa-8bb3-3bfa96bfafa9@infradead.org>
On 4/19/21 3:31 PM, Randy Dunlap wrote:
> On 4/8/21 7:06 AM, David Howells wrote:
>> Zheng Zengkai <zhengzengkai@huawei.com> wrote:
>>
>>> static int afs_dir_set_page_dirty(struct page *page)
>>> {
>>> BUG(); /* This should never happen. */
>>> + return 0;
>>> }
>>
>> That shouldn't be necessary. BUG() should be marked as 'no return' to the
>> compiler. What arch and compiler are you using?
>
> How do mark a #define BUG() as __noreturn?
>
> Several arch-es use #define for BUG() instead of using a function.
Hi David,
So you are counting of BUG() being a function and not a macro?
Doesn't seem like a good idea.
--
~Randy
next prev parent reply other threads:[~2021-05-27 19:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-27 12:16 [PATCH] afs: fix no return statement in function returning non-void Zheng Zengkai
2021-03-31 2:32 ` Zheng Zengkai
2021-04-08 14:06 ` David Howells
2021-04-19 22:31 ` Randy Dunlap
2021-05-27 19:48 ` Randy Dunlap [this message]
2021-06-15 11:55 David Howells
2021-06-15 12:03 ` David Howells
2021-06-15 14:49 ` Linus Torvalds
2021-06-15 23:58 ` Randy Dunlap
2021-06-16 0:32 ` Linus Torvalds
2021-06-16 1:38 ` Randy Dunlap
2021-06-16 2:19 ` Randy Dunlap
2021-06-16 3:15 ` Zheng Zengkai
2021-06-16 12:56 ` Tom Rix
2021-06-16 14:34 ` Linus Torvalds
2021-06-16 16:22 ` Tom Rix
2021-06-16 16:29 ` Linus Torvalds
2021-06-18 15:23 ` Arnd Bergmann
2021-06-16 13:41 ` David Howells
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=2bc0f5fd-2519-7b53-7535-99054607ea4c@infradead.org \
--to=rdunlap@infradead.org \
--cc=dhowells@redhat.com \
--cc=huawei.libin@huawei.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhengzengkai@huawei.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).