]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: mark btrfs_assertfail() __noreturn
authorJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 12 Apr 2023 23:49:38 +0000 (16:49 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 17:52:19 +0000 (19:52 +0200)
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 <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202302210709.IlXfgMpX-lkp@intel.com/
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/messages.c
fs/btrfs/messages.h
tools/objtool/check.c

index fde5aaa6e7c956b264724eefddd265de6753b4c6..310a05cf95ef3b8a1210bb2265bb34a40da353db 100644 (file)
@@ -253,7 +253,7 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt,
 #endif
 
 #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);
        BUG();
index 8c516ee58ff95b3b9bd81f085b24e3da0e21fc6a..ac2d1982ba3df826a2ac73a8a8e01bb902990441 100644 (file)
@@ -160,7 +160,7 @@ do {                                                                \
 } while (0)
 
 #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)                                           \
        (likely(expr) ? (void)0 : btrfs_assertfail(#expr, __FILE__, __LINE__))
index f937be1afe65ca9c968038c701b927dd4126f409..060032cfb0469d568ab1f3e834a34b957a619190 100644 (file)
@@ -202,6 +202,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
                "__reiserfs_panic",
                "__stack_chk_fail",
                "__ubsan_handle_builtin_unreachable",
+               "btrfs_assertfail",
                "cpu_bringup_and_idle",
                "cpu_startup_entry",
                "do_exit",