Re: [RFC 1/4] media: Sanitise the reserved fields of the G_TOPOLOGY IOCTL arguments

Sakari Ailus
2016-02-22T19:52:59Z

Hi Mauro,

On Mon, Feb 22, 2016 at 07:23:21AM -0300, Mauro Carvalho Chehab wrote:
> Em Mon, 22 Feb 2016 07:00:47 -0300
> Mauro Carvalho Chehab <mchehab@osg.samsung.com> escreveu:
>
> > Em Sun, 21 Feb 2016 23:36:12 +0200
> > Sakari Ailus <sakari.ailus@linux.intel.com> escreveu:
> >
> > > From: Sakari Ailus <sakari.ailus@iki.fi>
> > >
> > > Align them up to a power of two.
> >
> > Looks OK to me, but I would comment that the structs are aligned to
> > 2^n for those structs.
>
> Hmm... on a second tought, I don't think this patch makes any sense.
> As those structs will be part of an array at media_v2_topology,
> this won't be aligned to a power of two, as we don't require that
> the number of links, entities, etc.. to be a aligned.

Well... that's a valid point indeed. Still I think the reserved fields do
need some changes, at least aligning the size to the common ABI alignment
(e.g. 8 bytes) rather than relying on the compiler to do it.

--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk