From: Andy Shevchenko Date: Thu, 29 Aug 2019 14:46:07 +0000 (+0300) Subject: usb: Guarantee alignment of the string descriptor X-Git-Tag: accepted/tizen/unified/20200311.130826^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6bb1b339ad30e31b873f1f9c97d64c6a9c9a110;hp=f6bb1b339ad30e31b873f1f9c97d64c6a9c9a110;p=profile%2Fmobile%2Fplatform%2Fkernel%2Fu-boot-tm1.git usb: Guarantee alignment of the string descriptor 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 Reviewed-by: Bin Meng [sw0312.kim: apply from list https://patchwork.ozlabs.org/patch/1155376/, to remove gcc9 warning] Suggested-by: Jaehoon Chung Signed-off-by: Seung-Woo Kim Change-Id: Id5b0f65266f452458623c49c46dee002c462a3b2 ---