Am 02.05.2025 um 05:30 hat Nicholas Piggin geschrieben:
> These structures are hardware interfaces, ensure the layout is
> correct. Add defines for the data sizes throughout the code.
>
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Nicholas Piggin <[email protected]>
> @@ -636,6 +643,10 @@ static const TypeInfo usb_storage_dev_type_info = {
>
> static void usb_msd_register_types(void)
> {
> + /* Ensure the header structures are the right size */
> + qemu_build_assert(CBW_SIZE == 31);
> + qemu_build_assert(CSW_SIZE == 13);
> +
> type_register_static(&usb_storage_dev_type_info);
> }
There is no real reason to have this assertion inside of a function at
the end of the file. I'd prefer QEMU_BUILD_BUG_ON() next to the struct
declarations, but obviously it's correct either way, so with or without
that changed:
Reviewed-by: Kevin Wolf <[email protected]>