]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: move condition to WARN_ON in btrfs_set_delalloc_extent()
authorDavid Sterba <dsterba@suse.com>
Tue, 14 Apr 2026 15:30:29 +0000 (17:30 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Jun 2026 13:53:28 +0000 (15:53 +0200)
For a simple if + WARN_ON we should use the condition directly in the
macro.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 7557b571a5d9ad82e22c6f354c1e6cf611281a36..fd58f7792d94242249c7baef3090a8e29586e5be 100644 (file)
@@ -2605,8 +2605,7 @@ void btrfs_set_delalloc_extent(struct btrfs_inode *inode, struct extent_state *s
 
        lockdep_assert_held(&inode->io_tree.lock);
 
-       if ((bits & EXTENT_DEFRAG) && !(bits & EXTENT_DELALLOC))
-               WARN_ON(1);
+       WARN_ON((bits & EXTENT_DEFRAG) && !(bits & EXTENT_DELALLOC));
        /*
         * set_bit and clear bit hooks normally require _irqsave/restore
         * but in this case, we are only testing for the DELALLOC