linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Anand Jain <anand.jain@oracle.com>
Cc: kbuild-all@01.org, David Sterba <dsterba@suse.com>,
	Chris Mason <chris.mason@fusionio.com>, Chris Mason <clm@fb.com>,
	Josef Bacik <jbacik@fb.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] btrfs: fix err_cast.cocci warnings
Date: Mon, 29 Jan 2018 02:50:10 +0800	[thread overview]
Message-ID: <20180128185010.GA26805@intel17.lkp.intel.com> (raw)
In-Reply-To: <201801290206.Wy8wLcdm%fengguang.wu@intel.com>

From: Fengguang Wu <fengguang.wu@intel.com>

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 <anand.jain@oracle.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 volumes.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 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);
 

       reply	other threads:[~2018-01-28 18:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201801290206.Wy8wLcdm%fengguang.wu@intel.com>
2018-01-28 18:50 ` kbuild test robot [this message]
2018-01-29 18:40   ` [PATCH] btrfs: fix err_cast.cocci warnings David Sterba
2018-01-29 23:11     ` Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180128185010.GA26805@intel17.lkp.intel.com \
    --to=fengguang.wu@intel.com \
    --cc=anand.jain@oracle.com \
    --cc=chris.mason@fusionio.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jbacik@fb.com \
    --cc=kbuild-all@01.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).