Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/amdgpu : Fix NULL pointer comparison

Replace direct comparisons to NULL i.e.
'x == NULL' with '!x'. As per coding standard.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Ravikant B Sharma <ravikant.s2@samsung.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Ravikant B Sharma and committed by
Alex Deucher
3f12325a bc24fbe9

+3 -4
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
··· 70 70 return false; 71 71 } 72 72 adev->bios = kmalloc(size, GFP_KERNEL); 73 - if (adev->bios == NULL) { 73 + if (!adev->bios) { 74 74 iounmap(bios); 75 75 return false; 76 76 }
+1 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
··· 327 327 return -EINVAL; 328 328 329 329 *sa_bo = kmalloc(sizeof(struct amdgpu_sa_bo), GFP_KERNEL); 330 - if ((*sa_bo) == NULL) { 330 + if (!(*sa_bo)) 331 331 return -ENOMEM; 332 - } 333 332 (*sa_bo)->manager = sa_manager; 334 333 (*sa_bo)->fence = NULL; 335 334 INIT_LIST_HEAD(&(*sa_bo)->olist);
+1 -1
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
··· 3904 3904 int list_size; 3905 3905 unsigned int *register_list_format = 3906 3906 kmalloc(adev->gfx.rlc.reg_list_format_size_bytes, GFP_KERNEL); 3907 - if (register_list_format == NULL) 3907 + if (!register_list_format) 3908 3908 return -ENOMEM; 3909 3909 memcpy(register_list_format, adev->gfx.rlc.register_list_format, 3910 3910 adev->gfx.rlc.reg_list_format_size_bytes);