From: kbuild test robot Date: Wed, 12 Sep 2018 00:59:07 +0000 (+0800) Subject: drm/amd/display: fix ptr_ret.cocci warnings X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8901a65f080ad6f4d7c3ef9f23c6f3a0e3e194aa;p=openwrt%2Fstaging%2Fblogic.git drm/amd/display: fix ptr_ret.cocci warnings 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 Signed-off-by: kbuild test robot Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index 35ca732f7ffe..0ef4a40d2247 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -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); }