Hi Laurent, Jacopo, On Tue, Aug 06, 2024 at 12:32:22PM +0300, Laurent Pinchart wrote: > On Tue, Aug 06, 2024 at 11:16:05AM +0200, Jacopo Mondi wrote: > > On Tue, Aug 06, 2024 at 12:06:23PM GMT, Laurent Pinchart wrote: > > > On Tue, Aug 06, 2024 at 10:24:20AM +0200, Jacopo Mondi wrote: > > > > On Tue, Aug 06, 2024 at 10:17:02AM GMT, Hans Verkuil wrote: > > > > > For compound control (which have similar problems) I have quite strict > > > > > requirements: the structure layout may not contain any holes, and I require (and > > > > > test) that any reserved/padding fields at set to 0 by the driver and that it is > > > > > documented that userspace sets it to 0 as well. > > > > > > > > > > My recommendation for public APIs that effectively return data structures > > > > > is to: > > > > > > > > > > 1) ensure the layout is the same for 32 and 64 bit code, > > > > > > Yes, that's very important. > > > > > > > > 2) there are no holes, instead use reserved[] arrays instead, > > > > > > Fine with me. > > > > Do we all agree I can't change the existing types, and we'll have to > > live with holes ? > > We may be able to change the existing structures, but that would be a > separate patch, outside of the scope of this series. I'd say "we can" as long as it doesn't affect the memory layout of the interface structs. -- Kind regards, Sakari Ailus