diff options
author | hselasky <hselasky@FreeBSD.org> | 2013-01-30 15:49:37 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2013-01-30 15:49:37 +0000 |
commit | 07f6ed056f5894a455fd52e2158b58144ecdca68 (patch) | |
tree | 5d0cce265d71acd04bb76a3087fe35c64bf6e03a | |
parent | 34829d74e1222ffb99ba5a0dc56d3a62c7813ca5 (diff) | |
download | FreeBSD-src-07f6ed056f5894a455fd52e2158b58144ecdca68.zip FreeBSD-src-07f6ed056f5894a455fd52e2158b58144ecdca68.tar.gz |
Use an anonymous struct for generated string descriptors.
Submitted by: Christoph Mallon
-rw-r--r-- | sys/dev/usb/usb.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index 7a10c30..b8b52d5 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -566,13 +566,12 @@ struct usb_string_descriptor { typedef struct usb_string_descriptor usb_string_descriptor_t; #define USB_MAKE_STRING_DESC(m,name) \ -struct name { \ +static const struct { \ uByte bLength; \ uByte bDescriptorType; \ uByte bData[sizeof((uint8_t []){m})]; \ -} __packed; \ -static const struct name name = { \ - .bLength = sizeof(struct name), \ +} __packed name = { \ + .bLength = sizeof(name), \ .bDescriptorType = UDESC_STRING, \ .bData = { m }, \ } |