Skip to content

Commit

Permalink
USB: remove 8 bytes of padding from usb_host_interface on 64 bit builds
Browse files Browse the repository at this point in the history
Reorder elements in the usb_host_interface structure to remove 8 bytes
of padding on 64 bit builds , and so shrink it's size to 40 bytes.

usb_interface_descriptor is a odd size which leaves a gap that is not
big enough to hold a pointer, so moving extralen into that gap removes
the need for more padding.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Richard Kennedy authored and Greg Kroah-Hartman committed Jul 17, 2012
1 parent 0911052 commit 0d5ff30
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/linux/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ struct usb_host_endpoint {
struct usb_host_interface {
struct usb_interface_descriptor desc;

int extralen;
unsigned char *extra; /* Extra descriptors */

/* array of desc.bNumEndpoint endpoints associated with this
* interface setting. these will be in no particular order.
*/
struct usb_host_endpoint *endpoint;

char *string; /* iInterface string, if present */
unsigned char *extra; /* Extra descriptors */
int extralen;
};

enum usb_interface_condition {
Expand Down

0 comments on commit 0d5ff30

Please sign in to comment.