From patchwork Sun Jan 28 18:50:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10187937 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 41C1E6056A for ; Sun, 28 Jan 2018 18:52:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30B7828735 for ; Sun, 28 Jan 2018 18:52:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2541C2873C; Sun, 28 Jan 2018 18:52:07 +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=-6.9 required=2.0 tests=BAYES_00,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 C826E2873A for ; Sun, 28 Jan 2018 18:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbeA1SvJ (ORCPT ); Sun, 28 Jan 2018 13:51:09 -0500 Received: from mga12.intel.com ([192.55.52.136]:10963 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752018AbeA1SvH (ORCPT ); Sun, 28 Jan 2018 13:51:07 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2018 10:51:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,427,1511856000"; d="scan'208";a="14996074" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga002.fm.intel.com with ESMTP; 28 Jan 2018 10:51:06 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1efs8o-000KRP-Gc; Mon, 29 Jan 2018 02:57:22 +0800 Date: Mon, 29 Jan 2018 02:50:10 +0800 From: kbuild test robot To: Anand Jain Cc: kbuild-all@01.org, David Sterba , Chris Mason , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: fix err_cast.cocci warnings Message-ID: <20180128185010.GA26805@intel17.lkp.intel.com> References: <201801290206.Wy8wLcdm%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201801290206.Wy8wLcdm%fengguang.wu@intel.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-Virus-Scanned: ClamAV using ClamSMTP From: Fengguang Wu fs/btrfs/volumes.c:742:10-17: WARNING: ERR_CAST can be used with fs_devices Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Generated by: scripts/coccinelle/api/err_cast.cocci Fixes: bf155c98d312 ("btrfs: get device pointer from device_list_add()") CC: Anand Jain Signed-off-by: Fengguang Wu --- volumes.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/volumes.c +++ b/fs/btrfs/volumes.c @@ -739,7 +739,7 @@ static noinline struct btrfs_device *dev if (!fs_devices) { fs_devices = alloc_fs_devices(disk_super->fsid); if (IS_ERR(fs_devices)) - return ERR_PTR(PTR_ERR(fs_devices)); + return ERR_CAST(fs_devices); list_add(&fs_devices->list, &fs_uuids);