diff mbox

[09/21] drm/etnaviv: clear alloced event

Message ID 20170609102123.2417-10-christian.gmeiner@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christian Gmeiner June 9, 2017, 10:21 a.m. UTC
Results in less code as there is no need to set every struct
member to 0/NULL.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lucas Stach June 26, 2017, 1:30 p.m. UTC | #1
Am Freitag, den 09.06.2017, 12:21 +0200 schrieb Christian Gmeiner:
> Results in less code as there is no need to set every struct
> member to 0/NULL.
> 
> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index 803fcf4..0766861 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1156,6 +1156,7 @@ static unsigned int event_alloc(struct
> etnaviv_gpu *gpu)
>  	/* find first free event */
>  	for (i = 0; i < ARRAY_SIZE(gpu->event); i++) {
>  		if (gpu->event[i].used == false) {
> +			memset(&gpu->event[i], 0, sizeof(struct
> etnaviv_event));
>  			gpu->event[i].used = true;
>  			event = i;
>  			break;
> @@ -1350,7 +1351,6 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
>  	}
>  
>  	gpu->event[event].fence = fence;
> -	gpu->event[event].sync_point = NULL;
>  	submit->fence = dma_fence_get(fence);
>  	gpu->active_fence = submit->fence->seqno;
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 803fcf4..0766861 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1156,6 +1156,7 @@  static unsigned int event_alloc(struct etnaviv_gpu *gpu)
 	/* find first free event */
 	for (i = 0; i < ARRAY_SIZE(gpu->event); i++) {
 		if (gpu->event[i].used == false) {
+			memset(&gpu->event[i], 0, sizeof(struct etnaviv_event));
 			gpu->event[i].used = true;
 			event = i;
 			break;
@@ -1350,7 +1351,6 @@  int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
 	}
 
 	gpu->event[event].fence = fence;
-	gpu->event[event].sync_point = NULL;
 	submit->fence = dma_fence_get(fence);
 	gpu->active_fence = submit->fence->seqno;