drm/msm/a5xx: remove null pointer check on pdev
Subsystems (5)
PATCH v2 1/1 drm/msm/a5xx: remove null pointer check on pdev
The call chain on a5xx_gpu_init is such that pdev is not going to be null, so the null check on pdev can be removed. This also cleans up a static analysis warning where pdev is dereferenced before the null check which cannot actually occur.
---
V2: rewrite Subject, remove null check on pdev
--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +0 -5
@@ -1760,11 +1760,6 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)unsigned int nr_rings;int ret; -if (!pdev) { -DRM_DEV_ERROR (dev->dev,"No A5XX device is defined\n" ); -return ERR_PTR (-ENXIO ); - } - a5xx_gpu =kzalloc (sizeof (*a5xx_gpu),GFP_KERNEL );if (!a5xx_gpu)return ERR_PTR (-ENOMEM );
Signature · 1 line
2.39.5
Quoted 7 lines · Colin Ian King
The call chain on
a5xx_gpu_initis such that pdev is not going to be null, so the null check on pdev can be removed. This also cleans up a static analysis warning where pdev is dereferenced before the null check which cannot actually occur.Signed-off-by Colin Ian King <[email protected]>
-Akhil
Quoted 24 lines
---
V2: rewrite Subject, remove null check on pdev
--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 ----- 1 file changed, 5 deletions(-)drivers/gpu/drm/msm/adreno/a5xx_gpu.c +0
-5@@ -1760,11 +1760,6 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)unsigned int nr_rings;int ret; -if (!pdev) { -DRM_DEV_ERROR (dev->dev,"No A5XX device is defined\n" ); -return ERR_PTR (-ENXIO ); - } - a5xx_gpu =kzalloc (sizeof (*a5xx_gpu),GFP_KERNEL );if (!a5xx_gpu)return ERR_PTR (-ENOMEM );
Quoted 8 lines · Colin Ian King
The call chain on
a5xx_gpu_initis such that pdev is not going to be null, so the null check on pdev can be removed. This also cleans up a static analysis warning where pdev is dereferenced before the null check which cannot actually occur.Signed-off-by Colin Ian King <[email protected]>---
Konrad