Commit f3724631 authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by David Sterba

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: default avatarkernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202302210709.IlXfgMpX-lkp@intel.com/Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 8ba7d5f5
...@@ -253,7 +253,7 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...@@ -253,7 +253,7 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt,
#endif #endif
#ifdef CONFIG_BTRFS_ASSERT #ifdef CONFIG_BTRFS_ASSERT
void __cold btrfs_assertfail(const char *expr, const char *file, int line) void __cold __noreturn btrfs_assertfail(const char *expr, const char *file, int line)
{ {
pr_err("assertion failed: %s, in %s:%d\n", expr, file, line); pr_err("assertion failed: %s, in %s:%d\n", expr, file, line);
BUG(); BUG();
......
...@@ -160,7 +160,7 @@ do { \ ...@@ -160,7 +160,7 @@ do { \
} while (0) } while (0)
#ifdef CONFIG_BTRFS_ASSERT #ifdef CONFIG_BTRFS_ASSERT
void __cold btrfs_assertfail(const char *expr, const char *file, int line); void __cold __noreturn btrfs_assertfail(const char *expr, const char *file, int line);
#define ASSERT(expr) \ #define ASSERT(expr) \
(likely(expr) ? (void)0 : btrfs_assertfail(#expr, __FILE__, __LINE__)) (likely(expr) ? (void)0 : btrfs_assertfail(#expr, __FILE__, __LINE__))
......
...@@ -202,6 +202,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, ...@@ -202,6 +202,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
"__reiserfs_panic", "__reiserfs_panic",
"__stack_chk_fail", "__stack_chk_fail",
"__ubsan_handle_builtin_unreachable", "__ubsan_handle_builtin_unreachable",
"btrfs_assertfail",
"cpu_bringup_and_idle", "cpu_bringup_and_idle",
"cpu_startup_entry", "cpu_startup_entry",
"do_exit", "do_exit",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment