From 01923b399d6ae4e4db6138d3ec312b0f869aa5fc Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Wed, 30 Jan 2013 15:49:37 +0000 Subject: [PATCH] Use an anonymous struct for generated string descriptors. Submitted by: Christoph Mallon --- sys/dev/usb/usb.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index 7a10c30b6e58..b8b52d5abb9d 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 }, \ }