Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 3afde3b

Browse files
amd-sukhatrigregkh
authored andcommitted
drm/amdgpu: fix ptr check warning in gfx11 ip_dump
[ Upstream commit bd15f80 ] 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>
1 parent 8464d23 commit 3afde3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ static void gfx_v11_0_alloc_ip_dump(struct amdgpu_device *adev)
14841484
uint32_t inst;
14851485

14861486
ptr = kcalloc(reg_count, sizeof(uint32_t), GFP_KERNEL);
1487-
if (ptr == NULL) {
1487+
if (!ptr) {
14881488
DRM_ERROR("Failed to allocate memory for GFX IP Dump\n");
14891489
adev->gfx.ip_dump_core = NULL;
14901490
} else {
@@ -1497,7 +1497,7 @@ static void gfx_v11_0_alloc_ip_dump(struct amdgpu_device *adev)
14971497
adev->gfx.mec.num_queue_per_pipe;
14981498

14991499
ptr = kcalloc(reg_count * inst, sizeof(uint32_t), GFP_KERNEL);
1500-
if (ptr == NULL) {
1500+
if (!ptr) {
15011501
DRM_ERROR("Failed to allocate memory for Compute Queues IP Dump\n");
15021502
adev->gfx.ip_dump_compute_queues = NULL;
15031503
} else {
@@ -1510,7 +1510,7 @@ static void gfx_v11_0_alloc_ip_dump(struct amdgpu_device *adev)
15101510
adev->gfx.me.num_queue_per_pipe;
15111511

15121512
ptr = kcalloc(reg_count * inst, sizeof(uint32_t), GFP_KERNEL);
1513-
if (ptr == NULL) {
1513+
if (!ptr) {
15141514
DRM_ERROR("Failed to allocate memory for GFX Queues IP Dump\n");
15151515
adev->gfx.ip_dump_gfx_queues = NULL;
15161516
} else {

0 commit comments

Comments
 (0)