[PATCH] drm/amd/display: fix ptr_ret.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: kbuild test robot <fengguang.wu@xxxxxxxxx>

drivers/gpu/drm/amd/amdgpu/../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@xxxxxxx>
Signed-off-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
---

tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.20-wip
head:   bdb1922abd620d24715906bac4d119274d98f4c9
commit: e498eb7136042aa9a352b1039c678537f4694158 [220/235] drm/amd/display: Add support for hw_state logging via debugfs

 amdgpu_dm_debugfs.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -768,8 +768,5 @@ int dtn_debugfs_init(struct amdgpu_devic
 		adev,
 		&dtn_log_fops);
 
-	if (IS_ERR(ent))
-		return PTR_ERR(ent);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(ent);
 }
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux