lkml.org 
[lkml]   [2021]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2 7/8] videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag
On (21/06/03 13:32), Hans Verkuil wrote:
[..]
> > +static void validate_memory_flags(struct vb2_queue *q,
> > + int memory,
> > + u32 *flags)
> > +{
> > + if (!q->allow_cache_hints || memory != V4L2_MEMORY_MMAP) {
> > + /*
> > + * This needs to clear V4L2_MEMORY_FLAG_NON_COHERENT only,
> > + * but in order to avoid bugs we zero out all bits.
> > + */
> > + *flags = 0;
>
> Wouldn't it make sense to add:
>
> } else {
> *flags &= ~V4L2_MEMORY_FLAG_NON_COHERENT;
>
> I.e., clear all unknown flags.

Done.

[..]
> > @@ -2003,9 +2003,6 @@ static int v4l_reqbufs(const struct v4l2_ioctl_ops *ops,
> >
> > if (ret)
> > return ret;
> > -
> > - CLEAR_AFTER_FIELD(p, capabilities);
>
> Shouldn't this be:
>
> CLEAR_AFTER_FIELD(p, flags);
>
> You still need to zero the reserved array, after all.

Done.

\
 
 \ /
  Last update: 2021-06-17 03:47    [W:0.059 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site