Skip to contentSkip to conversation

drm/amdgpu: remove not needed memset

PATCH Applied zhengbin 2 participants 2 messages Nov 18, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

zhengbin

author
#0 lore raw

PATCH 1/1 drm/amdgpu: remove not needed memset

Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c:64:13-31: WARNING: dma_alloc_coherent use in ih -> ring already zeroes out memory, so memset is not needed

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +0 -1
index 6d8f055..111a301 100644
@@ -66,7 +66,6 @@ int amdgpu_ih_ring_init(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih,
 		if (ih->ring == NULL)
 			return -ENOMEM;
 
-		memset((void *)ih->ring, 0, ih->ring_size + 8);
 		ih->gpu_addr = dma_addr;
 		ih->wptr_addr = dma_addr + ih->ring_size;
 		ih->wptr_cpu = &ih->ring[ih->ring_size / 4];

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1574067631-26219-1-git-send-email-zhengbin13-hv44wF8Li93QT0dZR+AlfA@public.gmane.org

Applied
#2 lore raw

Applied. thanks!

Alex

Quoted 26 lines · zhengbin

Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c:64:13-31: WARNING: dma_alloc_coherent use in ih -> ring already zeroes out memory, so memset is not needed

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +0 -2
index 6d8f055..111a301 100644
@@ -66,7 +66,6 @@ int amdgpu_ih_ring_init(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih,
                if (ih->ring == NULL)
                        return -ENOMEM;
 
-               memset((void *)ih->ring, 0, ih->ring_size + 8);
                ih->gpu_addr = dma_addr;
                ih->wptr_addr = dma_addr + ih->ring_size;
                ih->wptr_cpu = &ih->ring[ih->ring_size / 4];
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx