[PATCH v1 5/5] drm/amdgpu: fix ptr check warning in vcn_v3 ip_dump

Sunil Khatri sunil.khatri at amd.com
Wed Aug 7 12:02:17 UTC 2024


Change condition, if (ptr == NULL) to if (!ptr)
for a better format and fix the warning.

Signed-off-by: Sunil Khatri <sunil.khatri at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
index c2278cc49dd5..6d74da7b7ffb 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
@@ -359,7 +359,7 @@ static int vcn_v3_0_sw_init(void *handle)
 
 	/* Allocate memory for VCN IP Dump buffer */
 	ptr = kcalloc(adev->vcn.num_vcn_inst * reg_count, sizeof(uint32_t), GFP_KERNEL);
-	if (ptr == NULL) {
+	if (!ptr) {
 		DRM_ERROR("Failed to allocate memory for VCN IP Dump\n");
 		adev->vcn.ip_dump = NULL;
 	} else {
-- 
2.34.1



More information about the amd-gfx mailing list