Revert "usb: thor: fix possible alignment issues" 69/227169/2
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 10 Mar 2020 06:06:07 +0000 (15:06 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 10 Mar 2020 06:39:55 +0000 (15:39 +0900)
This reverts commit d1cf1d9dddf3d53d8b1fb08033bd6504f7374349.

Windows THOR tool fails to communucate with this change, so
revert it and build warning with gcc9 will be fixed with ohter way.

Change-Id: Id2d3fd38951bf9c00d7f040605afc12a31e20ecf
Reported-by: Jeongmo Yang <jm80.yang@samsung.com>
Suggested-by: Jaehoon Chung <jh80.chung@samsung.com>
property/usb/cdc_descriptor.c

index 6dba80f..bf27148 100644 (file)
@@ -8,8 +8,6 @@
 #define THOR_VENDOR_NUM                        0x04E8
 #define THOR_PRODUCT_NUM               0x685D
 
-typedef struct { __le16 val; } __attribute__((aligned(16))) __le16_packed;
-
 static struct usb_device_descriptor thor_device_desc_high __align (32)= {
        .bLength                        = sizeof(thor_device_desc_high),
        .bDescriptorType        = USB_DT_DEVICE,
@@ -274,15 +272,14 @@ unsigned char *thor_get_config_desc(unsigned int speed)
        return (unsigned char *) &function_desc_buf;
 }
 
-static void str2wide (char *str, void *wide)
+static void str2wide (char *str, u16 * wide)
 {
        int i;
-       __le16_packed   *tmp = wide;
        for (i = 0; i < strlen (str) && str[i]; i++){
                #if defined(__LITTLE_ENDIAN)
-                       tmp[i].val = (u16) str[i];
+                       wide[i] = (u16) str[i];
                #elif defined(__BIG_ENDIAN)
-                       tmp[i].val = ((u16)(str[i])<<8);
+                       wide[i] = ((u16)(str[i])<<8);
                #else
                        #error "__LITTLE_ENDIAN or __BIG_ENDIAN undefined"
                #endif