Message ID | 20190130145102.4708-3-nborisov@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Improvements to fitrim | expand |
On Wed, Jan 30, 2019 at 04:50:49PM +0200, Nikolay Borisov wrote: > There is no point in using a construct like 'if (!condition) > WARN_ON(1)'. Use WARN_ON(!condition) directly. No functional changes. > > Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com>
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index fc3f6acc3c9b..79d0bc813a72 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -10798,13 +10798,10 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, } spin_lock(&trans->transaction->dirty_bgs_lock); - if (!list_empty(&block_group->dirty_list)) { - WARN_ON(1); - } - if (!list_empty(&block_group->io_list)) { - WARN_ON(1); - } + WARN_ON(!list_empty(&block_group->dirty_list)); + WARN_ON(!list_empty(&block_group->io_list)); spin_unlock(&trans->transaction->dirty_bgs_lock); + btrfs_remove_free_space_cache(block_group); spin_lock(&block_group->space_info->lock);
There is no point in using a construct like 'if (!condition) WARN_ON(1)'. Use WARN_ON(!condition) directly. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> --- fs/btrfs/extent-tree.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)