drm/amd/display: fix ptr_ret.cocci warnings
authorkbuild test robot <fengguang.wu@intel.com>
Wed, 12 Sep 2018 00:59:07 +0000 (08:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 12 Sep 2018 21:29:57 +0000 (16:29 -0500)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c:771:1-3: 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: e498eb713604 ("drm/amd/display: Add support for hw_state logging via debugfs")
CC: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c

index 35ca732f7ffe08cefa1fc02cc7d6603490b74a54..0ef4a40d2247f3edaf3a5e84ebe97ccb8911f87c 100644 (file)
@@ -801,8 +801,5 @@ int dtn_debugfs_init(struct amdgpu_device *adev)
                adev,
                &dtn_log_fops);
 
-       if (IS_ERR(ent))
-               return PTR_ERR(ent);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(ent);
 }