Skip to content

Commit af3ff64

Browse files
kattisrinivasangregkh
authored andcommitted
Drivers: hv: vmbus: Use uuid_le type consistently
Consistently use uuid_le type in the Hyper-V driver code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ed9ba60 commit af3ff64

5 files changed

Lines changed: 40 additions & 68 deletions

File tree

‎drivers/hv/channel_mgmt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
408408
struct cpumask *alloced_mask;
409409

410410
for (i = IDE; i < MAX_PERF_CHN; i++) {
411-
if (!memcmp(type_guid->b, hp_devs[i].guid,
411+
if (!memcmp(type_guid->b, &hp_devs[i].guid,
412412
sizeof(uuid_le))) {
413413
perf_chn = true;
414414
break;

‎drivers/hv/vmbus_drv.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
531531

532532
static const uuid_le null_guid;
533533

534-
static inline bool is_null_guid(const __u8 *guid)
534+
static inline bool is_null_guid(const uuid_le *guid)
535535
{
536536
if (memcmp(guid, &null_guid, sizeof(uuid_le)))
537537
return false;
@@ -544,9 +544,9 @@ static inline bool is_null_guid(const __u8 *guid)
544544
*/
545545
static const struct hv_vmbus_device_id *hv_vmbus_get_id(
546546
const struct hv_vmbus_device_id *id,
547-
const __u8 *guid)
547+
const uuid_le *guid)
548548
{
549-
for (; !is_null_guid(id->guid); id++)
549+
for (; !is_null_guid(&id->guid); id++)
550550
if (!memcmp(&id->guid, guid, sizeof(uuid_le)))
551551
return id;
552552

@@ -563,7 +563,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
563563
struct hv_driver *drv = drv_to_hv_drv(driver);
564564
struct hv_device *hv_dev = device_to_hv_device(device);
565565

566-
if (hv_vmbus_get_id(drv->id_table, hv_dev->dev_type.b))
566+
if (hv_vmbus_get_id(drv->id_table, &hv_dev->dev_type))
567567
return 1;
568568

569569
return 0;
@@ -580,7 +580,7 @@ static int vmbus_probe(struct device *child_device)
580580
struct hv_device *dev = device_to_hv_device(child_device);
581581
const struct hv_vmbus_device_id *dev_id;
582582

583-
dev_id = hv_vmbus_get_id(drv->id_table, dev->dev_type.b);
583+
dev_id = hv_vmbus_get_id(drv->id_table, &dev->dev_type);
584584
if (drv->probe) {
585585
ret = drv->probe(dev, dev_id);
586586
if (ret != 0)

‎include/linux/hyperv.h‎

Lines changed: 32 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,8 @@ u64 hv_do_hypercall(u64 control, void *input, void *output);
997997
.guid = { g0, g1, g2, g3, g4, g5, g6, g7, \
998998
g8, g9, ga, gb, gc, gd, ge, gf },
999999

1000+
1001+
10001002
/*
10011003
* GUID definitions of various offer types - services offered to the guest.
10021004
*/
@@ -1006,150 +1008,120 @@ u64 hv_do_hypercall(u64 control, void *input, void *output);
10061008
* {f8615163-df3e-46c5-913f-f2d2f965ed0e}
10071009
*/
10081010
#define HV_NIC_GUID \
1009-
.guid = { \
1010-
0x63, 0x51, 0x61, 0xf8, 0x3e, 0xdf, 0xc5, 0x46, \
1011-
0x91, 0x3f, 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e \
1012-
}
1011+
.guid = UUID_LE(0xf8615163, 0xdf3e, 0x46c5, 0x91, 0x3f, \
1012+
0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e)
10131013

10141014
/*
10151015
* IDE GUID
10161016
* {32412632-86cb-44a2-9b5c-50d1417354f5}
10171017
*/
10181018
#define HV_IDE_GUID \
1019-
.guid = { \
1020-
0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, \
1021-
0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5 \
1022-
}
1019+
.guid = UUID_LE(0x32412632, 0x86cb, 0x44a2, 0x9b, 0x5c, \
1020+
0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5)
10231021

10241022
/*
10251023
* SCSI GUID
10261024
* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}
10271025
*/
10281026
#define HV_SCSI_GUID \
1029-
.guid = { \
1030-
0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, \
1031-
0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f \
1032-
}
1027+
.guid = UUID_LE(0xba6163d9, 0x04a1, 0x4d29, 0xb6, 0x05, \
1028+
0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f)
10331029

10341030
/*
10351031
* Shutdown GUID
10361032
* {0e0b6031-5213-4934-818b-38d90ced39db}
10371033
*/
10381034
#define HV_SHUTDOWN_GUID \
1039-
.guid = { \
1040-
0x31, 0x60, 0x0b, 0x0e, 0x13, 0x52, 0x34, 0x49, \
1041-
0x81, 0x8b, 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb \
1042-
}
1035+
.guid = UUID_LE(0x0e0b6031, 0x5213, 0x4934, 0x81, 0x8b, \
1036+
0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb)
10431037

10441038
/*
10451039
* Time Synch GUID
10461040
* {9527E630-D0AE-497b-ADCE-E80AB0175CAF}
10471041
*/
10481042
#define HV_TS_GUID \
1049-
.guid = { \
1050-
0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, \
1051-
0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf \
1052-
}
1043+
.guid = UUID_LE(0x9527e630, 0xd0ae, 0x497b, 0xad, 0xce, \
1044+
0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf)
10531045

10541046
/*
10551047
* Heartbeat GUID
10561048
* {57164f39-9115-4e78-ab55-382f3bd5422d}
10571049
*/
10581050
#define HV_HEART_BEAT_GUID \
1059-
.guid = { \
1060-
0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, \
1061-
0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d \
1062-
}
1051+
.guid = UUID_LE(0x57164f39, 0x9115, 0x4e78, 0xab, 0x55, \
1052+
0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d)
10631053

10641054
/*
10651055
* KVP GUID
10661056
* {a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}
10671057
*/
10681058
#define HV_KVP_GUID \
1069-
.guid = { \
1070-
0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, \
1071-
0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6 \
1072-
}
1059+
.guid = UUID_LE(0xa9a0f4e7, 0x5a45, 0x4d96, 0xb8, 0x27, \
1060+
0x8a, 0x84, 0x1e, 0x8c, 0x03, 0xe6)
10731061

10741062
/*
10751063
* Dynamic memory GUID
10761064
* {525074dc-8985-46e2-8057-a307dc18a502}
10771065
*/
10781066
#define HV_DM_GUID \
1079-
.guid = { \
1080-
0xdc, 0x74, 0x50, 0X52, 0x85, 0x89, 0xe2, 0x46, \
1081-
0x80, 0x57, 0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02 \
1082-
}
1067+
.guid = UUID_LE(0x525074dc, 0x8985, 0x46e2, 0x80, 0x57, \
1068+
0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02)
10831069

10841070
/*
10851071
* Mouse GUID
10861072
* {cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}
10871073
*/
10881074
#define HV_MOUSE_GUID \
1089-
.guid = { \
1090-
0x9e, 0xb6, 0xa8, 0xcf, 0x4a, 0x5b, 0xc0, 0x4c, \
1091-
0xb9, 0x8b, 0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a \
1092-
}
1075+
.guid = UUID_LE(0xcfa8b69e, 0x5b4a, 0x4cc0, 0xb9, 0x8b, \
1076+
0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a)
10931077

10941078
/*
10951079
* VSS (Backup/Restore) GUID
10961080
*/
10971081
#define HV_VSS_GUID \
1098-
.guid = { \
1099-
0x29, 0x2e, 0xfa, 0x35, 0x23, 0xea, 0x36, 0x42, \
1100-
0x96, 0xae, 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40 \
1101-
}
1082+
.guid = UUID_LE(0x35fa2e29, 0xea23, 0x4236, 0x96, 0xae, \
1083+
0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40)
11021084
/*
11031085
* Synthetic Video GUID
11041086
* {DA0A7802-E377-4aac-8E77-0558EB1073F8}
11051087
*/
11061088
#define HV_SYNTHVID_GUID \
1107-
.guid = { \
1108-
0x02, 0x78, 0x0a, 0xda, 0x77, 0xe3, 0xac, 0x4a, \
1109-
0x8e, 0x77, 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8 \
1110-
}
1089+
.guid = UUID_LE(0xda0a7802, 0xe377, 0x4aac, 0x8e, 0x77, \
1090+
0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8)
11111091

11121092
/*
11131093
* Synthetic FC GUID
11141094
* {2f9bcc4a-0069-4af3-b76b-6fd0be528cda}
11151095
*/
11161096
#define HV_SYNTHFC_GUID \
1117-
.guid = { \
1118-
0x4A, 0xCC, 0x9B, 0x2F, 0x69, 0x00, 0xF3, 0x4A, \
1119-
0xB7, 0x6B, 0x6F, 0xD0, 0xBE, 0x52, 0x8C, 0xDA \
1120-
}
1097+
.guid = UUID_LE(0x2f9bcc4a, 0x0069, 0x4af3, 0xb7, 0x6b, \
1098+
0x6f, 0xd0, 0xbe, 0x52, 0x8c, 0xda)
11211099

11221100
/*
11231101
* Guest File Copy Service
11241102
* {34D14BE3-DEE4-41c8-9AE7-6B174977C192}
11251103
*/
11261104

11271105
#define HV_FCOPY_GUID \
1128-
.guid = { \
1129-
0xE3, 0x4B, 0xD1, 0x34, 0xE4, 0xDE, 0xC8, 0x41, \
1130-
0x9A, 0xE7, 0x6B, 0x17, 0x49, 0x77, 0xC1, 0x92 \
1131-
}
1106+
.guid = UUID_LE(0x34d14be3, 0xdee4, 0x41c8, 0x9a, 0xe7, \
1107+
0x6b, 0x17, 0x49, 0x77, 0xc1, 0x92)
11321108

11331109
/*
11341110
* NetworkDirect. This is the guest RDMA service.
11351111
* {8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}
11361112
*/
11371113
#define HV_ND_GUID \
1138-
.guid = { \
1139-
0x3d, 0xaf, 0x2e, 0x8c, 0xa7, 0x32, 0x09, 0x4b, \
1140-
0xab, 0x99, 0xbd, 0x1f, 0x1c, 0x86, 0xb5, 0x01 \
1141-
}
1114+
.guid = UUID_LE(0x8c2eaf3d, 0x32a7, 0x4b09, 0xab, 0x99, \
1115+
0xbd, 0x1f, 0x1c, 0x86, 0xb5, 0x01)
11421116

11431117
/*
11441118
* PCI Express Pass Through
11451119
* {44C4F61D-4444-4400-9D52-802E27EDE19F}
11461120
*/
11471121

11481122
#define HV_PCIE_GUID \
1149-
.guid = { \
1150-
0x1D, 0xF6, 0xC4, 0x44, 0x44, 0x44, 0x00, 0x44, \
1151-
0x9D, 0x52, 0x80, 0x2E, 0x27, 0xED, 0xE1, 0x9F \
1152-
}
1123+
.guid = UUID_LE(0x44c4f61d, 0x4444, 0x4400, 0x9d, 0x52, \
1124+
0x80, 0x2e, 0x27, 0xed, 0xe1, 0x9f)
11531125

11541126
/*
11551127
* Common header for Hyper-V ICs

‎include/linux/mod_devicetable.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ struct virtio_device_id {
404404
* For Hyper-V devices we use the device guid as the id.
405405
*/
406406
struct hv_vmbus_device_id {
407-
__u8 guid[16];
407+
uuid_le guid;
408408
kernel_ulong_t driver_data; /* Data private to the driver */
409409
};
410410

‎scripts/mod/file2alias.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ static int do_vmbus_entry(const char *filename, void *symval,
917917
char guid_name[(sizeof(*guid) + 1) * 2];
918918

919919
for (i = 0; i < (sizeof(*guid) * 2); i += 2)
920-
sprintf(&guid_name[i], "%02x", TO_NATIVE((*guid)[i/2]));
920+
sprintf(&guid_name[i], "%02x", TO_NATIVE((guid->b)[i/2]));
921921

922922
strcpy(alias, "vmbus:");
923923
strcat(alias, guid_name);

0 commit comments

Comments
 (0)