From: kbuild test robot <fengguang.wu@intel.com>
To: Gu Jinxiang <gujx@cn.fujitsu.com>
Cc: kbuild-all@01.org, linux-btrfs@vger.kernel.org, nborisov@suse.com
Subject: [PATCH] btrfs: fix ptr_ret.cocci warnings
Date: Tue, 10 Jul 2018 21:24:14 +0800 [thread overview]
Message-ID: <20180710132414.GA25686@athens> (raw)
In-Reply-To: <1531218442-12885-2-git-send-email-gujx@cn.fujitsu.com>
From: kbuild test robot <fengguang.wu@intel.com>
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 <gujx@cn.fujitsu.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
---
super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- 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,
next prev parent reply other threads:[~2018-07-10 13:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 10:27 [PATCH v2 1/2] btrfs: make fs_devices to be a local variable Gu Jinxiang
2018-07-10 10:27 ` [PATCH v2 2/2] btrfs: get fs_devices pointer form btrfs_scan_one_device Gu Jinxiang
2018-07-10 13:24 ` kbuild test robot
2018-07-10 13:24 ` kbuild test robot [this message]
2018-07-10 10:27 ` [PATCH " Gu Jinxiang
2018-07-10 10:30 ` Gu, Jinxiang
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=20180710132414.GA25686@athens \
--to=fengguang.wu@intel.com \
--cc=gujx@cn.fujitsu.com \
--cc=kbuild-all@01.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
/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).