[U-Boot] [PATCH v1] usb: Guarantee alignment of the string descriptor
Bin Meng
bmeng.cn at gmail.com
Fri Aug 30 07:16:04 UTC 2019
On Thu, Aug 29, 2019 at 10:46 PM Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>
> GCC 9.x starts complaining about potential misalignment of the pointer to the
> array (in this case alignment=2) in the packed (alignment=1) structures.
>
> drivers/usb/gadget/composite.c:545:23: warning: taking address of packed member of ‘struct usb_string_descriptor’ may result in an unaligned pointer value [-Waddress-of-packed-member]
> 545 | collect_langs(sp, s->wData);
>
> drivers/usb/gadget/composite.c:550:24: warning: taking address of packed member of ‘struct usb_string_descriptor’ may result in an unaligned pointer value [-Waddress-of-packed-member]
> 550 | collect_langs(sp, s->wData);
>
> drivers/usb/gadget/composite.c:555:25: warning: taking address of packed member of ‘struct usb_string_descriptor’ may result in an unaligned pointer value [-Waddress-of-packed-member]
> 555 | collect_langs(sp, s->wData);
>
> Define structure alignment to be 2 to guarantee alignment of its members.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> ---
> include/linux/usb/ch9.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
More information about the U-Boot
mailing list