From patchwork Wed Sep 30 04:35:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 7292631 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F117BEEA4 for ; Wed, 30 Sep 2015 04:37:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6C9820623 for ; Wed, 30 Sep 2015 04:37:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA08220628 for ; Wed, 30 Sep 2015 04:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752045AbbI3Eg5 (ORCPT ); Wed, 30 Sep 2015 00:36:57 -0400 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 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 29 Sep 2015 21:36:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,610,1437462000"; d="scan'208";a="800179699" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga001.fm.intel.com with ESMTP; 29 Sep 2015 21:36:54 -0700 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1Zh98F-000U7A-Js; Wed, 30 Sep 2015 12:36:43 +0800 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-Disposition: inline In-Reply-To: <3319d371e22491b6901af33842b57db37b77c52c.1443583874.git.osandov@osandov.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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);