diff options
author | Ricardo Ribalda <ribalda@chromium.org> | 2024-04-10 14:24:38 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-04-15 13:42:38 +0200 |
commit | 2abcd952e1999d0f1006068c455a524bec37883d (patch) | |
tree | 387cd2dc7a43bebda673ae987c9a2949e88d3594 /include | |
parent | media: dvb: as102-fe: Fix as10x_register_addr packing (diff) | |
download | linux-2abcd952e1999d0f1006068c455a524bec37883d.tar.xz linux-2abcd952e1999d0f1006068c455a524bec37883d.zip |
media: dvb: Fix dtvs_stats packing.
The structure is packed, which requires that all its fields need to be
also packed.
./include/uapi/linux/dvb/frontend.h:854:2: warning: field within 'struct dtv_stats' is less aligned than 'union dtv_stats::(anonymous at ./include/uapi/linux/dvb/frontend.h:854:2)' and is usually due to 'struct dtv_stats' 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>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/dvb/frontend.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 7e0983b987c2..8d38c6befda8 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -854,7 +854,7 @@ struct dtv_stats { union { __u64 uvalue; /* for counters and relative scales */ __s64 svalue; /* for 0.001 dB measures */ - }; + } __attribute__ ((packed)); } __attribute__ ((packed)); |