]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: fix ptr check warning in gfx9 ip_dump
authorSunil Khatri <sunil.khatri@amd.com>
Wed, 7 Aug 2024 11:51:53 +0000 (17:21 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:03:35 +0000 (12:03 +0200)
[ Upstream commit 07f4f9c00ec545dfa6251a44a09d2c48a76e7ee5 ]

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

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 7d517c94c3efb9bdc6ee01df8df32013999666e2..6f178bfb8f1041b1cf4f85f5bddbc20938838909 100644 (file)
@@ -2133,7 +2133,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 {
@@ -2146,7 +2146,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 {