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

Change condition, 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_v11_0.c

index dcef399074492dd9d8f676be21438c92ecbae7cf..61e62d846900ce8f625e140c3ac374eff224270d 100644 (file)
@@ -1484,7 +1484,7 @@ static void gfx_v11_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 {
@@ -1497,7 +1497,7 @@ static void gfx_v11_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 {
@@ -1510,7 +1510,7 @@ static void gfx_v11_0_alloc_ip_dump(struct amdgpu_device *adev)
                adev->gfx.me.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 GFX Queues IP Dump\n");
                adev->gfx.ip_dump_gfx_queues = NULL;
        } else {