On Mon, Oct 23, 2023 at 11:34:25AM +0300, Tomi Valkeinen wrote: > On 13/10/2023 14:17, Sakari Ailus wrote: > > On Fri, Oct 13, 2023 at 02:15:07PM +0300, Laurent Pinchart wrote: > >> On Fri, Oct 13, 2023 at 11:06:08AM +0000, Sakari Ailus wrote: > >>> On Fri, Oct 13, 2023 at 01:57:49PM +0300, Laurent Pinchart wrote: > >>>> On Fri, Oct 13, 2023 at 01:44:19PM +0300, Sakari Ailus wrote: > >>>>> Store the number of pads in the sub-device state. This will be needed to > >>>>> validate pad when retrieving information for non-stream-aware users. > >>>> > >>>> I'd rather store a pointer to the subdev. You can get the number of pads > >>>> from there. > >>> > >>> The value is initialised after the array is allocated so this won't change. > >>> > >>> I don't have a strong opinion either way. It's still more efficient to > >>> store just the value. > >> > >> Slightly so, but I don't think it will matter in practice. I believe > >> we'll have more needs to access the subdev from the state in the future, > >> which is why I'd rather store the pointer already. > > > > Fair enough, I'll make it a sub-device pointer. > > I have to say like the num_pads more here. We have a pointer to the pads > array in the struct v4l2_subdev_state, and it'd be logical to also have > the number of elements in that array in struct v4l2_subdev_state. Yes, but we'll likely need access to the subdev in the future, and it would then duplicate the information. -- Regards, Laurent Pinchart