Re: [PATCH 1/1] ov5648: Don't pack controls struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Paul,

On Tue, Jan 11, 2022 at 09:28:12AM +0100, Paul Kocialkowski wrote:
> Hi Sakari,
> 
> On Tue 11 Jan 22, 00:48, Sakari Ailus wrote:
> > Don't pack the driver specific struct containing control pointers. This
> > lead to potential alignment issues when working with the pointers.
> 
> Thanks for looking into the report and making this fix.
> 
> Honestly I was a bit puzzled because I explicitly added the __packed
> to avoid possible holes in the structures that could be problematic
> when using v4l2_ctrl_auto_cluster and I think the problem still stands.
> 
> I feel like solving both issues at once would require having the controls
> that belong in the same cluster declared as an array and not individual
> members of the struct.
> 
> What do you think?

No architecture used in Linux requires adding padding between two pointers
to my knowledge --- generally the alignment is at most the size of the
data: otherwise arrays would not work either. Therefore packing isn't
required.

-- 
Kind regards,

Sakari Ailus



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux