Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mei: fix up uuid matching

A previous commit, c93b76b34b4d ("mei: bus: report also uuid in module
alias") caused a build error as I missed applying a needed patch to add
some macros to uapi/linux/uuid.h. Instead of those additional macros,
change the mei code to use the existing uuid structure directly.

Fixes: c93b76b34b4d
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+9 -11
+2 -7
drivers/misc/mei/bus.c
··· 30 30 #define to_mei_cl_driver(d) container_of(d, struct mei_cl_driver, driver) 31 31 #define to_mei_cl_device(d) container_of(d, struct mei_cl_device, dev) 32 32 33 - static inline uuid_le uuid_le_cast(const __u8 uuid[16]) 34 - { 35 - return *(uuid_le *)uuid; 36 - } 37 - 38 33 static int mei_cl_device_match(struct device *dev, struct device_driver *drv) 39 34 { 40 35 struct mei_cl_device *device = to_mei_cl_device(dev); ··· 49 54 50 55 id = driver->id_table; 51 56 52 - while (uuid_le_cmp(NULL_UUID_LE, uuid_le_cast(id->uuid))) { 57 + while (uuid_le_cmp(NULL_UUID_LE, id->uuid)) { 53 58 54 - if (!uuid_le_cmp(*uuid, uuid_le_cast(id->uuid))) { 59 + if (!uuid_le_cmp(*uuid, id->uuid)) { 55 60 if (id->name[0]) { 56 61 if (!strncmp(name, id->name, sizeof(id->name))) 57 62 return 1;
+1 -1
drivers/nfc/mei_phy.h
··· 5 5 #include <net/nfc/hci.h> 6 6 #include <linux/uuid.h> 7 7 8 - #define MEI_NFC_UUID __UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \ 8 + #define MEI_NFC_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \ 9 9 0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c) 10 10 #define MEI_NFC_HEADER_SIZE 10 11 11 #define MEI_NFC_MAX_HCI_PAYLOAD 300
+1 -1
include/linux/mod_devicetable.h
··· 614 614 */ 615 615 struct mei_cl_device_id { 616 616 char name[MEI_CL_NAME_SIZE]; 617 - __u8 uuid[16]; 617 + uuid_le uuid; 618 618 kernel_ulong_t driver_info; 619 619 }; 620 620
+5 -2
scripts/mod/file2alias.c
··· 34 34 typedef uint32_t __u32; 35 35 typedef uint16_t __u16; 36 36 typedef unsigned char __u8; 37 + typedef struct { 38 + __u8 b[16]; 39 + } uuid_le; 37 40 38 41 /* Big exception to the "don't include kernel headers into userspace, which 39 42 * even potentially has different endianness and word sizes, since ··· 134 131 strcat(str + len, "*"); 135 132 } 136 133 137 - static inline void add_uuid(char *str, __u8 uuid[16]) 134 + static inline void add_uuid(char *str, uuid_le uuid) 138 135 { 139 136 int len = strlen(str); 140 137 int i; 141 138 142 139 for (i = 0; i < 16; i++) 143 - sprintf(str + len + (i << 1), "%02x", uuid[i]); 140 + sprintf(str + len + (i << 1), "%02x", uuid.b[i]); 144 141 } 145 142 146 143 /**