linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: media: hantro: Remove call to memset after dma_alloc_coherent
@ 2019-07-25  3:06 Hariprasad Kelam
  2019-07-25 11:50 ` Boris Brezillon
  0 siblings, 1 reply; 4+ messages in thread
From: Hariprasad Kelam @ 2019-07-25  3:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, Ezequiel Garcia,
	Tomasz Figa, Boris Brezillon, ZhiChao Yu, Hariprasad Kelam,
	linux-media, devel, linux-kernel

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

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 drivers/staging/media/hantro/hantro_vp8.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_vp8.c b/drivers/staging/media/hantro/hantro_vp8.c
index 66c4533..363ddda 100644
--- a/drivers/staging/media/hantro/hantro_vp8.c
+++ b/drivers/staging/media/hantro/hantro_vp8.c
@@ -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.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: media: hantro: Remove call to memset after dma_alloc_coherent
  2019-07-25  3:06 [PATCH] staging: media: hantro: Remove call to memset after dma_alloc_coherent Hariprasad Kelam
@ 2019-07-25 11:50 ` Boris Brezillon
  2019-08-19  4:17   ` Tomasz Figa
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Brezillon @ 2019-07-25 11:50 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, Ezequiel Garcia,
	Tomasz Figa, ZhiChao Yu, linux-media, devel, linux-kernel

On Thu, 25 Jul 2019 08:36:02 +0530
Hariprasad Kelam <hariprasad.kelam@gmail.com> wrote:

> 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
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
>  drivers/staging/media/hantro/hantro_vp8.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/media/hantro/hantro_vp8.c b/drivers/staging/media/hantro/hantro_vp8.c
> index 66c4533..363ddda 100644
> --- a/drivers/staging/media/hantro/hantro_vp8.c
> +++ b/drivers/staging/media/hantro/hantro_vp8.c
> @@ -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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: media: hantro: Remove call to memset after dma_alloc_coherent
  2019-07-25 11:50 ` Boris Brezillon
@ 2019-08-19  4:17   ` Tomasz Figa
  2019-08-19  4:19     ` Tomasz Figa
  0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Figa @ 2019-08-19  4:17 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Hariprasad Kelam, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	Ezequiel Garcia, ZhiChao Yu, Linux Media Mailing List, devel,
	Linux Kernel Mailing List, Boris Brezillon

Hi Hans,

On Thu, Jul 25, 2019 at 8:50 PM Boris Brezillon
<boris.brezillon@collabora.com> wrote:
>
> On Thu, 25 Jul 2019 08:36:02 +0530
> Hariprasad Kelam <hariprasad.kelam@gmail.com> wrote:
>
> > 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
> >
> > Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
>
> > ---
> >  drivers/staging/media/hantro/hantro_vp8.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/staging/media/hantro/hantro_vp8.c b/drivers/staging/media/hantro/hantro_vp8.c
> > index 66c4533..363ddda 100644
> > --- a/drivers/staging/media/hantro/hantro_vp8.c
> > +++ b/drivers/staging/media/hantro/hantro_vp8.c
> > @@ -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.
>

Is this something you will pick to your tree?

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: media: hantro: Remove call to memset after dma_alloc_coherent
  2019-08-19  4:17   ` Tomasz Figa
@ 2019-08-19  4:19     ` Tomasz Figa
  0 siblings, 0 replies; 4+ messages in thread
From: Tomasz Figa @ 2019-08-19  4:19 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Hariprasad Kelam, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	Ezequiel Garcia, ZhiChao Yu, Linux Media Mailing List, devel,
	Linux Kernel Mailing List, Boris Brezillon

On Mon, Aug 19, 2019 at 1:17 PM Tomasz Figa <tfiga@chromium.org> wrote:
>
> Hi Hans,
>
> On Thu, Jul 25, 2019 at 8:50 PM Boris Brezillon
> <boris.brezillon@collabora.com> wrote:
> >
> > On Thu, 25 Jul 2019 08:36:02 +0530
> > Hariprasad Kelam <hariprasad.kelam@gmail.com> wrote:
> >
> > > 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
> > >
> > > Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> >
> > Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> >
> > > ---
> > >  drivers/staging/media/hantro/hantro_vp8.c | 2 --
> > >  1 file changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/staging/media/hantro/hantro_vp8.c b/drivers/staging/media/hantro/hantro_vp8.c
> > > index 66c4533..363ddda 100644
> > > --- a/drivers/staging/media/hantro/hantro_vp8.c
> > > +++ b/drivers/staging/media/hantro/hantro_vp8.c
> > > @@ -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.
> >
>
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-19  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25  3:06 [PATCH] staging: media: hantro: Remove call to memset after dma_alloc_coherent Hariprasad Kelam
2019-07-25 11:50 ` Boris Brezillon
2019-08-19  4:17   ` Tomasz Figa
2019-08-19  4:19     ` Tomasz Figa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).