[PATCH] afs: fix no return statement in function returning non-void
Randy Dunlap
rdunlap at infradead.org
Mon Apr 19 23:31:06 BST 2021
On 4/8/21 7:06 AM, David Howells wrote:
> Zheng Zengkai <zhengzengkai at 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.
--
~Randy
More information about the linux-afs
mailing list