media: videodev2: Fix v4l2_ext_control packing.
authorRicardo Ribalda <ribalda@chromium.org>
Wed, 10 Apr 2024 12:24:39 +0000 (12:24 +0000)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 15 Apr 2024 11:42:38 +0000 (13:42 +0200)
commit81741e804ef4692e8a6741380352625397a3288b
tree17bc321db3947b1816bb2a827b783519bc8e7510
parent2abcd952e1999d0f1006068c455a524bec37883d
media: videodev2: Fix v4l2_ext_control packing.

The structure is packed, which requires that all its fields need to be
also packed.

./include/uapi/linux/videodev2.h:1810:2: warning: field  within 'struct v4l2_ext_control' is less aligned than 'union v4l2_ext_control::(anonymous at ./include/uapi/linux/videodev2.h:1810:2)' and is usually due to 'struct v4l2_ext_control' being packed, which can lead to unaligned accesses [-Wunaligned-access]

Explicitly set the inner union as packed.

Marking the inner union as 'packed' does not change the layout, since the
whole struct is already packed, it just silences the clang warning. See
also this llvm discussion:

https://github.com/llvm/llvm-project/issues/55520

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
include/uapi/linux/videodev2.h