]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: dvb: as102-fe: Fix as10x_register_addr packing
authorRicardo Ribalda <ribalda@chromium.org>
Wed, 10 Apr 2024 12:24:37 +0000 (12:24 +0000)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 15 Apr 2024 11:42:38 +0000 (13:42 +0200)
This structure is embedded in multiple other structures that are packed,
which conflicts with it being aligned.

drivers/media/usb/as102/as10x_cmd.h:379:30: warning: field reg_addr within 'struct as10x_dump_memory::(unnamed at drivers/media/usb/as102/as10x_cmd.h:373:2)' is less aligned than 'struct as10x_register_addr' and is usually due to 'struct as10x_dump_memory::(unnamed at drivers/media/usb/as102/as10x_cmd.h:373:2)' being packed, which can lead to unaligned accesses [-Wunaligned-access]

Mark it as being packed.

Marking the inner struct 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>
drivers/media/dvb-frontends/as102_fe_types.h

index 297f9520ebf9d8743ef9620cdb01b032dcaded0a..8a4e392c889653598c872475817301af2496379c 100644 (file)
@@ -174,6 +174,6 @@ struct as10x_register_addr {
        uint32_t addr;
        /* register mode access */
        uint8_t mode;
-};
+} __packed;
 
 #endif