From: David Sterba Date: Tue, 14 Apr 2026 15:30:29 +0000 (+0200) Subject: btrfs: move condition to WARN_ON in btrfs_set_delalloc_extent() X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=cf384a2ab86bc63df4f1f58f3e79407be75848b4;p=thirdparty%2Flinux.git btrfs: move condition to WARN_ON in btrfs_set_delalloc_extent() For a simple if + WARN_ON we should use the condition directly in the macro. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7557b571a5d9a..fd58f7792d942 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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