tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.10-wip head: 2f5945e707b5dffbf12444ad8bea079626ad30ec commit: 2f5945e707b5dffbf12444ad8bea079626ad30ec [56/56] drm/amdgpu: add the interface of waiting multiple fences (v4)
coccinelle warnings: (new ones prefixed by >>)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1225:10-29: WARNING: casting value returned by memory allocation function to (struct dma_fence * *) is useless.
Please review and possibly fold the followup patch.
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1225:10-29: WARNING: casting value returned by memory allocation function to (struct dma_fence * *) is useless.
Remove casting the values returned by memory allocation functions like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc.
Semantic patch information: This makes an effort to find cases of casting of values returned by kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc, kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes the casting as it is not required. The result in the patch case may need some reformatting.
Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci
CC: Junwei Zhang Jerry.Zhang@amd.com Signed-off-by: Fengguang Wu fengguang.wu@intel.com ---
amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1222,7 +1222,7 @@ static int amdgpu_cs_wait_any_fence(stru long r;
/* Prepare the fence array */ - array = (struct dma_fence **)kcalloc(fence_count, sizeof(struct dma_fence *), + array = kcalloc(fence_count, sizeof(struct dma_fence *), GFP_KERNEL); if (array == NULL) return -ENOMEM;
dri-devel@lists.freedesktop.org