diff mbox

btrfs: fix ptr_ret.cocci warnings

Message ID 20180710132414.GA25686@athens (mailing list archive)
State New, archived
Headers show

Commit Message

Fengguang Wu July 10, 2018, 1:24 p.m. UTC
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(-)

--
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
diff mbox

Patch

--- 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,