Skip to content

Commit f372463

Browse files
jpoimboekdave
authored andcommitted
btrfs: mark btrfs_assertfail() __noreturn
Fixes a bunch of warnings including: vmlinux.o: warning: objtool: select_reloc_root+0x314: unreachable instruction vmlinux.o: warning: objtool: finish_inode_if_needed+0x15b1: unreachable instruction vmlinux.o: warning: objtool: get_bio_sector_nr+0x259: unreachable instruction vmlinux.o: warning: objtool: raid_wait_read_end_io+0xc26: unreachable instruction vmlinux.o: warning: objtool: raid56_parity_alloc_scrub_rbio+0x37b: unreachable instruction ... Reported-by: kernel test robot <[email protected]> Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Josh Poimboeuf <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 8ba7d5f commit f372463

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

fs/btrfs/messages.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt,
253253
#endif
254254

255255
#ifdef CONFIG_BTRFS_ASSERT
256-
void __cold btrfs_assertfail(const char *expr, const char *file, int line)
256+
void __cold __noreturn btrfs_assertfail(const char *expr, const char *file, int line)
257257
{
258258
pr_err("assertion failed: %s, in %s:%d\n", expr, file, line);
259259
BUG();

fs/btrfs/messages.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ do { \
160160
} while (0)
161161

162162
#ifdef CONFIG_BTRFS_ASSERT
163-
void __cold btrfs_assertfail(const char *expr, const char *file, int line);
163+
void __cold __noreturn btrfs_assertfail(const char *expr, const char *file, int line);
164164

165165
#define ASSERT(expr) \
166166
(likely(expr) ? (void)0 : btrfs_assertfail(#expr, __FILE__, __LINE__))

tools/objtool/check.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
202202
"__reiserfs_panic",
203203
"__stack_chk_fail",
204204
"__ubsan_handle_builtin_unreachable",
205+
"btrfs_assertfail",
205206
"cpu_bringup_and_idle",
206207
"cpu_startup_entry",
207208
"do_exit",

0 commit comments

Comments
 (0)