From patchwork Tue Jul 10 13:24:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10516993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E0C24600CA for ; Tue, 10 Jul 2018 13:24:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE127290C7 for ; Tue, 10 Jul 2018 13:24:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C22AB290CD; Tue, 10 Jul 2018 13:24:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74E76290CC for ; Tue, 10 Jul 2018 13:24:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754333AbeGJNYS (ORCPT ); Tue, 10 Jul 2018 09:24:18 -0400 Received: from mga06.intel.com ([134.134.136.31]:54009 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754260AbeGJNYR (ORCPT ); Tue, 10 Jul 2018 09:24:17 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 06:24:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,334,1526367600"; d="scan'208";a="53949736" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga008.fm.intel.com with ESMTP; 10 Jul 2018 06:24:15 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1fcscp-0009lC-7N; Tue, 10 Jul 2018 21:24:15 +0800 Date: Tue, 10 Jul 2018 21:24:14 +0800 From: kbuild test robot To: Gu Jinxiang Cc: kbuild-all@01.org, linux-btrfs@vger.kernel.org, nborisov@suse.com Subject: [PATCH] btrfs: fix ptr_ret.cocci warnings Message-ID: <20180710132414.GA25686@athens> References: <1531218442-12885-2-git-send-email-gujx@cn.fujitsu.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1531218442-12885-2-git-send-email-gujx@cn.fujitsu.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: lkp@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-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot fs/btrfs/super.c:2243:8-14: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Fixes: 193ea416dc5e ("btrfs: get fs_devices pointer form btrfs_scan_one_device") CC: Gu Jinxiang Signed-off-by: kbuild test robot --- super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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/super.c +++ b/fs/btrfs/super.c @@ -2240,7 +2240,7 @@ static long btrfs_control_ioctl(struct f case BTRFS_IOC_SCAN_DEV: fs_devices = btrfs_scan_one_device(vol->name, FMODE_READ, &btrfs_root_fs_type); - ret = IS_ERR(fs_devices) ? PTR_ERR(fs_devices) : 0; + ret = PTR_ERR_OR_ZERO(fs_devices); break; case BTRFS_IOC_DEVICES_READY: fs_devices = btrfs_scan_one_device(vol->name, FMODE_READ,