From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com ([192.55.52.88]:13744 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929AbbI3Eg4 (ORCPT ); Wed, 30 Sep 2015 00:36:56 -0400 Date: Wed, 30 Sep 2015 12:35:45 +0800 From: kbuild test robot To: Omar Sandoval Cc: kbuild-all@01.org, linux-btrfs@vger.kernel.org, Omar Sandoval Subject: [PATCH] Btrfs: fix simple_return.cocci warnings Message-ID: <20150930043545.GA11964@athens> References: <201509301242.BVTVNkGj%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <3319d371e22491b6901af33842b57db37b77c52c.1443583874.git.osandov@osandov.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: fs/btrfs/free-space-tree.c:1255:1-4: WARNING: end returns can be simpified fs/btrfs/free-space-tree.c:1168:1-4: WARNING: end returns can be simpified Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Omar Sandoval Signed-off-by: Fengguang Wu --- free-space-tree.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) --- a/fs/btrfs/free-space-tree.c +++ b/fs/btrfs/free-space-tree.c @@ -1165,11 +1165,7 @@ int btrfs_create_free_space_tree(struct btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE); - ret = btrfs_commit_transaction(trans, tree_root); - if (ret) - return ret; - - return 0; + return btrfs_commit_transaction(trans, tree_root); abort: btrfs_abort_transaction(trans, tree_root, ret); @@ -1252,11 +1248,7 @@ int btrfs_clear_free_space_tree(struct b free_extent_buffer(free_space_root->commit_root); kfree(free_space_root); - ret = btrfs_commit_transaction(trans, tree_root); - if (ret) - return ret; - - return 0; + return btrfs_commit_transaction(trans, tree_root); abort: btrfs_abort_transaction(trans, tree_root, ret);