From: Sunil Khatri Date: Wed, 7 Aug 2024 11:51:53 +0000 (+0530) Subject: drm/amdgpu: fix ptr check warning in gfx9 ip_dump X-Git-Tag: configfs-6.13-2024-11-19~386^2~17^2~147 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=07f4f9c00ec545dfa6251a44a09d2c48a76e7ee5;p=users%2Fhch%2Fconfigfs.git drm/amdgpu: fix ptr check warning in gfx9 ip_dump Change if (ptr == NULL) to if (!ptr) for a better format and fix the warning. Reviewed-by: Alex Deucher Signed-off-by: Sunil Khatri Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 991f7c2fc1a2..ab10a05c7885 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -2129,7 +2129,7 @@ static void gfx_v9_0_alloc_ip_dump(struct amdgpu_device *adev) uint32_t inst; ptr = kcalloc(reg_count, sizeof(uint32_t), GFP_KERNEL); - if (ptr == NULL) { + if (!ptr) { DRM_ERROR("Failed to allocate memory for GFX IP Dump\n"); adev->gfx.ip_dump_core = NULL; } else { @@ -2142,7 +2142,7 @@ static void gfx_v9_0_alloc_ip_dump(struct amdgpu_device *adev) adev->gfx.mec.num_queue_per_pipe; ptr = kcalloc(reg_count * inst, sizeof(uint32_t), GFP_KERNEL); - if (ptr == NULL) { + if (!ptr) { DRM_ERROR("Failed to allocate memory for Compute Queues IP Dump\n"); adev->gfx.ip_dump_compute_queues = NULL; } else {