From: kbuild test robot <fengguang...@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 <g...@cn.fujitsu.com>
Signed-off-by: kbuild test robot <fengguang...@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,
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to