Skip to contentSkip to conversation

staging: media: hantro: Remove call to memset after dma_alloc_coherent

PATCH In review Hariprasad Kelam 3 participants 4 messages Jul 25, 2019 – Aug 19, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: media: hantro: Remove call to memset after dma_alloc_coherent

fix below issue reported by coccicheck /drivers/staging/media/hantro/hantro_vp8.c:149:16-34: WARNING:
dma_alloc_coherent use in aux_buf -> cpu already zeroes out memory, so memset is not needed

---
 drivers/staging/media/hantro/hantro_vp8.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/hantro/hantro_vp8.c +0 -2
index 66c4533..363ddda 100644
@@ -151,8 +151,6 @@ int hantro_vp8_dec_init(struct hantro_ctx *ctx)
 	if (!aux_buf->cpu)
 		return -ENOMEM;
 
-	memset(aux_buf->cpu, 0, aux_buf->size);
-
 	/*
 	 * Allocate probability table buffer,
 	 * total 1208 bytes, 4K page is far enough.
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Thu, 25 Jul 2019 08:36:02 +0530 Hariprasad Kelam…

fix below issue reported by coccicheck /drivers/staging/media/hantro/hantro_vp8.c:149:16-34: WARNING:
dma_alloc_coherent use in aux_buf -> cpu already zeroes out memory, so memset is not needed

Quoted 17 lines
---
 drivers/staging/media/hantro/hantro_vp8.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/hantro/hantro_vp8.c +0 -2
index 66c4533..363ddda 100644
@@ -151,8 +151,6 @@ int hantro_vp8_dec_init(struct hantro_ctx *ctx)
 	if (!aux_buf->cpu)
 		return -ENOMEM;
 
-	memset(aux_buf->cpu, 0, aux_buf->size);
-
 	/*
 	 * Allocate probability table buffer,
 	 * total 1208 bytes, 4K page is far enough.
#2 lore raw

Hi Hans,

Quoted 25 lines · Boris Brezillon
Quoted 6 lines · On Thu, 25 Jul 2019 08:36:02 +0530 Hariprasad Kelam…

fix below issue reported by coccicheck /drivers/staging/media/hantro/hantro_vp8.c:149:16-34: WARNING:
dma_alloc_coherent use in aux_buf -> cpu already zeroes out memory, so memset is not needed

Quoted 12 lines
---
 drivers/staging/media/hantro/hantro_vp8.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/hantro/hantro_vp8.c +0 -0
index 66c4533..363ddda 100644
@@ -151,8 +151,6 @@ int hantro_vp8_dec_init(struct hantro_ctx *ctx)
      if (!aux_buf->cpu)
              return -ENOMEM;
 
Quoted 6 lines

drivers/staging/media/hantro/hantro_vp8.c int hantro_vp8_dec_init(struct hantro_ctx *ctx) · line 156

Quoted 5 lines
drivers/staging/media/hantro/hantro_vp8.c +0 -2
-     memset(aux_buf->cpu, 0, aux_buf->size);
-
      /*
       * Allocate probability table buffer,
       * total 1208 bytes, 4K page is far enough.

Is this something you will pick to your tree?

Best regards,
Tomasz

#3 lore raw
Quoted 30 lines · Tomasz Figa

Hi Hans,

Quoted 25 lines · Boris Brezillon
Quoted 6 lines · On Thu, 25 Jul 2019 08:36:02 +0530 Hariprasad Kelam…

fix below issue reported by coccicheck /drivers/staging/media/hantro/hantro_vp8.c:149:16-34: WARNING:
dma_alloc_coherent use in aux_buf -> cpu already zeroes out memory, so memset is not needed

Quoted 12 lines
---
 drivers/staging/media/hantro/hantro_vp8.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/hantro/hantro_vp8.c +0 -0
index 66c4533..363ddda 100644
@@ -151,8 +151,6 @@ int hantro_vp8_dec_init(struct hantro_ctx *ctx)
      if (!aux_buf->cpu)
              return -ENOMEM;
 
Quoted 8 lines
Quoted 6 lines

drivers/staging/media/hantro/hantro_vp8.c int hantro_vp8_dec_init(struct hantro_ctx *ctx) · line 156

Quoted 5 lines
drivers/staging/media/hantro/hantro_vp8.c +0 -2
-     memset(aux_buf->cpu, 0, aux_buf->size);
-
      /*
       * Allocate probability table buffer,
       * total 1208 bytes, 4K page is far enough.

Is this something you will pick to your tree?

Ah, sorry, this is already applied. Not sure why searching for it the first time didn't show anything. I guess I need to start repeating my searches by default. Sorry for the noise.

Best regards,
Tomasz