include: usb_ch9: ensure packing of usb_setup_packet
struct usb_setup_packet represents the setup data payload of a USB control
message which is exactly 8-bytes in length.
On a legacy build of GCC 4.1.2 for an OpenRISC-like architecture it was
found that the compiler added padding after the bmRequestType anonymous
union, and subsequently the bRequest field causing the structure to be
padded to 12-bytes in length with the fields incorrectly laid out.
This patch corrects the issue by applying the __packed attribute to the
anonymous union. This corrects the issue.
The __packed attribute is also applied to the outer structure for the sake
of consistency.
Signed-off-by:
Joel Holdsworth <jholdsworth@nvidia.com>
Loading
Please sign in to comment