[<prev] [next>] [day] [month] [year] [list]
Message-id: <1478584182-3901-1-git-send-email-ravikant.s2@samsung.com>
Date: Tue, 08 Nov 2016 11:19:42 +0530
From: Ravikant Bijendra Sharma <ravikant.s2@...sung.com>
To: Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Airlie <airlied@...ux.ie>,
Nils Wallménius
<nils.wallmenius@...il.com>, Jammy Zhou <Jammy.Zhou@....com>,
"monk.liu" <Monk.Liu@....com>,
Ravikant B Sharma <ravikant.s2@...sung.com>,
Edward O'Callaghan <funfunctor@...klore1984.net>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Nicolai Hähnle <nicolai.haehnle@....com>,
Gustavo Padovan <gustavo.padovan@...labora.co.uk>,
Junwei Zhang <Jerry.Zhang@....com>,
Tom St Denis <tom.stdenis@....com>,
Chunming Zhou <David1.Zhou@....com>,
Ken Wang <Qingqing.Wang@....com>,
Flora Cui <Flora.Cui@....com>,
Eric Huang <JinHuiEric.Huang@....com>
Cc: dri-devel@...ts.freedesktop.org, linux-media@...r.kernel.org,
devel@...verdev.osuosl.org,
shailesh pandey <p.shailesh@...sung.com>,
linux-kernel@...r.kernel.org, vidushi.koul@...sung.com
Subject: [PATCH] drm/amd/amdgpu : Fix NULL pointer comparison
From: Ravikant B Sharma <ravikant.s2@...sung.com>
Replace direct comparisons to NULL i.e.
'x == NULL' with '!x'. As per coding standard.
Signed-off-by: Ravikant B Sharma <ravikant.s2@...sung.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 3 +--
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index 2b6afe1..b7e2762 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -70,7 +70,7 @@ static bool igp_read_bios_from_vram(struct amdgpu_device *adev)
return false;
}
adev->bios = kmalloc(size, GFP_KERNEL);
- if (adev->bios == NULL) {
+ if (!adev->bios) {
iounmap(bios);
return false;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
index d8af37a..3ecb083 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
@@ -327,9 +327,8 @@ int amdgpu_sa_bo_new(struct amdgpu_sa_manager *sa_manager,
return -EINVAL;
*sa_bo = kmalloc(sizeof(struct amdgpu_sa_bo), GFP_KERNEL);
- if ((*sa_bo) == NULL) {
+ if (!(*sa_bo))
return -ENOMEM;
- }
(*sa_bo)->manager = sa_manager;
(*sa_bo)->fence = NULL;
INIT_LIST_HEAD(&(*sa_bo)->olist);
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index ee6a48a..6c020ea7 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -3905,7 +3905,7 @@ static int gfx_v8_0_init_save_restore_list(struct amdgpu_device *adev)
int list_size;
unsigned int *register_list_format =
kmalloc(adev->gfx.rlc.reg_list_format_size_bytes, GFP_KERNEL);
- if (register_list_format == NULL)
+ if (!register_list_format)
return -ENOMEM;
memcpy(register_list_format, adev->gfx.rlc.register_list_format,
adev->gfx.rlc.reg_list_format_size_bytes);
--
1.7.9.5
Powered by blists - more mailing lists