uuid: Convert rest users to new API
Subsystems (11)
Andy Shevchenko
reviewercover uuid: Convert rest users to new API
This series is converting the rest of the users of old UUID API to a new one and dropping UUID UAPI header away. Note, ABI is kept the same.
User space should have not used those headers. We have libuuid and it likely would be extended to cover GUID operations.
All patches have been compiled tested on x86_64 machine.
The series is supposed to go via UUID tree with immutable branch (in case we have new users of obsolete API).
I dunno if it's a good idea to put them to v4.13-rc2 where first part of the changes is applied.
Andy Shevchenko (6):
efi: Switch to use new generic UUID API
mei: Switch to use new generic UUID API
staging: unisys: Switch to use new generic UUID API
vmbus: Switch to use new generic UUID API
uuid: Kill uapi/uuid.h
device property: Switch to use new generic UUID API
drivers/acpi/property.c | 50 +++++------ drivers/firmware/efi/cper.c | 10 +-- drivers/hv/channel.c | 4 +- drivers/hv/channel_mgmt.c | 18 ++-- drivers/hv/hyperv_vmbus.h | 4 +- drivers/hv/vmbus_drv.c | 43 ++++------ drivers/misc/mei/bus-fixup.c | 35 ++++---- drivers/misc/mei/bus.c | 14 ++-- drivers/misc/mei/client.c | 21 +++-- drivers/misc/mei/client.h | 12 +-- drivers/misc/mei/hbm.c | 2 +- drivers/misc/mei/hw.h | 2 +- drivers/misc/mei/main.c | 2 +- drivers/nfc/mei_phy.h | 5 +- drivers/staging/unisys/Documentation/overview.txt | 14 ++-- drivers/staging/unisys/include/channel.h | 45 +++++----- drivers/staging/unisys/include/iochannel.h | 14 +--- drivers/staging/unisys/include/visorbus.h | 12 +-- drivers/staging/unisys/visorbus/controlvmchannel.h | 24 ++---- drivers/staging/unisys/visorbus/vbuschannel.h | 7 +- drivers/staging/unisys/visorbus/visorbus_main.c | 28 +++---- drivers/staging/unisys/visorbus/visorbus_private.h | 6 +- drivers/staging/unisys/visorbus/visorchannel.c | 48 +++++------ drivers/staging/unisys/visorbus/visorchipset.c | 39 +++++---- drivers/staging/unisys/visorhba/visorhba_main.c | 6 +- drivers/staging/unisys/visorinput/visorinput.c | 38 ++++----- drivers/staging/unisys/visornic/visornic_main.c | 6 +- drivers/watchdog/mei_wdt.c | 5 +- include/linux/cper.h | 94 ++++++++++----------- include/linux/efi.h | 4 +- include/linux/hyperv.h | 98 +++++++++++----------- include/linux/mei_cl_bus.h | 2 +- include/linux/mod_devicetable.h | 8 +- include/linux/uuid.h | 20 ++++- include/uapi/linux/hyperv.h | 6 +- include/uapi/linux/mei.h | 4 +- include/uapi/linux/uuid.h | 42 ---------- samples/mei/mei-amt-version.c | 21 ++++- scripts/mod/file2alias.c | 4 +- 39 files changed, 387 insertions(+), 430 deletions(-) delete mode 100644 include/uapi/linux/uuid.h
Signature · 1 line
2.11.0
Andy Shevchenko
reviewerPATCH 1/6 efi: Switch to use new generic UUID API
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
--- drivers/firmware/efi/cper.c | 10 ++--- include/linux/cper.h | 94 ++++++++++++++++++++++----------------------- include/linux/efi.h | 4 +- 3 files changed, 54 insertions(+), 54 deletions(-)
drivers/firmware/efi/cper.c +5 -5
@@ -534,7 +534,7 @@ static void cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata, int sec_no) { - uuid_le *sec_type = (uuid_le *)gdata->section_type; + guid_t *sec_type = (guid_t *)gdata->section_type;__u16 severity;char newpfx[64 ];
@@ -545,12 +545,12 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdataprintk ("%s""Error %d, type: %s\n" , pfx, sec_no,cper_severity_str (severity));if (gdata->validation_bits &CPER_SEC_VALID_FRU_ID ) -printk ("%s""fru_id: %pUl\n" , pfx, (uuid_le *)gdata->fru_id); +printk ("%s""fru_id: %pUl\n" , pfx, gdata->fru_id);if (gdata->validation_bits &CPER_SEC_VALID_FRU_TEXT )printk ("%s""fru_text: %.20s\n" , pfx, gdata->fru_text);snprintf (newpfx,sizeof (newpfx),"%s%s" , pfx,INDENT_SP ); -if (!uuid_le_cmp (*sec_type,CPER_SEC_PROC_GENERIC )) { +if (guid_equal (sec_type, &CPER_SEC_PROC_GENERIC )) {struct cper_sec_proc_generic *proc_err =acpi_hest_get_payload (gdata);printk ("%s""section_type: general processor error\n" , newpfx);
@@ -558,7 +558,7 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdatacper_print_proc_generic (newpfx, proc_err); else goto err_section_too_small; - }else if (!uuid_le_cmp (*sec_type,CPER_SEC_PLATFORM_MEM )) { + }else if (guid_equal (sec_type, &CPER_SEC_PLATFORM_MEM )) {struct cper_sec_mem_err *mem_err =acpi_hest_get_payload (gdata);printk ("%s""section_type: memory error\n" , newpfx);
@@ -568,7 +568,7 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata gdata->error_data_length); else goto err_section_too_small; - }else if (!uuid_le_cmp (*sec_type,CPER_SEC_PCIE )) { + }else if (guid_equal (sec_type, &CPER_SEC_PCIE )) {struct cper_sec_pcie *pcie =acpi_hest_get_payload (gdata);printk ("%s""section_type: PCIe error\n" , newpfx);
include/linux/cper.h +47 -47
158 lines not on this page · raw message
include/linux/efi.h +2 -2
@@ -47,10 +47,10 @@ typedef u16 efi_char16_t; /* UNICODE character */typedef u64 efi_physical_addr_t ;typedef void *efi_handle_t ; -typedef uuid_le efi_guid_t ; +typedef guid_t efi_guid_t ;#define EFI_GUID (a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ - UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) + GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)/* * Generic EFI table header
Signature · 1 line
2.11.0
Re: [PATCH v1 1/6] efi: Switch to use new generic UUID API
Quoted 8 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Cc Matt Fleming <[email protected]>Cc Ard Biesheuvel <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Quoted 239 lines
--- drivers/firmware/efi/cper.c | 10 ++--- include/linux/cper.h | 94 ++++++++++++++++++++++----------------------- include/linux/efi.h | 4 +- 3 files changed, 54 insertions(+), 54 deletions(-)drivers/firmware/efi/cper.c +5
-5@@ -534,7 +534,7 @@ static void cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata, int sec_no) { - uuid_le *sec_type = (uuid_le *)gdata->section_type; + guid_t *sec_type = (guid_t *)gdata->section_type;__u16 severity;char newpfx[64 ];@@ -545,12 +545,12 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdataprintk ("%s""Error %d, type: %s\n" , pfx, sec_no,cper_severity_str (severity));if (gdata->validation_bits &CPER_SEC_VALID_FRU_ID ) -printk ("%s""fru_id: %pUl\n" , pfx, (uuid_le *)gdata->fru_id); +printk ("%s""fru_id: %pUl\n" , pfx, gdata->fru_id);if (gdata->validation_bits &CPER_SEC_VALID_FRU_TEXT )printk ("%s""fru_text: %.20s\n" , pfx, gdata->fru_text);snprintf (newpfx,sizeof (newpfx),"%s%s" , pfx,INDENT_SP ); -if (!uuid_le_cmp (*sec_type,CPER_SEC_PROC_GENERIC )) { +if (guid_equal (sec_type, &CPER_SEC_PROC_GENERIC )) {struct cper_sec_proc_generic *proc_err =acpi_hest_get_payload (gdata);printk ("%s""section_type: general processor error\n" , newpfx);@@ -558,7 +558,7 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdatacper_print_proc_generic (newpfx, proc_err); else goto err_section_too_small; - }else if (!uuid_le_cmp (*sec_type,CPER_SEC_PLATFORM_MEM )) { + }else if (guid_equal (sec_type, &CPER_SEC_PLATFORM_MEM )) {struct cper_sec_mem_err *mem_err =acpi_hest_get_payload (gdata);printk ("%s""section_type: memory error\n" , newpfx);@@ -568,7 +568,7 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata gdata->error_data_length); else goto err_section_too_small; - }else if (!uuid_le_cmp (*sec_type,CPER_SEC_PCIE )) { + }else if (guid_equal (sec_type, &CPER_SEC_PCIE )) {struct cper_sec_pcie *pcie =acpi_hest_get_payload (gdata);printk ("%s""section_type: PCIe error\n" , newpfx);include/linux/cper.h +47
-47@@ -74,36 +74,36 @@ enum {* Corrected Machine Check */ #define CPER_NOTIFY_CMC \ - UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \ - 0xEB, 0xD4, 0xF8, 0x90) + GUID_INIT(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \ + 0xEB, 0xD4, 0xF8, 0x90)/* Corrected Platform Error */ #define CPER_NOTIFY_CPE \ - UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \ - 0xF2, 0x7E, 0xBE, 0xEE) + GUID_INIT(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \ + 0xF2, 0x7E, 0xBE, 0xEE)/* Machine Check Exception */ #define CPER_NOTIFY_MCE \ - UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \ - 0xE1, 0x49, 0x13, 0xBB) + GUID_INIT(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \ + 0xE1, 0x49, 0x13, 0xBB)/* PCI Express Error */ #define CPER_NOTIFY_PCIE \ - UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \ - 0xAF, 0x67, 0xC1, 0x04) + GUID_INIT(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \ + 0xAF, 0x67, 0xC1, 0x04)/* INIT Record (for IPF) */ #define CPER_NOTIFY_INIT \ - UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \ - 0xD3, 0x9B, 0xC9, 0x8E) + GUID_INIT(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \ + 0xD3, 0x9B, 0xC9, 0x8E)/* Non-Maskable Interrupt */ #define CPER_NOTIFY_NMI \ - UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \ - 0x85, 0xD6, 0xE9, 0x8A) + GUID_INIT(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \ + 0x85, 0xD6, 0xE9, 0x8A)/* BOOT Error Record */ #define CPER_NOTIFY_BOOT \ - UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \ - 0xD4, 0x64, 0xB3, 0x8F) + GUID_INIT(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \ + 0xD4, 0x64, 0xB3, 0x8F)/* DMA Remapping Error */ #define CPER_NOTIFY_DMAR \ - UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \ - 0x72, 0x2D, 0xEB, 0x41) + GUID_INIT(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \ + 0x72, 0x2D, 0xEB, 0x41)/* * Flags bits definitions for flags in struct cper_record_header @@ -170,50 +170,50 @@ enum {* Processor Generic */ #define CPER_SEC_PROC_GENERIC \ - UUID_LE(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ - 0x93, 0xC4, 0xF3, 0xDB) + GUID_INIT(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ + 0x93, 0xC4, 0xF3, 0xDB)/* Processor Specific: X86/X86_64 */ #define CPER_SEC_PROC_IA \ - UUID_LE(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \ - 0x24, 0x2B, 0x6E, 0x1D) + GUID_INIT(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \ + 0x24, 0x2B, 0x6E, 0x1D)/* Processor Specific: IA64 */ #define CPER_SEC_PROC_IPF \ - UUID_LE(0xE429FAF1, 0x3CB7, 0x11D4, 0x0B, 0xCA, 0x07, 0x00, \ - 0x80, 0xC7, 0x3C, 0x88, 0x81) + GUID_INIT(0xE429FAF1, 0x3CB7, 0x11D4, 0x0B, 0xCA, 0x07, 0x00, \ + 0x80, 0xC7, 0x3C, 0x88, 0x81)/* Processor Specific: ARM */ #define CPER_SEC_PROC_ARM \ - UUID_LE(0xE19E3D16, 0xBC11, 0x11E4, 0x9C, 0xAA, 0xC2, 0x05, \ - 0x1D, 0x5D, 0x46, 0xB0) + GUID_INIT(0xE19E3D16, 0xBC11, 0x11E4, 0x9C, 0xAA, 0xC2, 0x05, \ + 0x1D, 0x5D, 0x46, 0xB0)/* Platform Memory */ #define CPER_SEC_PLATFORM_MEM \ - UUID_LE(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \ - 0xED, 0x7C, 0x83, 0xB1) + GUID_INIT(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \ + 0xED, 0x7C, 0x83, 0xB1)#define CPER_SEC_PCIE \ - UUID_LE(0xD995E954, 0xBBC1, 0x430F, 0xAD, 0x91, 0xB4, 0x4D, \ - 0xCB, 0x3C, 0x6F, 0x35) + GUID_INIT(0xD995E954, 0xBBC1, 0x430F, 0xAD, 0x91, 0xB4, 0x4D, \ + 0xCB, 0x3C, 0x6F, 0x35)/* Firmware Error Record Reference */ #define CPER_SEC_FW_ERR_REC_REF \ - UUID_LE(0x81212A96, 0x09ED, 0x4996, 0x94, 0x71, 0x8D, 0x72, \ - 0x9C, 0x8E, 0x69, 0xED) + GUID_INIT(0x81212A96, 0x09ED, 0x4996, 0x94, 0x71, 0x8D, 0x72, \ + 0x9C, 0x8E, 0x69, 0xED)/* PCI/PCI-X Bus */ #define CPER_SEC_PCI_X_BUS \ - UUID_LE(0xC5753963, 0x3B84, 0x4095, 0xBF, 0x78, 0xED, 0xDA, \ - 0xD3, 0xF9, 0xC9, 0xDD) + GUID_INIT(0xC5753963, 0x3B84, 0x4095, 0xBF, 0x78, 0xED, 0xDA, \ + 0xD3, 0xF9, 0xC9, 0xDD)/* PCI Component/Device */ #define CPER_SEC_PCI_DEV \ - UUID_LE(0xEB5E4685, 0xCA66, 0x4769, 0xB6, 0xA2, 0x26, 0x06, \ - 0x8B, 0x00, 0x13, 0x26) + GUID_INIT(0xEB5E4685, 0xCA66, 0x4769, 0xB6, 0xA2, 0x26, 0x06, \ + 0x8B, 0x00, 0x13, 0x26)#define CPER_SEC_DMAR_GENERIC \ - UUID_LE(0x5B51FEF7, 0xC79D, 0x4434, 0x8F, 0x1B, 0xAA, 0x62, \ - 0xDE, 0x3E, 0x2C, 0x64) + GUID_INIT(0x5B51FEF7, 0xC79D, 0x4434, 0x8F, 0x1B, 0xAA, 0x62, \ + 0xDE, 0x3E, 0x2C, 0x64)/* Intel VT for Directed I/O specific DMAr */ #define CPER_SEC_DMAR_VT \ - UUID_LE(0x71761D37, 0x32B2, 0x45cd, 0xA7, 0xD0, 0xB0, 0xFE, \ - 0xDD, 0x93, 0xE8, 0xCF) + GUID_INIT(0x71761D37, 0x32B2, 0x45cd, 0xA7, 0xD0, 0xB0, 0xFE, \ + 0xDD, 0x93, 0xE8, 0xCF)/* IOMMU specific DMAr */ #define CPER_SEC_DMAR_IOMMU \ - UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ - 0xDF, 0xAA, 0x84, 0xEC) + GUID_INIT(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ + 0xDF, 0xAA, 0x84, 0xEC)#define CPER_PROC_VALID_TYPE 0x0001#define CPER_PROC_VALID_ISA 0x0002@@ -290,10 +290,10 @@ struct cper_record_header {__u32 validation_bits;__u32 record_length;__u64 timestamp; -uuid_le platform_id; -uuid_le partition_id; -uuid_le creator_id; -uuid_le notification_type; +guid_t platform_id; +guid_t partition_id; +guid_t creator_id; +guid_t notification_type;__u64 record_id;__u32 flags;__u64 persistence_information;@@ -309,8 +309,8 @@ struct cper_section_descriptor {__u8 validation_bits;__u8 reserved;/* must be zero */ __u32 flags; -uuid_le section_type; -uuid_le fru_id; +guid_t section_type; +guid_t fru_id;__u32 section_severity;__u8 fru_text[20 ]; };@@ -343,7 +343,7 @@ struct cper_sec_proc_ia {/* IA32/X64 Processor Error Information Structure */ struct cper_ia_err_info { -uuid_le err_type; +guid_t err_type;__u64 validation_bits;__u64 check_info;__u64 target_id;include/linux/efi.h +2
-3@@ -47,10 +47,10 @@ typedef u16 efi_char16_t; /* UNICODE character */typedef u64 efi_physical_addr_t ;typedef void *efi_handle_t ; -typedef uuid_le efi_guid_t ; +typedef guid_t efi_guid_t ;#define EFI_GUID (a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ - UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) + GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)/* * Generic EFI table header -- 2.11.0
Andy Shevchenko
reviewerRe: [PATCH v1 1/6] efi: Switch to use new generic UUID API
Quoted 5 lines · Ard Biesheuvel
Quoted 3 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
Quoted 8 lines
Quoted 6 lines
As a preparation to get rid of legacy types and API functions do the conversion here.
Cc Matt Fleming <[email protected]>Cc Ard Biesheuvel <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>Acked-by Ard Biesheuvel <[email protected]>
Thanks!
Christoph, can we apply this one at least to move things forward?
Quoted 318 lines
Quoted 318 lines
---
drivers/firmware/efi/cper.c | 10 ++--- include/linux/cper.h | 94 ++++++++++++++++++++++----------
-------------
include/linux/efi.h | 4 +-3 files changed, 54 insertions(+), 54 deletions(-)drivers/firmware/efi/cper.c +0
-0@@ -534,7 +534,7 @@ static voidcper_estatus_print_section(const char *pfx, struct
acpi_hest_generic_data*gdata,
intsec_no)
{
- uuid_le*sec_type= (uuid_le*)gdata->section_type; + guid_t*sec_type= (guid_t*)gdata->section_type;__u16severity;
char newpfx[64];drivers/firmware/efi/cper.c +0
-0@@ -545,12 +545,12 @@ cper_estatus_print_section(const char *pfx,struct
acpi_hest_generic_data*gdata
printk("%s""Error %d, type: %s\n", pfx,sec_no,cper_severity_str(severity));
if (gdata->validation_bits&CPER_SEC_VALID_FRU_ID) - printk("%s""fru_id: %pUl\n", pfx, (uuid_le*)gdata-Quoted 1 line
fru_id);+ printk("%s""fru_id: %pUl\n", pfx,
gdata->fru_id); if (gdata->validation_bits&CPER_SEC_VALID_FRU_TEXT) printk("%s""fru_text: %.20s\n", pfx, gdata-Quoted 1 line
fru_text);snprintf(newpfx, sizeof(newpfx), "%s%s", pfx,
INDENT_SP); - if (!uuid_le_cmp(*sec_type,CPER_SEC_PROC_GENERIC)) { + if (guid_equal(sec_type, &CPER_SEC_PROC_GENERIC)) { structcper_sec_proc_generic*proc_err=acpi_hest_get_payload(gdata);printk("%s""section_type: general processor error\n", newpfx);
drivers/firmware/efi/cper.c +0
-0@@ -558,7 +558,7 @@ cper_estatus_print_section(const char *pfx,struct
acpi_hest_generic_data*gdatacper_print_proc_generic(newpfx, proc_err); else
gotoerr_section_too_small;
- } else if (!uuid_le_cmp(*sec_type,CPER_SEC_PLATFORM_MEM)) { + } else if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) { structcper_sec_mem_err*mem_err=acpi_hest_get_payload(gdata);printk("%s""section_type: memory error\n", newpfx);
drivers/firmware/efi/cper.c +0
-0@@ -568,7 +568,7 @@ cper_estatus_print_section(const char *pfx,struct
acpi_hest_generic_data*gdatagdata->error_data_length); else
gotoerr_section_too_small;
- } else if (!uuid_le_cmp(*sec_type,CPER_SEC_PCIE)) { + } else if (guid_equal(sec_type, &CPER_SEC_PCIE)) { structcper_sec_pcie*pcie =acpi_hest_get_payload(gdata);printk("%s""section_type: PCIe error\n", newpfx);
include/linux/cper.h +0
-0@@ -74,36 +74,36 @@ enum {* Corrected Machine Check */ #define
CPER_NOTIFY_CMC
\
- UUID_LE(0x2DCE8BB1,0xBDD7,0x450e,0xB9,0xAD,0x9C, 0xF4, \
- 0xEB,0xD4,0xF8,0x90)
+ GUID_INIT(0x2DCE8BB1,0xBDD7,0x450e,0xB9,0xAD,0x9C, 0xF4, \
+ 0xEB,0xD4,0xF8,0x90)
/* Corrected Platform Error */
#defineCPER_NOTIFY_CPE
\
- UUID_LE(0x4E292F96,0xD843,0x4a55,0xA8,0xC2,0xD4, 0x81, \
- 0xF2,0x7E,0xBE,0xEE)
+ GUID_INIT(0x4E292F96,0xD843,0x4a55,0xA8,0xC2,0xD4, 0x81, \
+ 0xF2,0x7E,0xBE,0xEE)
/* Machine Check Exception */
#defineCPER_NOTIFY_MCE
\
- UUID_LE(0xE8F56FFE,0x919C,0x4cc5,0xBA,0x88,0x65, 0xAB, \
- 0xE1,0x49,0x13,0xBB)
+ GUID_INIT(0xE8F56FFE,0x919C,0x4cc5,0xBA,0x88,0x65, 0xAB, \
+ 0xE1,0x49,0x13,0xBB)
/* PCI Express Error */
#define
CPER_NOTIFY_PCIE \
- UUID_LE(0xCF93C01F,0x1A16,0x4dfc,0xB8,0xBC,0x9C, 0x4D, \
- 0xAF,0x67,0xC1,0x04)
+ GUID_INIT(0xCF93C01F,0x1A16,0x4dfc,0xB8,0xBC,0x9C, 0x4D, \
+ 0xAF,0x67,0xC1,0x04)
/* INIT Record (for IPF) */
#define
CPER_NOTIFY_INIT \
- UUID_LE(0xCC5263E8,0x9308,0x454a,0x89,0xD0,0x34, 0x0B, \
- 0xD3,0x9B,0xC9,0x8E)
+ GUID_INIT(0xCC5263E8,0x9308,0x454a,0x89,0xD0,0x34, 0x0B, \
+ 0xD3,0x9B,0xC9,0x8E)
/* Non-Maskable Interrupt */
#defineCPER_NOTIFY_NMI
\
- UUID_LE(0x5BAD89FF,0xB7E6,0x42c9,0x81,0x4A,0xCF, 0x24, \
- 0x85,0xD6,0xE9,0x8A)
+ GUID_INIT(0x5BAD89FF,0xB7E6,0x42c9,0x81,0x4A,0xCF, 0x24, \
+ 0x85,0xD6,0xE9,0x8A)
/* BOOT Error Record */
#define
CPER_NOTIFY_BOOT \
- UUID_LE(0x3D61A466,0xAB40,0x409a,0xA6,0x98,0xF3, 0x62, \
- 0xD4,0x64,0xB3,0x8F)
+ GUID_INIT(0x3D61A466,0xAB40,0x409a,0xA6,0x98,0xF3, 0x62, \
+ 0xD4,0x64,0xB3,0x8F)
/* DMA Remapping Error */
#define
CPER_NOTIFY_DMAR \
- UUID_LE(0x667DD791,0xC6B3,0x4c27,0x8A,0x6B,0x0F, 0x8E, \
- 0x72,0x2D,0xEB,0x41)
+ GUID_INIT(0x667DD791,0xC6B3,0x4c27,0x8A,0x6B,0x0F, 0x8E, \
+ 0x72,0x2D,0xEB,0x41)/*
* Flags bits definitions for flags in structcper_record_headerinclude/linux/cper.h +12
-12@@ -170,50 +170,50 @@ enum {* Processor Generic */ #defineCPER_SEC_PROC_GENERIC \ - UUID_LE(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ - 0x93, 0xC4, 0xF3, 0xDB) + GUID_INIT(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ + 0x93, 0xC4, 0xF3, 0xDB) /* Processor Specific: X86/X86_64 */ #defineCPER_SEC_PROC_IA \ - UUID_LE(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \ - 0x24, 0x2B, 0x6E, 0x1D) + GUID_INIT(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \ + 0x24, 0x2B, 0x6E, 0x1D) /* Processor Specific: IA64 */ #defineCPER_SEC_PROC_IPF \ - UUID_LE(0xE429FAF1, 0x3CB7, 0x11D4, 0x0B, 0xCA, 0x07, 0x00, \ - 0x80, 0xC7, 0x3C, 0x88, 0x81) + GUID_INIT(0xE429FAF1, 0x3CB7, 0x11D4, 0x0B, 0xCA, 0x07, 0x00, \ + 0x80, 0xC7, 0x3C, 0x88, 0x81) /* Processor Specific: ARM */ #defineCPER_SEC_PROC_ARM \ - UUID_LE(0xE19E3D16, 0xBC11, 0x11E4, 0x9C, 0xAA, 0xC2, 0x05, \ - 0x1D, 0x5D, 0x46, 0xB0) + GUID_INIT(0xE19E3D16, 0xBC11, 0x11E4, 0x9C, 0xAA, 0xC2, 0x05, \ + 0x1D, 0x5D, 0x46, 0xB0) /* Platform Memory */ #defineCPER_SEC_PLATFORM_MEM \ - UUID_LE(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \ - 0xED, 0x7C, 0x83, 0xB1) + GUID_INIT(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \ + 0xED, 0x7C, 0x83, 0xB1) #defineCPER_SEC_PCIE \ - UUID_LE(0xD995E954, 0xBBC1, 0x430F, 0xAD, 0x91, 0xB4, 0x4D, \ - 0xCB, 0x3C, 0x6F, 0x35) + GUID_INIT(0xD995E954, 0xBBC1, 0x430F, 0xAD, 0x91, 0xB4, 0x4D, \ + 0xCB, 0x3C, 0x6F, 0x35) /* Firmware Error Record Reference */ #define
CPER_SEC_FW_ERR_REC_REF
\
- UUID_LE(0x81212A96,0x09ED,0x4996,0x94,0x71,0x8D, 0x72, \
- 0x9C,0x8E,0x69,0xED)
+ GUID_INIT(0x81212A96,0x09ED,0x4996,0x94,0x71,0x8D, 0x72, \
+ 0x9C,0x8E,0x69,0xED)
/* PCI/PCI-X Bus */
#define
CPER_SEC_PCI_X_BUS \
- UUID_LE(0xC5753963,0x3B84,0x4095,0xBF,0x78,0xED, 0xDA, \
- 0xD3,0xF9,0xC9,0xDD)
+ GUID_INIT(0xC5753963,0x3B84,0x4095,0xBF,0x78,0xED, 0xDA, \
+ 0xD3,0xF9,0xC9,0xDD)
/* PCI Component/Device */
#define
CPER_SEC_PCI_DEV \
- UUID_LE(0xEB5E4685,0xCA66,0x4769,0xB6,0xA2,0x26, 0x06, \
- 0x8B,0x00,0x13,0x26)
+ GUID_INIT(0xEB5E4685,0xCA66,0x4769,0xB6,0xA2,0x26, 0x06, \
+ 0x8B,0x00,0x13,0x26)
#define
CPER_SEC_DMAR_GENERIC \
- UUID_LE(0x5B51FEF7,0xC79D,0x4434,0x8F,0x1B,0xAA, 0x62, \
- 0xDE,0x3E,0x2C,0x64)
+ GUID_INIT(0x5B51FEF7,0xC79D,0x4434,0x8F,0x1B,0xAA, 0x62, \
+ 0xDE,0x3E,0x2C,0x64)
/* Intel VT for Directed I/O specific DMAr */
#define
CPER_SEC_DMAR_VT \
- UUID_LE(0x71761D37,0x32B2,0x45cd,0xA7,0xD0,0xB0, 0xFE, \
- 0xDD,0x93,0xE8,0xCF)
+ GUID_INIT(0x71761D37,0x32B2,0x45cd,0xA7,0xD0,0xB0, 0xFE, \
+ 0xDD,0x93,0xE8,0xCF)
/* IOMMU specific DMAr */
#define
CPER_SEC_DMAR_IOMMU \
- UUID_LE(0x036F84E1,0x7F37,0x428c,0xA7,0x9E,0x57, 0x5F, \
- 0xDF,0xAA,0x84,0xEC)
+ GUID_INIT(0x036F84E1,0x7F37,0x428c,0xA7,0x9E,0x57, 0x5F, \
+ 0xDF,0xAA,0x84,0xEC)#define CPER_PROC_VALID_TYPE 0x0001 #define CPER_PROC_VALID_ISA 0x0002
include/linux/cper.h +4
-4@@ -290,10 +290,10 @@ struct cper_record_header { __u32 validation_bits; __u32 record_length; __u64 timestamp; - uuid_le platform_id; - uuid_le partition_id; - uuid_le creator_id; - uuid_le notification_type; + guid_t platform_id; + guid_t partition_id; + guid_t creator_id; + guid_t notification_type; __u64 record_id; __u32 flags; __u64 persistence_information;@@ -309,8 +309,8 @@ struct cper_section_descriptor { __u8 validation_bits;__u8 reserved; /* must be zero */ __u32 flags;
- uuid_lesection_type;
- uuid_lefru_id;
+ guid_t section_type;
+ guid_t fru_id;
__u32 section_severity;
__u8 fru_text[20];
};include/linux/cper.h +1
-1@@ -343,7 +343,7 @@ struct cper_sec_proc_ia { /* IA32/X64 Processor Error Information Structure */ struct cper_ia_err_info { - uuid_le err_type; + guid_t err_type; __u64 validation_bits; __u64 check_info; __u64 target_id;include/linux/efi.h +0
-0@@ -47,10 +47,10 @@ typedef u16 efi_char16_t; /* UNICODEcharacter */
typedef u64efi_physical_addr_t;
typedef void*efi_handle_t;include/linux/efi.h +1
-1-typedef uuid_le efi_guid_t ; +typedef guid_t efi_guid_t ;#define
EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7)\
- UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) + GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)/*
* Generic EFI table header
--
2.11.0
Signature · 6 lines
Andy Shevchenko <[email protected]> Intel Finland Oy _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v1 1/6] efi: Switch to use new generic UUID API
Quoted 1 line · Andy Shevchenko
Christoph, can we apply this one at least to move things forward?
Id be happy to pick this up for 4.14. Does everyone involved agree that the uuid tree is the right one?
Re: [PATCH v1 1/6] efi: Switch to use new generic UUID API
Quoted 5 lines · Christoph Hellwig
Quoted 1 line · Andy Shevchenko
Christoph, can we apply this one at least to move things forward?
Id be happy to pick this up for 4.14. Does everyone involved agree that the uuid tree is the right one?
Fine by me for EFI
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Christoph Hellwig
AppliedRe: [PATCH v1 1/6] efi: Switch to use new generic UUID API
In reply to Andy ShevchenkoThanks,
applied to the uuid for-next tree.
Andy Shevchenko
reviewerPATCH 2/6 mei: Switch to use new generic UUID API
In reply to Andy ShevchenkoThere are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
--- drivers/misc/mei/bus-fixup.c | 35 +++++++++++++++++++---------------- drivers/misc/mei/bus.c | 14 +++++++------- drivers/misc/mei/client.c | 21 ++++++++++----------- drivers/misc/mei/client.h | 12 ++++++------ drivers/misc/mei/hbm.c | 2 +- drivers/misc/mei/hw.h | 2 +- drivers/misc/mei/main.c | 2 +- drivers/nfc/mei_phy.h | 5 +++-- drivers/watchdog/mei_wdt.c | 5 +++-- include/linux/mei_cl_bus.h | 2 +- include/linux/mod_devicetable.h | 6 +++--- include/uapi/linux/mei.h | 4 +--- samples/mei/mei-amt-version.c | 21 +++++++++++++++++---- 13 files changed, 73 insertions(+), 58 deletions(-)
drivers/misc/mei/bus-fixup.c +19 -16
@@ -27,21 +27,27 @@#include "mei_dev.h" #include "client.h" -#define MEI_UUID_NFC_INFO UUID_LE(0xd2de1625, 0x382d, 0x417d, \ - 0x48, 0xa4, 0xef, 0xab, 0xba, 0x8a, 0x12, 0x06) +#define MEI_UUID_NFC_INFO \ + GUID_INIT(0xd2de1625, 0x382d, 0x417d, \ + 0x48, 0xa4, 0xef, 0xab, 0xba, 0x8a, 0x12, 0x06) -static const uuid_le mei_nfc_info_guid =MEI_UUID_NFC_INFO ; +static const guid_t mei_nfc_info_guid =MEI_UUID_NFC_INFO ; -#define MEI_UUID_NFC_HCI UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \ - 0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c) +#define MEI_UUID_NFC_HCI \ + GUID_INIT(0x0bb17a78, 0x2a8e, 0x4c50, \ + 0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c) -#define MEI_UUID_WD UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, \ - 0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32, 0xAB) +#define MEI_UUID_WD \ + GUID_INIT(0x05B79A6F, 0x4628, 0x4D7F, \ + 0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32, 0xAB) -#define MEI_UUID_MKHIF_FIX UUID_LE(0x55213584, 0x9a29, 0x4916, \ - 0xba, 0xdf, 0xf, 0xb7, 0xed, 0x68, 0x2a, 0xeb) +#define MEI_UUID_MKHIF_FIX \ + GUID_INIT(0x55213584, 0x9a29, 0x4916, \ + 0xba, 0xdf, 0x0f, 0xb7, 0xed, 0x68, 0x2a, 0xeb) -#define MEI_UUID_ANY NULL_UUID_LE +#define MEI_UUID_ANY \ + GUID_INIT(0x00000000, 0x0000, 0x0000, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)/** * number_of_connections - determine whether an client be on the bus
@@ -391,7 +397,7 @@ static void mei_nfc(struct mei_cl_device *cldev)static struct mei_fixup { -const uuid_le uuid; +const guid_t uuid;void (*hook)(struct mei_cl_device *cldev); } mei_fixups[] = {MEI_FIXUP (MEI_UUID_ANY , number_of_connections),
@@ -409,15 +415,12 @@ static struct mei_fixup {void mei_cl_bus_dev_fixup (struct mei_cl_device *cldev) {struct mei_fixup *f; -const uuid_le *uuid =mei_me_cl_uuid (cldev->me_cl); +const guid_t *uuid =mei_me_cl_uuid (cldev->me_cl);int i;for (i =0 ; i <ARRAY_SIZE (mei_fixups); i++) { - f = &mei_fixups[i]; -if (uuid_le_cmp (f->uuid,MEI_UUID_ANY ) ==0 || -uuid_le_cmp (f->uuid, *uuid) ==0 ) +if (guid_is_null (&f->uuid) ||guid_equal (&f->uuid, uuid)) f->hook (cldev); } } -
drivers/misc/mei/bus.c +7 -7
@@ -417,7 +417,7 @@ EXPORT_SYMBOL_GPL(mei_cldev_set_drvdata);* * Return: me client uuid */ -const uuid_le *mei_cldev_uuid (const struct mei_cl_device *cldev) +const guid_t *mei_cldev_uuid (const struct mei_cl_device *cldev) {return mei_me_cl_uuid (cldev->me_cl); }
@@ -606,7 +606,7 @@ struct mei_cl_device_id *mei_cl_device_find(struct mei_cl_device *cldev, struct mei_cl_driver *cldrv) {const struct mei_cl_device_id *id; -const uuid_le *uuid; +const guid_t *uuid;u8 version;bool match;
@@ -614,8 +614,8 @@ struct mei_cl_device_id *mei_cl_device_find(struct mei_cl_device *cldev, version =mei_me_cl_ver (cldev->me_cl); id = cldrv->id_table; -while (uuid_le_cmp (NULL_UUID_LE , id->uuid)) { -if (!uuid_le_cmp (*uuid, id->uuid)) { +while (!guid_is_null (&id->uuid)) { +if (guid_equal (uuid, &id->uuid)) { match = true;if (cldev->name[0 ])
@@ -742,7 +742,7 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *a, char *buf) {struct mei_cl_device *cldev =to_mei_cl_device (dev); -const uuid_le *uuid =mei_me_cl_uuid (cldev->me_cl); +const guid_t *uuid =mei_me_cl_uuid (cldev->me_cl);return scnprintf (buf,PAGE_SIZE ,"%pUl" , uuid); }
@@ -762,7 +762,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a, char *buf) {struct mei_cl_device *cldev =to_mei_cl_device (dev); -const uuid_le *uuid =mei_me_cl_uuid (cldev->me_cl); +const guid_t *uuid =mei_me_cl_uuid (cldev->me_cl);u8 version =mei_me_cl_ver (cldev->me_cl); return scnprintf(buf, PAGE_SIZE, "mei:%s:%pUl:%02X:",
@@ -790,7 +790,7 @@ ATTRIBUTE_GROUPS(mei_cldev);static int mei_cl_device_uevent (struct device *dev,struct kobj_uevent_env *env) {struct mei_cl_device *cldev =to_mei_cl_device (dev); -const uuid_le *uuid =mei_me_cl_uuid (cldev->me_cl); +const guid_t *uuid =mei_me_cl_uuid (cldev->me_cl);u8 version =mei_me_cl_ver (cldev->me_cl);if (add_uevent_var (env,"MEI_CL_VERSION=%d" , version))
drivers/misc/mei/client.c +10 -11
@@ -139,16 +139,16 @@ void mei_me_cl_add(struct mei_device *dev, struct mei_me_client *me_cl)* Locking: dev->me_clients_rwsem */ static struct mei_me_client *__mei_me_cl_by_uuid (struct mei_device *dev, -const uuid_le *uuid) +const guid_t *uuid) {struct mei_me_client *me_cl; -const uuid_le *pn; +const guid_t *pn;WARN_ON (!rwsem_is_locked (&dev->me_clients_rwsem));list_for_each_entry (me_cl, &dev->me_clients, list) { pn = &me_cl->props.protocol_name; -if (uuid_le_cmp (*uuid, *pn) ==0 ) +if (guid_equal (uuid, pn))return mei_me_cl_get (me_cl); }
@@ -167,7 +167,7 @@ static struct mei_me_client *__mei_me_cl_by_uuid(struct mei_device *dev,* Locking: dev->me_clients_rwsem */ struct mei_me_client *mei_me_cl_by_uuid (struct mei_device *dev, -const uuid_le *uuid) +const guid_t *uuid) {struct mei_me_client *me_cl;
@@ -219,17 +219,16 @@ struct mei_me_client *mei_me_cl_by_id(struct mei_device *dev, u8 client_id)* Locking: dev->me_clients_rwsem */ static struct mei_me_client *__mei_me_cl_by_uuid_id (struct mei_device *dev, -const uuid_le *uuid,u8 client_id) +const guid_t *uuid,u8 client_id) {struct mei_me_client *me_cl; -const uuid_le *pn; +const guid_t *pn;WARN_ON (!rwsem_is_locked (&dev->me_clients_rwsem));list_for_each_entry (me_cl, &dev->me_clients, list) { pn = &me_cl->props.protocol_name; -if (uuid_le_cmp (*uuid, *pn) ==0 && - me_cl->client_id == client_id) +if (guid_equal (uuid, pn) && me_cl->client_id == client_id)return mei_me_cl_get (me_cl); }
@@ -248,7 +247,7 @@ static struct mei_me_client *__mei_me_cl_by_uuid_id(struct mei_device *dev,* Return: me client or null if not found */ struct mei_me_client *mei_me_cl_by_uuid_id (struct mei_device *dev, -const uuid_le *uuid,u8 client_id) +const guid_t *uuid,u8 client_id) {struct mei_me_client *me_cl;
@@ -267,7 +266,7 @@ struct mei_me_client *mei_me_cl_by_uuid_id(struct mei_device *dev,* * Locking: called under "dev->device_lock" lock */ -void mei_me_cl_rm_by_uuid (struct mei_device *dev,const uuid_le *uuid) +void mei_me_cl_rm_by_uuid (struct mei_device *dev,const guid_t *uuid) {struct mei_me_client *me_cl;
@@ -288,7 +287,7 @@ void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid)* * Locking: called under "dev->device_lock" lock */ -void mei_me_cl_rm_by_uuid_id (struct mei_device *dev,const uuid_le *uuid,u8 id) +void mei_me_cl_rm_by_uuid_id (struct mei_device *dev,const guid_t *uuid,u8 id) {struct mei_me_client *me_cl;
drivers/misc/mei/client.h +6 -6
@@ -34,13 +34,13 @@ void mei_me_cl_add(struct mei_device *dev, struct mei_me_client *me_cl);void mei_me_cl_del (struct mei_device *dev,struct mei_me_client *me_cl);struct mei_me_client *mei_me_cl_by_uuid (struct mei_device *dev, -const uuid_le *uuid); +const guid_t *uuid);struct mei_me_client *mei_me_cl_by_id (struct mei_device *dev,u8 client_id);struct mei_me_client *mei_me_cl_by_uuid_id (struct mei_device *dev, -const uuid_le *uuid,u8 client_id); -void mei_me_cl_rm_by_uuid (struct mei_device *dev,const uuid_le *uuid); +const guid_t *uuid,u8 client_id); +void mei_me_cl_rm_by_uuid (struct mei_device *dev,const guid_t *uuid);void mei_me_cl_rm_by_uuid_id (struct mei_device *dev, -const uuid_le *uuid,u8 id); +const guid_t *uuid,u8 id);void mei_me_cl_rm_all (struct mei_device *dev);/**
@@ -62,7 +62,7 @@ static inline bool mei_me_cl_is_active(const struct mei_me_client *me_cl)* * Return: me client protocol name */ -static inline const uuid_le *mei_me_cl_uuid (const struct mei_me_client *me_cl) +static inline const guid_t *mei_me_cl_uuid (const struct mei_me_client *me_cl) {return &me_cl->props.protocol_name; }
@@ -177,7 +177,7 @@ static inline bool mei_cl_is_single_recv_buf(const struct mei_cl *cl)* * Return: return uuid of connected me client */ -static inline const uuid_le *mei_cl_uuid (const struct mei_cl *cl) +static inline const guid_t *mei_cl_uuid (const struct mei_cl *cl) {return mei_me_cl_uuid (cl->me_cl); }
drivers/misc/mei/hbm.c +1 -1
@@ -329,7 +329,7 @@ static int mei_hbm_me_cl_add(struct mei_device *dev, struct hbm_props_response *res) {struct mei_me_client *me_cl; -const uuid_le *uuid = &res->client_properties.protocol_name; +const guid_t *uuid = &res->client_properties.protocol_name;mei_me_cl_rm_by_uuid (dev, uuid);
drivers/misc/mei/hw.h +1 -1
@@ -288,7 +288,7 @@ struct hbm_host_enum_response { } __packed;struct mei_client_properties { -uuid_le protocol_name; +guid_t protocol_name;u8 protocol_version;u8 max_number_of_connections;u8 fixed_address;
drivers/misc/mei/main.c +1 -1
@@ -342,7 +342,7 @@ static int mei_ioctl_connect_client(struct file *file,return -EBUSY ;/* find ME client we're trying to connect to */ - me_cl =mei_me_cl_by_uuid (dev, &data->in_client_uuid); + me_cl =mei_me_cl_by_uuid (dev, (guid_t *)&data->in_client_uuid);if (!me_cl) {dev_dbg (dev->dev,"Cannot connect to FW Client UUID = %pUl\n" , &data->in_client_uuid);
drivers/nfc/mei_phy.h +3 -2
@@ -5,8 +5,9 @@#include <net/nfc/hci.h> #include <linux/uuid.h> -#define MEI_NFC_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \ - 0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c) +#define MEI_NFC_UUID \ + GUID_INIT(0x0bb17a78, 0x2a8e, 0x4c50, \ + 0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)#define MEI_NFC_HEADER_SIZE 10#define MEI_NFC_MAX_HCI_PAYLOAD 300
drivers/watchdog/mei_wdt.c +3 -2
@@ -667,8 +667,9 @@ static int mei_wdt_remove(struct mei_cl_device *cldev)return 0 ; } -#define MEI_UUID_WD UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, \ - 0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32, 0xAB) +#define MEI_UUID_WD \ + GUID_INIT(0x05B79A6F, 0x4628, 0x4D7F, \ + 0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32, 0xAB)static struct mei_cl_device_id mei_wdt_tbl[] = { { .uuid =MEI_UUID_WD , .version =MEI_CL_VERSION_ANY },
include/linux/mei_cl_bus.h +1 -1
@@ -94,7 +94,7 @@ int mei_cldev_register_rx_cb(struct mei_cl_device *cldev, mei_cldev_cb_t rx_cb);int mei_cldev_register_notif_cb (struct mei_cl_device *cldev,mei_cldev_cb_t notif_cb); -const uuid_le *mei_cldev_uuid (const struct mei_cl_device *cldev); +const guid_t *mei_cldev_uuid (const struct mei_cl_device *cldev);u8 mei_cldev_ver (const struct mei_cl_device *cldev);void *mei_cldev_get_drvdata (const struct mei_cl_device *cldev);
include/linux/mod_devicetable.h +3 -3
@@ -627,15 +627,15 @@ struct ipack_device_id {/** * struct mei_cl_device_id - MEI client device identifier * @name: helper name -* @uuid: client uuid +* @uuid: client GUID * @version: client protocol version * @driver_info: information used by the driver. * -* identifies mei client device by uuid and name +* identifies mei client device by GUID and name */ struct mei_cl_device_id {char name[MEI_CL_NAME_SIZE ]; -uuid_le uuid; +guid_t uuid;__u8 version;kernel_ulong_t driver_info; };
include/uapi/linux/mei.h +1 -3
@@ -67,8 +67,6 @@#ifndef _LINUX_MEI_H#define _LINUX_MEI_H -#include <linux/uuid.h> -/* * This IOCTL is used to associate the current file descriptor with a * FW Client (given by UUID). This opens a communication channel
@@ -102,7 +100,7 @@ struct mei_client {*/ struct mei_connect_client_data {union { -uuid_le in_client_uuid; +__u8 in_client_uuid[16 ];struct mei_client out_client_properties; }; };
samples/mei/mei-amt-version.c +17 -4
@@ -89,8 +89,20 @@ fprintf(stderr, "Error: " fmt, ##ARGS); \ } while (0) +/* FIXME: Use libuuid instead */ +typedef struct { +__u8 b[16 ]; +}guid_t ; + +#define GUID_INIT (a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ +((guid_t) \ +{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ + (b) & 0xff, ((b) >> 8) & 0xff, \ + (c) & 0xff, ((c) >> 8) & 0xff, \ + (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) +struct mei { -uuid_le guid; +guid_t guid;bool initialized;bool verbose;unsigned int buf_size;
@@ -108,7 +120,7 @@ static void mei_deinit(struct mei *cl) cl->initialized = false; } -static bool mei_init (struct mei *me,const uuid_le *guid, +static bool mei_init (struct mei *me,const guid_t *guid,unsigned char req_protocol_version,bool verbose) {int result;
@@ -270,8 +282,9 @@ struct amt_host_if_resp_header {unsigned char data[0 ]; } __attribute__((packed)); -const uuid_le MEI_IAMTHIF =UUID_LE (0x12f80028 ,0xb4b7 ,0x4b2d , \ -0xac ,0xa8 ,0x46 ,0xe0 ,0xff ,0x65 ,0x81 ,0x4c ); +const guid_t MEI_IAMTHIF = +GUID_INIT (0x12f80028 ,0xb4b7 ,0x4b2d , +0xac ,0xa8 ,0x46 ,0xe0 ,0xff ,0x65 ,0x81 ,0x4c );#define AMT_HOST_IF_CODE_VERSIONS_REQUEST 0x0400001A#define AMT_HOST_IF_CODE_VERSIONS_RESPONSE 0x0480001A
Signature · 1 line
2.11.0
kbuild test robot
build botRe: [PATCH v1 2/6] mei: Switch to use new generic UUID API
url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/uuid-Convert-rest-users-to-new-API/20170723-022330 config: i386-randconfig-x019-201730 (attached as .config) compiler: gcc-6 (Debian…
Hi Andy,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.13-rc1 next-20170721]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/uuid-Convert-rest-users-to-new-API/20170723-022330
config: i386-randconfig-x019-201730 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:
# save the attached .config to linux build tree
make ARCH=i386 Note: the linux-review/Andy-Shevchenko/uuid-Convert-rest-users-to-new-API/20170723-022330 HEAD f8d40b52dfac11e78d56509455812bcfe9962ce0 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
In file included from scripts/mod/file2alias.c:44:0:
>> scripts/mod/../../include/linux/mod_devicetable.h:638:2: error: unknown type name 'guid_t'
guid_t uuid;
^~~~~~
scripts/mod/file2alias.c: In function 'do_mei_entry':
>> scripts/mod/file2alias.c:1233:18: error: incompatible type for argument 2 of 'add_uuid'
add_uuid(alias, *uuid);
^ scripts/mod/file2alias.c:137:20: note: expected 'uuid_le {aka struct <anonymous>}' but argument is of type 'int'
static inline void add_uuid(char *str, uuid_le uuid)
^~~~~~~~
make[3]: *** [scripts/mod/file2alias.o] Error 1
make[3]: Target '__build' not remade because of errors.
make[2]: *** [scripts/mod] Error 2
make[2]: Target '__build' not remade because of errors.
make[1]: *** [scripts] Error 2
make[1]: Target 'modules_prepare' not remade because of errors.
make: *** [sub-make] Error 2
vim +/guid_t +638 scripts/mod/../../include/linux/mod_devicetable.h
626
627 /**
628 * struct mei_cl_device_id - MEI client device identifier
629 * @name: helper name
630 * @uuid: client GUID
631 * @version: client protocol version
632 * @driver_info: information used by the driver.
633 *
634 * identifies mei client device by GUID and name
635 */
636 struct mei_cl_device_id {
637 char name[MEI_CL_NAME_SIZE];
> 638 guid_t uuid;
639 __u8 version;
640 kernel_ulong_t driver_info;
641 };
642
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Andy Shevchenko
reviewerPATCH 3/6 staging: unisys: Switch to use new generic UUID API
In reply to Andy ShevchenkoThere are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
While here, re-indent couple of lines to increase readability.
--- drivers/staging/unisys/Documentation/overview.txt | 14 +++---- drivers/staging/unisys/include/channel.h | 45 ++++++++++---------- drivers/staging/unisys/include/iochannel.h | 14 +------ drivers/staging/unisys/include/visorbus.h | 12 +++--- drivers/staging/unisys/visorbus/controlvmchannel.h | 24 ++++------- drivers/staging/unisys/visorbus/vbuschannel.h | 7 ++-- drivers/staging/unisys/visorbus/visorbus_main.c | 28 ++++++------- drivers/staging/unisys/visorbus/visorbus_private.h | 6 +-- drivers/staging/unisys/visorbus/visorchannel.c | 48 +++++++++++----------- drivers/staging/unisys/visorbus/visorchipset.c | 39 ++++++++++-------- drivers/staging/unisys/visorhba/visorhba_main.c | 6 +-- drivers/staging/unisys/visorinput/visorinput.c | 38 ++++++++--------- drivers/staging/unisys/visornic/visornic_main.c | 6 +-- 13 files changed, 135 insertions(+), 152 deletions(-)
drivers/staging/unisys/Documentation/overview.txt +7 -7
@@ -221,7 +221,7 @@ The following files exist under /sys/devices/visorbus<x>/vbus<x>:dev<y>: The visorhba driver registers with visorbus as the function driver to handle virtual scsi disk devices, specified using the -VISOR_VHBA_CHANNEL_UUID type in the visorbus_register_visor_driver() +VISOR_VHBA_CHANNEL_GUID type in the visorbus_register_visor_driver() call. visorhba uses scsi_add_host() to expose a Linux block device (e.g., /sys/block/) in the guest environment for each s-Par virtual device.
@@ -240,7 +240,7 @@ When compiled as a module, visorhba can be autoloaded by visorbus in standard udev/systemd environments, as it includes the modules.alias definition: - "visorbus:"+VISOR_VHBA_CHANNEL_UUID_STR + "visorbus:"+VISOR_VHBA_CHANNEL_GUID_STR i.e.:
@@ -252,7 +252,7 @@ i.e.: The visornic driver registers with visorbus as the function driver to handle virtual network devices, specified using the -VISOR_VNIC_CHANNEL_UUID type in the visorbus_register_visor_driver() +VISOR_VNIC_CHANNEL_GUID type in the visorbus_register_visor_driver() call. visornic uses register_netdev() to expose a Linux device of class net (e.g., /sys/class/net/) in the guest environment for each s-Par virtual device.
@@ -270,7 +270,7 @@ When compiled as a module, visornic can be autoloaded by visorbus in standard udev/systemd environments, as it includes the modules.alias definition: - "visorbus:"+VISOR_VNIC_CHANNEL_UUID_STR + "visorbus:"+VISOR_VNIC_CHANNEL_GUID_STR i.e.:
@@ -282,7 +282,7 @@ i.e.: The visorinput driver registers with visorbus as the function driver to handle human input devices, specified using the -VISOR_KEYBOARD_CHANNEL_UUID and VISOR_MOUSE_CHANNEL_UUID +VISOR_KEYBOARD_CHANNEL_GUID and VISOR_MOUSE_CHANNEL_GUID types in the visorbus_register_visor_driver() call. visorinput uses input_register_device() to expose devices of class input (e.g., /sys/class/input/) for virtual keyboard and virtual mouse devices.
@@ -307,8 +307,8 @@ When compiled as a module, visorinput can be autoloaded by visorbus in standard udev/systemd environments, as it includes the modules.alias definition: - "visorbus:"+VISOR_MOUSE_CHANNEL_UUID_STR - "visorbus:"+VISOR_KEYBOARD_CHANNEL_UUID_STR + "visorbus:"+VISOR_MOUSE_CHANNEL_GUID_STR + "visorbus:"+VISOR_KEYBOARD_CHANNEL_GUID_STR i.e.:
drivers/staging/unisys/include/channel.h +21 -24
98 lines not on this page · raw message
drivers/staging/unisys/include/iochannel.h +1 -13
@@ -49,18 +49,6 @@#define VISOR_VNIC_CHANNEL_VERSIONID 2#define VISOR_VSWITCH_CHANNEL_VERSIONID 1 -#define VISOR_VHBA_CHANNEL_OK_CLIENT (ch) \ - (visor_check_channel(ch, visor_vhba_channel_uuid, \ - "vhba", MIN_IO_CHANNEL_SIZE, \ - VISOR_VHBA_CHANNEL_VERSIONID, \ - VISOR_VHBA_CHANNEL_SIGNATURE)) - -#define VISOR_VNIC_CHANNEL_OK_CLIENT (ch) \ - (visor_check_channel(ch, visor_vnic_channel_uuid, \ - "vnic", MIN_IO_CHANNEL_SIZE, \ - VISOR_VNIC_CHANNEL_VERSIONID, \ - VISOR_VNIC_CHANNEL_SIGNATURE)) -/* * Everything necessary to handle SCSI & NIC traffic between Guest Partition and * IO Partition is defined below.
@@ -522,7 +510,7 @@ struct iochannel_vnic {u8 macaddr[6 ];/* 6 bytes */ u32 num_rcv_bufs;/* 4 bytes */ u32 mtu;/* 4 bytes */ -uuid_le zone_uuid;/* 16 bytes */ +guid_t zone_guid;/* 16 bytes */ } __packed;/* * This is just the header of the IO channel. It is assumed that directly after
drivers/staging/unisys/include/visorbus.h +6 -6
@@ -58,7 +58,7 @@ struct visorchipset_state {* GUID, name, and sizes. */ struct visor_channeltype_descriptor { -const uuid_le guid; +const guid_t guid;const char *name; };
@@ -141,14 +141,14 @@ struct visor_driver {* hypervisor requests. * @vbus_hdr_info: A pointer to header info. Private use by bus * driver. -* @partition_uuid: Indicates client partion id. This should be the +* @partition_guid: Indicates client partion id. This should be the * same across all visor_devices in the current * guest. Private use by bus driver only. */ struct visor_device {struct visorchannel *visorchannel; -uuid_le channel_type_guid; +guid_t channel_type_guid;/* These fields are for private use by the bus driver only. */ struct device device;struct list_head list_all;
@@ -161,11 +161,11 @@ struct visor_device {u32 chipset_bus_no;u32 chipset_dev_no;struct visorchipset_state state; -uuid_le inst; +guid_t inst;u8 *name;struct controlvm_message_header *pending_msg_hdr;void *vbus_hdr_info; -uuid_le partition_uuid; +guid_t partition_guid;struct dentry *debugfs_dir;struct dentry *debugfs_client_bus_info; };
@@ -207,7 +207,7 @@ int visorchannel_signalremove(struct visorchannel *channel, u32 queue,int visorchannel_signalinsert (struct visorchannel *channel,u32 queue,void *msg);bool visorchannel_signalempty (struct visorchannel *channel,u32 queue); -uuid_le visorchannel_get_uuid (struct visorchannel *channel); +const guid_t *visorchannel_get_guid (struct visorchannel *channel);#define BUS_ROOT_DEVICE UINT_MAX struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
drivers/staging/unisys/visorbus/controlvmchannel.h +8 -16
@@ -19,9 +19,9 @@#include "channel.h" /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */ -#define VISOR_CONTROLVM_CHANNEL_UUID \ - UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \ - 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d) +#define VISOR_CONTROLVM_CHANNEL_GUID \ + GUID_INIT(0x2b3c2d10, 0x7ef5, 0x4ad8, \ + 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)#define VISOR_CONTROLVM_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE#define CONTROLVM_MESSAGE_MAX 64
@@ -34,14 +34,6 @@*/ #define VISOR_CONTROLVM_CHANNEL_VERSIONID 1 -#define VISOR_CONTROLVM_CHANNEL_OK_CLIENT (ch) \ - (visor_check_channel(ch, \ - VISOR_CONTROLVM_CHANNEL_UUID, \ - "controlvm", \ - sizeof(struct visor_controlvm_channel), \ - VISOR_CONTROLVM_CHANNEL_VERSIONID, \ - VISOR_CONTROLVM_CHANNEL_SIGNATURE)) -/* Defines for various channel queues */ #define CONTROLVM_QUEUE_REQUEST 0#define CONTROLVM_QUEUE_RESPONSE 1
@@ -222,8 +214,8 @@ struct controlvm_packet_device_create {*/ u64 channel_addr;u64 channel_bytes;/* specifies size of the channel in bytes */ -uuid_le data_type_uuid;/* specifies format of data in channel */ -uuid_le dev_inst_uuid;/* instance guid for the device */ +guid_t data_type_guid;/* specifies format of data in channel */ +guid_t dev_inst_guid;/* instance guid for the device */ struct irq_info intr;/* specifies interrupt information */ } __packed;/* for CONTROLVM_DEVICE_CREATE */
@@ -258,8 +250,8 @@ struct controlvm_message_packet {u64 channel_addr;u64 channel_bytes;/* size of the channel */ /* indicates format of data in bus channel*/ -uuid_le bus_data_type_uuid; -uuid_le bus_inst_uuid;/* instance uuid for the bus */ +guid_t bus_data_type_guid; +guid_t bus_inst_guid;/* instance GUID for the bus */ }__packed create_bus;/* for CONTROLVM_BUS_CREATE */ struct {/* bus # (0..n-1) from the msg receiver's perspective */
@@ -455,7 +447,7 @@ struct visor_controlvm_parameters_header {u32 client_length;u32 name_offset;u32 name_length; -uuid_le id; +guid_t id;u32 revision;u32 reserved;/* Natural alignment */ } __packed;
drivers/staging/unisys/visorbus/vbuschannel.h +3 -4
@@ -27,10 +27,9 @@#include "channel.h" /* {193b331b-c58f-11da-95a9-00e08161165f} */ -#define VISOR_VBUS_CHANNEL_UUID \ - UUID_LE(0x193b331b, 0xc58f, 0x11da, \ - 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) -static const uuid_le visor_vbus_channel_uuid =VISOR_VBUS_CHANNEL_UUID ; +#define VISOR_VBUS_CHANNEL_GUID \ + GUID_INIT(0x193b331b, 0xc58f, 0x11da, \ + 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)#define VISOR_VBUS_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
drivers/staging/unisys/visorbus/visorbus_main.c +14 -14
@@ -20,6 +20,8 @@#include "visorbus.h" #include "visorbus_private.h" +static const guid_t visor_vbus_channel_guid =VISOR_VBUS_CHANNEL_GUID ; +#define MYDRVNAME "visorbus"/* Display string that is guaranteed to be no longer the 99 characters*/
@@ -40,11 +42,11 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) {struct visor_device *vdev; -uuid_le guid; +const guid_t *guid; vdev =to_visor_device (dev); - guid =visorchannel_get_uuid (vdev->visorchannel); -return sprintf (buf,"visorbus:%pUl\n" , &guid); + guid =visorchannel_get_guid (vdev->visorchannel); +return sprintf (buf,"visorbus:%pUl\n" , guid); }static DEVICE_ATTR_RO (modalias);
@@ -77,12 +79,12 @@ static int visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env) { struct visor_device *dev; -uuid_le guid; +const guid_t *guid; dev =to_visor_device (xdev); - guid =visorchannel_get_uuid (dev->visorchannel); + guid =visorchannel_get_guid (dev->visorchannel); -return add_uevent_var (env,"MODALIAS=visorbus:%pUl" , &guid); +return add_uevent_var (env,"MODALIAS=visorbus:%pUl" , guid); }/*
@@ -97,24 +99,22 @@ visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env)static int visorbus_match (struct device *xdev,struct device_driver *xdrv) { -uuid_le channel_type; +const guid_t *channel_type;int i;struct visor_device *dev;struct visor_driver *drv; dev =to_visor_device (xdev); drv =to_visor_driver (xdrv); - channel_type =visorchannel_get_uuid (dev->visorchannel); + channel_type =visorchannel_get_guid (dev->visorchannel);if (!drv->channel_types)return 0 ;for (i =0 ; - (uuid_le_cmp (drv->channel_types[i].guid,NULL_UUID_LE ) !=0 ) || - (drv->channel_types[i].name); + !guid_is_null (&drv->channel_types[i].guid) || drv->channel_types[i].name; i++) -if (uuid_le_cmp (drv->channel_types[i].guid, - channel_type) ==0 ) +if (guid_equal (&drv->channel_types[i].guid, channel_type))return i +1 ;return 0 ;
@@ -283,7 +283,7 @@ static ssize_t partition_guid_show(struct device *dev, char *buf) {struct visor_device *vdev =to_visor_device (dev); -return sprintf (buf,"{%pUb}\n" , &vdev->partition_uuid); +return sprintf (buf,"{%pUb}\n" , &vdev->partition_guid); }static DEVICE_ATTR_RO (partition_guid);
@@ -687,7 +687,7 @@ get_vbus_header_info(struct visorchannel *chan,int err; if (!visor_check_channel(visorchannel_get_header(chan), - visor_vbus_channel_uuid, + &visor_vbus_channel_guid, "vbus", sizeof(struct visor_vbus_channel), VISOR_VBUS_CHANNEL_VERSIONID,
drivers/staging/unisys/visorbus/visorbus_private.h +3 -3
@@ -48,10 +48,10 @@ void visorbus_exit(void);struct visorchannel *visorchannel_create (u64 physaddr,unsigned long channel_bytes, -gfp_t gfp,uuid_le guid); +gfp_t gfp,const guid_t *guid);struct visorchannel *visorchannel_create_with_lock (u64 physaddr,unsigned long channel_bytes, -gfp_t gfp,uuid_le guid); +gfp_t gfp,const guid_t *guid);void visorchannel_destroy (struct visorchannel *channel);int visorchannel_read (struct visorchannel *channel,ulong offset,void *dest,ulong nbytes);
@@ -64,6 +64,6 @@ char *visorchannel_zoneid(struct visorchannel *channel, char *s);u64 visorchannel_get_clientpartition (struct visorchannel *channel);int visorchannel_set_clientpartition (struct visorchannel *channel,u64 partition_handle); -char *visorchannel_uuid_id (uuid_le *guid,char *s); +char *visorchannel_guid_id (const guid_t *guid,char *s);void *visorchannel_get_header (struct visorchannel *channel);#endif
drivers/staging/unisys/visorbus/visorchannel.c +24 -24
142 lines not on this page · raw message
drivers/staging/unisys/visorbus/visorchipset.c +23 -16
@@ -27,6 +27,10 @@#include "visorbus_private.h" #include "vmcallinterface.h" +static const guid_t visor_vhba_channel_guid =VISOR_VHBA_CHANNEL_GUID ; +static const guid_t visor_siovm_guid =VISOR_SIOVM_GUID ; +static const guid_t visor_controlvm_channel_guid =VISOR_CONTROLVM_CHANNEL_GUID ; +#define CURRENT_FILE_PC VISOR_BUS_PC_visorchipset_c#define POLLJIFFIES_CONTROLVMCHANNEL_FAST 1
@@ -277,13 +281,12 @@ static ssize_t remaining_steps_store(struct device *dev, }static DEVICE_ATTR_RW (remaining_steps); -static uuid_le -parser_id_get (struct parser_context *ctx) +static const guid_t *parser_id_get (struct parser_context *ctx) {struct visor_controlvm_parameters_header *phdr =NULL ; phdr = (struct visor_controlvm_parameters_header *)(ctx->data); -return phdr->id; +return &phdr->id; }static void parser_done (struct parser_context *ctx)
@@ -595,7 +598,7 @@ visorbus_create(struct controlvm_message *inmsg) bus_info->chipset_bus_no = bus_no; bus_info->chipset_dev_no =BUS_ROOT_DEVICE ; -if (uuid_le_cmp (cmd->create_bus.bus_inst_uuid, visor_siovm_uuid) ==0 ) { +if (guid_equal (&cmd->create_bus.bus_inst_guid, &visor_siovm_guid)) { err =save_crash_message (inmsg,CRASH_BUS );if (err) goto err_free_bus_info;
@@ -617,7 +620,7 @@ visorbus_create(struct controlvm_message *inmsg) visorchannel =visorchannel_create (cmd->create_bus.channel_addr, cmd->create_bus.channel_bytes,GFP_KERNEL , - cmd->create_bus.bus_data_type_uuid); + &cmd->create_bus.bus_data_type_guid);if (!visorchannel) { err = -ENOMEM ;
@@ -722,7 +725,9 @@ visorbus_configure(struct controlvm_message *inmsg, goto err_respond;if (parser_ctx) { - bus_info->partition_uuid =parser_id_get (parser_ctx); +const guid_t *partition_guid =parser_id_get (parser_ctx); + +guid_copy (&bus_info->partition_guid, partition_guid); bus_info->name =parser_name_get (parser_ctx); }
@@ -781,7 +786,7 @@ visorbus_device_create(struct controlvm_message *inmsg) dev_info->chipset_bus_no = bus_no; dev_info->chipset_dev_no = dev_no; - dev_info->inst = cmd->create_device.dev_inst_uuid; +guid_copy (&dev_info->inst, &cmd->create_device.dev_inst_guid);/* not sure where the best place to set the 'parent' */ dev_info->device.parent = &bus_info->device;
@@ -790,7 +795,7 @@ visorbus_device_create(struct controlvm_message *inmsg)visorchannel_create_with_lock (cmd->create_device.channel_addr, cmd->create_device.channel_bytes,GFP_KERNEL , - cmd->create_device.data_type_uuid); + &cmd->create_device.data_type_guid);if (!visorchannel) { dev_err(&chipset_dev->acpi_device->dev,
@@ -800,9 +805,8 @@ visorbus_device_create(struct controlvm_message *inmsg) goto err_free_dev_info; } dev_info->visorchannel = visorchannel; - dev_info->channel_type_guid = cmd->create_device.data_type_uuid; -if (uuid_le_cmp (cmd->create_device.data_type_uuid, - visor_vhba_channel_uuid) ==0 ) { +guid_copy (&dev_info->channel_type_guid, &cmd->create_device.data_type_guid); +if (guid_equal (&cmd->create_device.data_type_guid, &visor_vhba_channel_guid)) { err =save_crash_message (inmsg,CRASH_DEV );if (err) goto err_destroy_visorchannel;
@@ -1817,7 +1821,6 @@ visorchipset_init(struct acpi_device *acpi_device) {int err = -ENODEV ;u64 addr; -uuid_le uuid =VISOR_CONTROLVM_CHANNEL_UUID ;struct visorchannel *controlvm_channel; chipset_dev =kzalloc (sizeof (*chipset_dev),GFP_KERNEL );
@@ -1832,9 +1835,9 @@ visorchipset_init(struct acpi_device *acpi_device) chipset_dev->acpi_device = acpi_device; chipset_dev->poll_jiffies =POLLJIFFIES_CONTROLVMCHANNEL_FAST ; - controlvm_channel =visorchannel_create_with_lock (addr, -0 ,GFP_KERNEL , uuid); + controlvm_channel =visorchannel_create_with_lock (addr,0 ,GFP_KERNEL , + &visor_controlvm_channel_guid);if (!controlvm_channel) goto error_free_chipset_dev;
@@ -1845,8 +1848,12 @@ visorchipset_init(struct acpi_device *acpi_device)if (err <0 ) goto error_destroy_channel; -if (!VISOR_CONTROLVM_CHANNEL_OK_CLIENT ( -visorchannel_get_header (controlvm_channel))) +if (!visor_check_channel (visorchannel_get_header (controlvm_channel), + &visor_controlvm_channel_guid, +"controlvm" , +sizeof (struct visor_controlvm_channel ), +VISOR_CONTROLVM_CHANNEL_VERSIONID , +VISOR_CONTROLVM_CHANNEL_SIGNATURE )) goto error_delete_groups;/* if booting in a crash kernel */
drivers/staging/unisys/visorhba/visorhba_main.c +3 -3
@@ -39,12 +39,12 @@ static struct visor_channeltype_descriptor visorhba_channel_types[] = {/* Note that the only channel type we expect to be reported by the * bus driver is the VISOR_VHBA channel. */ - { VISOR_VHBA_CHANNEL_UUID, "sparvhba" }, - { NULL_UUID_LE, NULL } + { VISOR_VHBA_CHANNEL_GUID, "sparvhba" }, + {} };MODULE_DEVICE_TABLE (visorbus, visorhba_channel_types); -MODULE_ALIAS ("visorbus:" VISOR_VHBA_CHANNEL_UUID_STR ); +MODULE_ALIAS ("visorbus:" VISOR_VHBA_CHANNEL_GUID_STR ); struct visordisk_info { u32 valid;
drivers/staging/unisys/visorinput/visorinput.c +19 -19
@@ -33,16 +33,16 @@#include "ultrainputreport.h" /* Keyboard channel {c73416d0-b0b8-44af-b304-9d2ae99f1b3d} */ -#define VISOR_KEYBOARD_CHANNEL_UUID \ - UUID_LE(0xc73416d0, 0xb0b8, 0x44af, \ - 0xb3, 0x4, 0x9d, 0x2a, 0xe9, 0x9f, 0x1b, 0x3d) -#define VISOR_KEYBOARD_CHANNEL_UUID_STR "c73416d0-b0b8-44af-b304-9d2ae99f1b3d" +#define VISOR_KEYBOARD_CHANNEL_GUID \ + GUID_INIT(0xc73416d0, 0xb0b8, 0x44af, \ + 0xb3, 0x4, 0x9d, 0x2a, 0xe9, 0x9f, 0x1b, 0x3d) +#define VISOR_KEYBOARD_CHANNEL_GUID_STR "c73416d0-b0b8-44af-b304-9d2ae99f1b3d"/* Mouse channel {addf07d4-94a9-46e2-81c3-61abcdbdbd87} */ -#define VISOR_MOUSE_CHANNEL_UUID \ - UUID_LE(0xaddf07d4, 0x94a9, 0x46e2, \ - 0x81, 0xc3, 0x61, 0xab, 0xcd, 0xbd, 0xbd, 0x87) -#define VISOR_MOUSE_CHANNEL_UUID_STR "addf07d4-94a9-46e2-81c3-61abcdbdbd87" +#define VISOR_MOUSE_CHANNEL_GUID \ + GUID_INIT(0xaddf07d4, 0x94a9, 0x46e2, \ + 0x81, 0xc3, 0x61, 0xab, 0xcd, 0xbd, 0xbd, 0x87) +#define VISOR_MOUSE_CHANNEL_GUID_STR "addf07d4-94a9-46e2-81c3-61abcdbdbd87"#define PIXELS_ACROSS_DEFAULT 800#define PIXELS_DOWN_DEFAULT 600
@@ -69,8 +69,8 @@ struct visorinput_devdata {unsigned char keycode_table[0 ]; }; -static const uuid_le visor_keyboard_channel_uuid =VISOR_KEYBOARD_CHANNEL_UUID ; -static const uuid_le visor_mouse_channel_uuid =VISOR_MOUSE_CHANNEL_UUID ; +static const guid_t visor_keyboard_channel_guid =VISOR_KEYBOARD_CHANNEL_GUID ; +static const guid_t visor_mouse_channel_guid =VISOR_MOUSE_CHANNEL_GUID ;/* * Borrowed from drivers/input/keyboard/atakbd.c
@@ -449,13 +449,13 @@ devdata_create(struct visor_device *dev, enum visorinput_device_type devtype)static int visorinput_probe (struct visor_device *dev) { -uuid_le guid; +const guid_t *guid;enum visorinput_device_type devtype; - guid =visorchannel_get_uuid (dev->visorchannel); -if (uuid_le_cmp (guid, visor_mouse_channel_uuid) ==0 ) + guid =visorchannel_get_guid (dev->visorchannel); +if (guid_equal (guid, &visor_mouse_channel_guid)) devtype = visorinput_mouse; -else if (uuid_le_cmp (guid, visor_keyboard_channel_uuid) ==0 ) +else if (guid_equal (guid, &visor_keyboard_channel_guid)) devtype = visorinput_keyboard;else return -ENODEV ;
@@ -727,9 +727,9 @@ visorinput_resume(struct visor_device *dev,/* GUIDS for all channel types supported by this driver. */ static struct visor_channeltype_descriptor visorinput_channel_types[] = { - {VISOR_KEYBOARD_CHANNEL_UUID ,"keyboard" }, - {VISOR_MOUSE_CHANNEL_UUID ,"mouse" }, - {NULL_UUID_LE ,NULL } + {VISOR_KEYBOARD_CHANNEL_GUID ,"keyboard" }, + {VISOR_MOUSE_CHANNEL_GUID ,"mouse" }, + {} };static struct visor_driver visorinput_driver = {
@@ -764,5 +764,5 @@ MODULE_AUTHOR("Unisys");MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("s-Par human input driver for virtual keyboard/mouse" ); -MODULE_ALIAS ("visorbus:" VISOR_MOUSE_CHANNEL_UUID_STR ); -MODULE_ALIAS ("visorbus:" VISOR_KEYBOARD_CHANNEL_UUID_STR ); +MODULE_ALIAS ("visorbus:" VISOR_MOUSE_CHANNEL_GUID_STR ); +MODULE_ALIAS ("visorbus:" VISOR_KEYBOARD_CHANNEL_GUID_STR );
drivers/staging/unisys/visornic/visornic_main.c +3 -3
@@ -41,8 +41,8 @@ static struct visor_channeltype_descriptor visornic_channel_types[] = {/* Note that the only channel type we expect to be reported by the * bus driver is the VISOR_VNIC channel. */ - { VISOR_VNIC_CHANNEL_UUID, "ultravnic" }, - { NULL_UUID_LE, NULL } + { VISOR_VNIC_CHANNEL_GUID, "ultravnic" }, + {} };MODULE_DEVICE_TABLE (visorbus, visornic_channel_types);/*
@@ -52,7 +52,7 @@ MODULE_DEVICE_TABLE(visorbus, visornic_channel_types);* must be added to scripts/mode/file2alias.c, etc., to get this working * properly. */ -MODULE_ALIAS ("visorbus:" VISOR_VNIC_CHANNEL_UUID_STR ); +MODULE_ALIAS ("visorbus:" VISOR_VNIC_CHANNEL_GUID_STR );struct chanstat {unsigned long got_rcv;
Signature · 1 line
2.11.0
Andy Shevchenko
reviewerRe: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
Quoted 7 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
While here, re-indent couple of lines to increase readability.
This looks like no user space UUID API is involved, can be routed via either tree (uuid or staging).
Anyone to comment?
Quoted 1,043 lines
Cc David Kershner <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>---
drivers/staging/unisys/Documentation/overview.txt | 14 +++---- drivers/staging/unisys/include/channel.h | 45 ++++++++++---
-------
drivers/staging/unisys/include/iochannel.h | 14 +------ drivers/staging/unisys/include/visorbus.h | 12 +++---drivers/staging/unisys/visorbus/controlvmchannel.h| 24 ++++------- drivers/staging/unisys/visorbus/vbuschannel.h | 7 ++-- drivers/staging/unisys/visorbus/visorbus_main.c | 28 ++++++-------drivers/staging/unisys/visorbus/visorbus_private.h| 6 +-- drivers/staging/unisys/visorbus/visorchannel.c | 48 +++++++++++
-----------
drivers/staging/unisys/visorbus/visorchipset.c | 39 ++++++++++---
-----
drivers/staging/unisys/visorhba/visorhba_main.c | 6 +-- drivers/staging/unisys/visorinput/visorinput.c | 38 ++++++++-----
----
drivers/staging/unisys/visornic/visornic_main.c | 6 +--13 files changed, 135 insertions(+), 152 deletions(-)drivers/staging/unisys/Documentation/overview.txt +0
-0@@ -221,7 +221,7 @@ The following files exist under/sys/devices/visorbus<x>/vbus<x>:dev<y>:
The visorhba driver registers with visorbus as the function driver to handle virtual scsi disk devices, specified using thedrivers/staging/unisys/Documentation/overview.txt +1
-1-VISOR_VHBA_CHANNEL_UUID type in the visorbus_register_visor_driver() +VISOR_VHBA_CHANNEL_GUID type in the visorbus_register_visor_driver()call. visorhba uses
scsi_add_host()to expose a Linux block device (e.g.,/sys/block/) in the guest environment for each s-Par virtual device.drivers/staging/unisys/Documentation/overview.txt +0
-0@@ -240,7 +240,7 @@ When compiled as a module, visorhba can beautoloaded by visorbus in
standard udev/systemd environments, as it includes the modules.alias definition:
- "visorbus:"+VISOR_VHBA_CHANNEL_UUID_STR
+ "visorbus:"+VISOR_VHBA_CHANNEL_GUID_STR
i.e.:drivers/staging/unisys/Documentation/overview.txt +0
-0@@ -252,7 +252,7 @@ i.e.:
The visornic driver registers with visorbus as the function driver to handle virtual network devices, specified using thedrivers/staging/unisys/Documentation/overview.txt +1
-1-VISOR_VNIC_CHANNEL_UUID type in the visorbus_register_visor_driver() +VISOR_VNIC_CHANNEL_GUID type in the visorbus_register_visor_driver()call. visornic uses
register_netdev()to expose a Linux device of class net
(e.g.,/sys/class/net/) in the guest environment for each s-Par virtual
device.drivers/staging/unisys/Documentation/overview.txt +0
-0@@ -270,7 +270,7 @@ When compiled as a module, visornic can beautoloaded by visorbus in
standard udev/systemd environments, as it includes the modules.alias definition:
- "visorbus:"+VISOR_VNIC_CHANNEL_UUID_STR
+ "visorbus:"+VISOR_VNIC_CHANNEL_GUID_STR
i.e.:drivers/staging/unisys/Documentation/overview.txt +0
-0@@ -282,7 +282,7 @@ i.e.:
The visorinput driver registers with visorbus as the function driver to
handle human input devices, specified using thedrivers/staging/unisys/Documentation/overview.txt +1
-1-VISOR_KEYBOARD_CHANNEL_UUID and VISOR_MOUSE_CHANNEL_UUID +VISOR_KEYBOARD_CHANNEL_GUID and VISOR_MOUSE_CHANNEL_GUIDtypes in the
visorbus_register_visor_driver()call. visorinput usesinput_register_device()to expose devices of class input (e.g.,/sys/class/input/) for virtual keyboard and virtual mouse devices.drivers/staging/unisys/Documentation/overview.txt +0
-0@@ -307,8 +307,8 @@ When compiled as a module, visorinput can beautoloaded by visorbus in
standard udev/systemd environments, as it includes the modules.alias definition:
- "visorbus:"+VISOR_MOUSE_CHANNEL_UUID_STR
- "visorbus:"+VISOR_KEYBOARD_CHANNEL_UUID_STR
+ "visorbus:"+VISOR_MOUSE_CHANNEL_GUID_STR
+ "visorbus:"+VISOR_KEYBOARD_CHANNEL_GUID_STR
i.e.:drivers/staging/unisys/include/channel.h +0
-0@@ -116,13 +116,13 @@ struct channel_header {u32
header_size; /*sizeof(struct channel_header)*/
u64 size; /* Total size of this channel in
bytes */
u64 features; /* Flags to modify behavior */drivers/staging/unisys/include/channel.h +0
-1-uuid_le chtype;/* Channel type: data, bus, control, etc. */
drivers/staging/unisys/include/channel.h +1
-0+guid_t chtype;/* Channel type: data, bus, control, etc. */
u64partition_handle; /* ID of guest partition */
u64 handle; /* Device number of this channel
in client */
u64ch_space_offset; /* Offset in bytes to channel
specific area */
u32version_id; /* structchannel_header
Version ID */
u32partition_index; /* Index of guest partition */drivers/staging/unisys/include/channel.h +1
-1-uuid_le zone_uuid;/* Guid of Channel's zone */ +guid_t zone_guid;/* Guid of Channel's zone */ u32
cli_str_offset; /* offset from channel header to
* nul-terminated ClientString (0 if
* ClientString not present)drivers/staging/unisys/include/channel.h +0
-0@@ -205,25 +205,25 @@ struct signal_queue_header {*/ static inline int
visor_check_channel(structchannel_header*ch,drivers/staging/unisys/include/channel.h +1
-1- uuid_le expected_uuid, + const guid_t *expected_guid,char *chname,
u64expected_min_bytes,
u32expected_version,
u64expected_signature)
{drivers/staging/unisys/include/channel.h +1
-1-if (uuid_le_cmp (expected_uuid,NULL_UUID_LE ) !=0 ) { +if (!guid_is_null (expected_guid)) {/* caller wants us to verify type GUID */
drivers/staging/unisys/include/channel.h +1
-1-if (uuid_le_cmp (ch->chtype, expected_uuid) !=0 ) { +if (!guid_equal (&ch->chtype, expected_guid)) {pr_err("Channel mismatch on channel=%s(%pUL) field=type expected=%pUL actual=%pUL\n",
drivers/staging/unisys/include/channel.h +2
-2- chname, &expected_uuid, - &expected_uuid, &ch->chtype); + chname, expected_guid, + expected_guid, &ch->chtype);return 0;
}
}
if (expected_min_bytes> 0) { /* verify channel size
*/
if (ch->size<expected_min_bytes) { pr_err("Channel mismatch on channel=%s(%pUL) field=size expected=0x%-8.8Lx actual=0x%-8.8Lx\n",drivers/staging/unisys/include/channel.h +1
-1- chname, &expected_uuid, + chname, expected_guid,(unsigned long
long)expected_min_bytes,
ch->size);
return 0;drivers/staging/unisys/include/channel.h +0
-0@@ -232,7 +232,7 @@ visor_check_channel(struct channel_header *ch,if (
expected_version> 0) { /* verify channel version
*/
if (ch->version_id!=expected_version) { pr_err("Channel mismatch on channel=%s(%pUL) field=version expected=0x%-8.8lx actual=0x%-8.8x\n",drivers/staging/unisys/include/channel.h +1
-1- chname, &expected_uuid, + chname, expected_guid,(unsigned long)expected_version,
ch->version_id); return 0;drivers/staging/unisys/include/channel.h +0
-0@@ -241,7 +241,7 @@ visor_check_channel(struct channel_header *ch,if (
expected_signature> 0) { /* verify channel
signature */
if (ch->signature!=expected_signature) { pr_err("Channel mismatch on channel=%s(%pUL) field=signature expected=0x%-8.8Lx actual=0x%-8.8Lx\n",drivers/staging/unisys/include/channel.h +1
-1- chname, &expected_uuid, + chname, expected_guid,expected_signature,
ch->signature); return 0;
}drivers/staging/unisys/include/channel.h +0
-0@@ -254,25 +254,22 @@ visor_check_channel(struct channel_header *ch,*/
/* {414815ed-c58c-11da-95a9-00e08161165f} */drivers/staging/unisys/include/channel.h +0
-4-#define VISOR_VHBA_CHANNEL_UUID \ - UUID_LE(0x414815ed, 0xc58c, 0x11da, \ - 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) -static const uuid_le visor_vhba_channel_uuid =
VISOR_VHBA_CHANNEL_UUID;drivers/staging/unisys/include/channel.h +4
-1-#define VISOR_VHBA_CHANNEL_UUID_STR \ +#define VISOR_VHBA_CHANNEL_GUID \ + GUID_INIT(0x414815ed, 0xc58c, 0x11da, \ + 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) +#define VISOR_VHBA_CHANNEL_GUID_STR \"414815ed-c58c-11da-95a9-00e08161165f"
/* {8cd5994d-c58e-11da-95a9-00e08161165f} */drivers/staging/unisys/include/channel.h +0
-4-#define VISOR_VNIC_CHANNEL_UUID \ - UUID_LE(0x8cd5994d, 0xc58e, 0x11da, \ - 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) -static const uuid_le visor_vnic_channel_uuid =
VISOR_VNIC_CHANNEL_UUID;drivers/staging/unisys/include/channel.h +4
-1-#define VISOR_VNIC_CHANNEL_UUID_STR \ +#define VISOR_VNIC_CHANNEL_GUID \ + GUID_INIT(0x8cd5994d, 0xc58e, 0x11da, \ + 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) +#define VISOR_VNIC_CHANNEL_GUID_STR \"8cd5994d-c58e-11da-95a9-00e08161165f"
/* {72120008-4AAB-11DC-8530-444553544200} */drivers/staging/unisys/include/channel.h +3
-4-#define VISOR_SIOVM_UUID \ - UUID_LE(0x72120008, 0x4AAB, 0x11DC, \ - 0x85, 0x30, 0x44, 0x45, 0x53, 0x54, 0x42, 0x00) -static const uuid_le visor_siovm_uuid =VISOR_SIOVM_UUID ; +#define VISOR_SIOVM_GUID \ + GUID_INIT(0x72120008, 0x4AAB, 0x11DC, \ + 0x85, 0x30, 0x44, 0x45, 0x53, 0x54, 0x42, 0x00)
#endifdrivers/staging/unisys/include/iochannel.h +0
-0@@ -49,18 +49,6 @@ #define VISOR_VNIC_CHANNEL_VERSIONID 2 #define VISOR_VSWITCH_CHANNEL_VERSIONID 1drivers/staging/unisys/include/iochannel.h +0
-12-#define VISOR_VHBA_CHANNEL_OK_CLIENT (ch) \ - (visor_check_channel(ch, visor_vhba_channel_uuid, \ - "vhba", MIN_IO_CHANNEL_SIZE, \ - VISOR_VHBA_CHANNEL_VERSIONID, \ - VISOR_VHBA_CHANNEL_SIGNATURE)) - -#define VISOR_VNIC_CHANNEL_OK_CLIENT (ch) \ - (visor_check_channel(ch, visor_vnic_channel_uuid, \ - "vnic", MIN_IO_CHANNEL_SIZE, \ - VISOR_VNIC_CHANNEL_VERSIONID, \ - VISOR_VNIC_CHANNEL_SIGNATURE)) -/*
* Everything necessary to handle SCSI & NIC traffic between Guest Partition and
* IO Partition is defined below.drivers/staging/unisys/include/iochannel.h +0
-0@@ -522,7 +510,7 @@ struct iochannel_vnic {u8 macaddr[6]; /* 6 bytes */
u32num_rcv_bufs; /* 4 bytes */
u32 mtu; /* 4 bytes */drivers/staging/unisys/include/iochannel.h +1
-1-uuid_le zone_uuid;/* 16 bytes */ +guid_t zone_guid;/* 16 bytes */ }
__packed;
/*
* This is just the header of the IO channel. It is assumed that directly afterdrivers/staging/unisys/include/visorbus.h +1
-1@@ -58,7 +58,7 @@ struct visorchipset_state {* GUID, name, and sizes. */ struct visor_channeltype_descriptor { -const uuid_le guid; +const guid_t guid; const char *name; };drivers/staging/unisys/include/visorbus.h +0
-0@@ -141,14 +141,14 @@ struct visor_driver { * hypervisor requests. * @vbus_hdr_info: A pointer to header info. Privateuse by bus
* driver.
- * @partition_uuid: Indicates client partion id. This
should be the
+ * @partition_guid: Indicates client partion id. This
should be the
* same across allvisor_devicesin
the current
* guest. Private use by bus driver
only.
*/
structvisor_device{
struct visorchannel *visorchannel;drivers/staging/unisys/include/visorbus.h +1
-1-uuid_le channel_type_guid; +guid_t channel_type_guid;/* These fields are for private use by the bus driver only. */
struct device device;
structlist_headlist_all;drivers/staging/unisys/include/visorbus.h +2
-2@@ -161,11 +161,11 @@ struct visor_device { u32 chipset_bus_no; u32 chipset_dev_no; struct visorchipset_state state; -uuid_le inst; +guid_t inst; u8 *name; struct controlvm_message_header *pending_msg_hdr; void *vbus_hdr_info; -uuid_le partition_uuid; +guid_t partition_guid; struct dentry *debugfs_dir; struct dentry *debugfs_client_bus_info; };@@ -207,7 +207,7 @@ int visorchannel_signalremove(struct visorchannel *channel, u32 queue,int visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
void *msg);
boolvisorchannel_signalempty(struct visorchannel *channel, u32 queue);drivers/staging/unisys/include/visorbus.h +1
-1-uuid_le visorchannel_get_uuid (struct visorchannel *channel); +const guid_t *visorchannel_get_guid (struct visorchannel *channel);
#defineBUS_ROOT_DEVICEUINT_MAX
structvisor_device*visorbus_get_device_by_id(u32bus_no, u32dev_no,drivers/staging/unisys/visorbus/controlvmchannel.h +0
-0@@ -19,9 +19,9 @@ #include "channel.h"
/* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */drivers/staging/unisys/visorbus/controlvmchannel.h +3
-3-#define VISOR_CONTROLVM_CHANNEL_UUID \ - UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \ - 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d) +#define VISOR_CONTROLVM_CHANNEL_GUID \ + GUID_INIT(0x2b3c2d10, 0x7ef5, 0x4ad8, \ + 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
#defineVISOR_CONTROLVM_CHANNEL_SIGNATUREVISOR_CHANNEL_SIGNATURE#defineCONTROLVM_MESSAGE_MAX64drivers/staging/unisys/visorbus/controlvmchannel.h +0
-0@@ -34,14 +34,6 @@*/ #define VISOR_CONTROLVM_CHANNEL_VERSIONID 1drivers/staging/unisys/visorbus/controlvmchannel.h +0
-5-#define VISOR_CONTROLVM_CHANNEL_OK_CLIENT (ch) \ - (visor_check_channel(ch, \ - VISOR_CONTROLVM_CHANNEL_UUID, \ - "controlvm", \ - sizeof(struct visor_controlvm_channel),\
drivers/staging/unisys/visorbus/controlvmchannel.h +0
-3- VISOR_CONTROLVM_CHANNEL_VERSIONID, \ - VISOR_CONTROLVM_CHANNEL_SIGNATURE)) -/* Defines for various channel queues */
#defineCONTROLVM_QUEUE_REQUEST0
#defineCONTROLVM_QUEUE_RESPONSE1drivers/staging/unisys/visorbus/controlvmchannel.h +0
-0@@ -222,8 +214,8 @@ struct controlvm_packet_device_create {*/ u64 channel_addr;u64
channel_bytes; /* specifies size of the channel in
bytes */drivers/staging/unisys/visorbus/controlvmchannel.h +0
-1-uuid_le data_type_uuid;/* specifies format of data in channel */
drivers/staging/unisys/visorbus/controlvmchannel.h +0
-1-uuid_le dev_inst_uuid;/* instance guid for the device */
drivers/staging/unisys/visorbus/controlvmchannel.h +1
-0+guid_t data_type_guid;/* specifies format of data in channel */
drivers/staging/unisys/visorbus/controlvmchannel.h +1
-0+guid_t dev_inst_guid;/* instance guid for the device */
structirq_infointr; /* specifies interrupt
information */
}__packed; /* forCONTROLVM_DEVICE_CREATE*/drivers/staging/unisys/visorbus/controlvmchannel.h +0
-0@@ -258,8 +250,8 @@ struct controlvm_message_packet { u64 channel_addr;u64
channel_bytes; /* size of the
channel */
/* indicates format of data in bus channel*/drivers/staging/unisys/visorbus/controlvmchannel.h +0
-2-uuid_le bus_data_type_uuid; -uuid_le bus_inst_uuid;/* instance uuid for the bus */
drivers/staging/unisys/visorbus/controlvmchannel.h +2
-0+guid_t bus_data_type_guid; +guid_t bus_inst_guid;/* instance GUID for the bus */
}__packedcreate_bus; /* forCONTROLVM_BUS_CREATE*/
struct {
/* bus # (0..n-1) from the msg receiver's perspective */drivers/staging/unisys/visorbus/controlvmchannel.h +1
-1@@ -455,7 +447,7 @@ struct visor_controlvm_parameters_header { u32 client_length; u32 name_offset; u32 name_length; -uuid_le id; +guid_t id; u32 revision;u32 reserved; /* Natural alignment */
}__packed;drivers/staging/unisys/visorbus/vbuschannel.h +0
-0@@ -27,10 +27,9 @@ #include "channel.h"
/* {193b331b-c58f-11da-95a9-00e08161165f} */drivers/staging/unisys/visorbus/vbuschannel.h +0
-4-#define VISOR_VBUS_CHANNEL_UUID \ - UUID_LE(0x193b331b, 0xc58f, 0x11da, \ - 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) -static const uuid_le visor_vbus_channel_uuid =
VISOR_VBUS_CHANNEL_UUID;drivers/staging/unisys/visorbus/vbuschannel.h +3
-0+#define VISOR_VBUS_CHANNEL_GUID \ + GUID_INIT(0x193b331b, 0xc58f, 0x11da, \ + 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
#defineVISOR_VBUS_CHANNEL_SIGNATUREVISOR_CHANNEL_SIGNATUREdrivers/staging/unisys/visorbus/visorbus_main.c +0
-0@@ -20,6 +20,8 @@ #include "visorbus.h" #include "visorbus_private.h"
+static constguid_tvisor_vbus_channel_guid=VISOR_VBUS_CHANNEL_GUID;
+
#define MYDRVNAME "visorbus"
/* Display string that is guaranteed to be no longer the 99 characters*/drivers/staging/unisys/visorbus/visorbus_main.c +1
-1@@ -40,11 +42,11 @@ static ssize_t modalias_show(struct device *dev,struct device_attribute *attr, char *buf) { struct visor_device *vdev; -uuid_le guid; +const guid_t *guid;
vdev =to_visor_device(dev);drivers/staging/unisys/visorbus/visorbus_main.c +2
-2- guid =visorchannel_get_uuid (vdev->visorchannel); -return sprintf (buf,"visorbus:%pUl\n" , &guid); + guid =visorchannel_get_guid (vdev->visorchannel); +return sprintf (buf,"visorbus:%pUl\n" , guid);}
staticDEVICE_ATTR_RO(modalias);drivers/staging/unisys/visorbus/visorbus_main.c +1
-1@@ -77,12 +79,12 @@ static int visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env) { struct visor_device *dev; -uuid_le guid; +const guid_t *guid;
dev =to_visor_device(xdev);drivers/staging/unisys/visorbus/visorbus_main.c +1
-1- guid =visorchannel_get_uuid (dev->visorchannel); + guid =visorchannel_get_guid (dev->visorchannel);drivers/staging/unisys/visorbus/visorbus_main.c +1
-1-return add_uevent_var (env,"MODALIAS=visorbus:%pUl" , &guid); +return add_uevent_var (env,"MODALIAS=visorbus:%pUl" , guid);}
/*drivers/staging/unisys/visorbus/visorbus_main.c +0
-0@@ -97,24 +99,22 @@ visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env)static int
visorbus_match(struct device *xdev, structdevice_driver*xdrv) {drivers/staging/unisys/visorbus/visorbus_main.c +1
-1-uuid_le channel_type; +const guid_t *channel_type;int i;
structvisor_device*dev;
structvisor_driver*drv;
dev =to_visor_device(xdev);
drv =to_visor_driver(xdrv);drivers/staging/unisys/visorbus/visorbus_main.c +1
-1- channel_type =visorchannel_get_uuid (dev->visorchannel); + channel_type =visorchannel_get_guid (dev->visorchannel);
if (!drv->channel_types)
return 0;
for (i = 0;drivers/staging/unisys/visorbus/visorbus_main.c +0
-1- (uuid_le_cmp(drv->channel_types[i].guid, NULL_UUID_LE)!= 0) ||
drivers/staging/unisys/visorbus/visorbus_main.c +1
-1- (drv->channel_types[i].name); + !guid_is_null(&drv->channel_types[i].guid) || drv-Quoted 1 line
channel_types[i].name;
i++)
drivers/staging/unisys/visorbus/visorbus_main.c +1
-2-if (uuid_le_cmp (drv->channel_types[i].guid, - channel_type) ==0 ) + if (guid_equal(&drv->channel_types[i].guid,
channel_type))
return i + 1;
return 0;drivers/staging/unisys/visorbus/visorbus_main.c +0
-0@@ -283,7 +283,7 @@ static ssize_t partition_guid_show(struct device *dev, char *buf) { struct visor_device *vdev = to_visor_device(dev);drivers/staging/unisys/visorbus/visorbus_main.c +1
-1-return sprintf (buf,"{%pUb}\n" , &vdev->partition_uuid); +return sprintf (buf,"{%pUb}\n" , &vdev->partition_guid);}
staticDEVICE_ATTR_RO(partition_guid);drivers/staging/unisys/visorbus/visorbus_main.c +0
-0@@ -687,7 +687,7 @@ get_vbus_header_info(struct visorchannel *chan, int err;
if (!visor_check_channel(visorchannel_get_header(chan),drivers/staging/unisys/visorbus/visorbus_main.c +1
-1- visor_vbus_channel_uuid, + &visor_vbus_channel_guid,"vbus",
sizeof(structvisor_vbus_channel),VISOR_VBUS_CHANNEL_VERSIONID,drivers/staging/unisys/visorbus/visorbus_private.h +0
-0@@ -48,10 +48,10 @@ void visorbus_exit(void);
struct visorchannel *visorchannel_create(u64 physaddr, unsigned longchannel_bytes,drivers/staging/unisys/visorbus/visorbus_private.h +1
-1- gfp_t gfp, uuid_le guid); + gfp_t gfp, const guid_t*guid);
struct visorchannel *visorchannel_create_with_lock(u64 physaddr, unsigned longchannel_bytes,drivers/staging/unisys/visorbus/visorbus_private.h +0
-1- gfp_t gfp, uuid_leguid);
drivers/staging/unisys/visorbus/visorbus_private.h +1
-0+ gfp_t gfp, const
guid_t*guid);
voidvisorchannel_destroy(struct visorchannel *channel); intvisorchannel_read(struct visorchannel *channel, ulong offset, void *dest, ulong nbytes);drivers/staging/unisys/visorbus/visorbus_private.h +1
-1@@ -64,6 +64,6 @@ char *visorchannel_zoneid(struct visorchannel *channel, char *s); u64 visorchannel_get_clientpartition(struct visorchannel *channel); int visorchannel_set_clientpartition(struct visorchannel *channel, u64 partition_handle); -char *visorchannel_uuid_id (uuid_le *guid,char *s); +char *visorchannel_guid_id (const guid_t *guid,char *s); void *visorchannel_get_header(struct visorchannel *channel);#endif
drivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -29,10 +29,10 @@ #define MYDRVNAME "visorchannel"
#defineVISOR_CONSOLEVIDEO_CHANNEL_GUID\drivers/staging/unisys/visorbus/visorchannel.c +2
-2-UUID_LE (0x3cd6e705 ,0xd6a2 ,0x4aa5 , \ -0xad ,0x5c ,0x7b ,0x8 ,0x88 ,0x9d ,0xff ,0xe2 ) +GUID_INIT (0x3cd6e705 ,0xd6a2 ,0x4aa5 , \ + 0xad, 0x5c, 0x7b, 0x8, 0x88, 0x9d, 0xff, 0xe2)
-static constuuid_levisor_video_guid=VISOR_CONSOLEVIDEO_CHANNEL_GUID;
+static constguid_tvisor_video_guid=VISOR_CONSOLEVIDEO_CHANNEL_GUID;
struct visorchannel {
u64 physaddr;drivers/staging/unisys/visorbus/visorchannel.c +1
-1@@ -40,14 +40,14 @@ struct visorchannel { void *mapped; bool requested; struct channel_header chan_hdr; -uuid_le guid; +guid_t guid;bool
needs_lock; /* channel creator knows if more than
one */
/* thread will be inserting or removing */
spinlock_tinsert_lock; /* protect head writes inchan_hdr*/
spinlock_tremove_lock; /* protect tail writes inchan_hdr*/drivers/staging/unisys/visorbus/visorchannel.c +2
-2-uuid_le type; -uuid_le inst; +guid_t type; +guid_t inst;};
voiddrivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -76,7 +76,7 @@ visorchannel_get_nbytes(struct visorchannel *channel) }
char *drivers/staging/unisys/visorbus/visorchannel.c +1
-1-visorchannel_uuid_id (uuid_le *guid, char *s) +visorchannel_guid_id(const guid_t *guid, char *s){
sprintf(s, "%pUL", guid);
return s;drivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -85,13 +85,13 @@ visorchannel_uuid_id(uuid_le *guid, char *s)char *
visorchannel_id(struct visorchannel *channel, char *s) {drivers/staging/unisys/visorbus/visorchannel.c +1
-1-return visorchannel_uuid_id (&channel->guid, s); +return visorchannel_guid_id (&channel->guid, s);}
char *
visorchannel_zoneid(struct visorchannel *channel, char *s) {drivers/staging/unisys/visorbus/visorchannel.c +1
-1-return visorchannel_uuid_id (&channel->chan_hdr.zone_uuid, s); +return visorchannel_guid_id (&channel->chan_hdr.zone_guid, s);}
u64drivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -109,17 +109,17 @@ visorchannel_set_clientpartition(struct visorchannel *channel, }
/**
- *visorchannel_get_uuid()- queries the UUID of the designated channel
+ *visorchannel_get_guid()- queries the GUID of the designated channel
* @channel: the channel to query
*
- * Return: the UUID of the provided channel
+ * Return: the GUID of the provided channel
*/drivers/staging/unisys/visorbus/visorchannel.c +2
-2-uuid_le -visorchannel_get_uuid (struct visorchannel *channel) +const guid_t * +visorchannel_get_guid (struct visorchannel *channel){
drivers/staging/unisys/visorbus/visorchannel.c +1
-1-return channel->guid; +return &channel->guid;}
drivers/staging/unisys/visorbus/visorchannel.c +1
-1-EXPORT_SYMBOL_GPL (visorchannel_get_uuid); +EXPORT_SYMBOL_GPL (visorchannel_get_guid);
int
visorchannel_read(struct visorchannel *channel, ulong offset,drivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -376,7 +376,7 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg) * back-end), in which case the actual channel sizewill be
* read from the channel header in memory
* @gfp: gfp_t to use when allocating memory for the data struct
- * @guid: uuid that identifies channel type; this may 0 if the channel
+ * @guid: GUID that identifies channel type; this may 0 if the channel
* has already been initialized in memory (which is true for all
* channels provided to guest environments by the s- Par
* back-end), in which case the actual channel guid will bedrivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -390,7 +390,7 @@ signalinsert_inner(struct visorchannel *channel,u32 queue, void *msg) */ static struct visorchannel * visorchannel_create_guts(u64 physaddr, unsigned long
channel_bytes,drivers/staging/unisys/visorbus/visorchannel.c +1
-1- gfp_t gfp, uuid_le guid, bool needs_lock) + gfp_t gfp, const guid_t *guid, bool
needs_lock)
{
struct visorchannel *channel;
int err;drivers/staging/unisys/visorbus/visorchannel.c +1
-1@@ -415,7 +415,7 @@ visorchannel_create_guts(u64 physaddr, unsignedlong channel_bytes, * release later on. */ channel->requested = request_mem_region(physaddr, size,MYDRVNAME ); -if (!channel->requested &&uuid_le_cmp (guid, visor_video_guid)) + if (!channel->requested && !guid_equal(guid,
&visor_video_guid))
/* we only care about errors if this is not the video channel */
gotoerr_destroy_channel;drivers/staging/unisys/visorbus/visorchannel.c +2
-2@@ -436,8 +436,8 @@ visorchannel_create_guts(u64 physaddr, unsignedlong channel_bytes, /* we had better be a CLIENT of this channel */ if (channel_bytes == 0) channel_bytes = (ulong)channel->chan_hdr.size; -if (uuid_le_cmp (guid,NULL_UUID_LE ) ==0 ) - guid = channel->chan_hdr.chtype; +if (guid_is_null (guid)) + guid = &channel->chan_hdr.chtype;
memunmap(channel->mapped);
if (channel->requested)drivers/staging/unisys/visorbus/visorchannel.c +1
-1@@ -445,7 +445,7 @@ visorchannel_create_guts(u64 physaddr, unsignedlong channel_bytes, channel->mapped = NULL; channel->requested = request_mem_region(channel->physaddr, channel_bytes,MYDRVNAME ); -if (!channel->requested &&uuid_le_cmp (guid, visor_video_guid)) + if (!channel->requested && !guid_equal(guid,
&visor_video_guid))
/* we only care about errors if this is not the video channel */
gotoerr_destroy_channel;drivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -457,7 +457,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes, }
channel->nbytes=channel_bytes;drivers/staging/unisys/visorbus/visorchannel.c +1
-1- channel->guid = guid; +guid_copy (&channel->guid, guid);return channel;
err_destroy_channel:drivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -467,7 +467,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
struct visorchannel *
visorchannel_create(u64 physaddr, unsigned longchannel_bytes,drivers/staging/unisys/visorbus/visorchannel.c +1
-1- gfp_t gfp, uuid_le guid) + gfp_t gfp, const guid_t *guid){
return visorchannel_create_guts(physaddr,channel_bytes, gfp, guid,
false);drivers/staging/unisys/visorbus/visorchannel.c +0
-0@@ -475,7 +475,7 @@ visorchannel_create(u64 physaddr, unsigned long channel_bytes,
struct visorchannel * visorchannel_create_with_lock(u64 physaddr, unsigned longchannel_bytes,drivers/staging/unisys/visorbus/visorchannel.c +1
-1- gfp_t gfp, uuid_le guid) + gfp_t gfp, const guid_t *guid){
return visorchannel_create_guts(physaddr,channel_bytes, gfp, guid,
true);drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -27,6 +27,10 @@ #include "visorbus_private.h" #include "vmcallinterface.h"
+static constguid_tvisor_vhba_channel_guid=VISOR_VHBA_CHANNEL_GUID;drivers/staging/unisys/visorbus/visorchipset.c +2
-0+static const guid_t visor_siovm_guid =VISOR_SIOVM_GUID ; +static const guid_t visor_controlvm_channel_guid =
VISOR_CONTROLVM_CHANNEL_GUID;
+
#defineCURRENT_FILE_PCVISOR_BUS_PC_visorchipset_c
#definePOLLJIFFIES_CONTROLVMCHANNEL_FAST1drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -277,13 +281,12 @@ static ssize_t remaining_steps_store(structdevice *dev, } static DEVICE_ATTR_RW(remaining_steps);drivers/staging/unisys/visorbus/visorchipset.c +1
-2-static uuid_le -parser_id_get (struct parser_context *ctx) +static const guid_t *parser_id_get (struct parser_context *ctx){
structvisor_controlvm_parameters_header*phdr = NULL;
phdr = (structvisor_controlvm_parameters_header*)(ctx-Quoted 1 line
data);
drivers/staging/unisys/visorbus/visorchipset.c +1
-1-return phdr->id; +return &phdr->id;}
static voidparser_done(struct parser_context *ctx)drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -595,7 +598,7 @@ visorbus_create(struct controlvm_message *inmsg) bus_info->chipset_bus_no = bus_no; bus_info->chipset_dev_no = BUS_ROOT_DEVICE;drivers/staging/unisys/visorbus/visorchipset.c +0
-1- if (uuid_le_cmp(cmd->create_bus.bus_inst_uuid,
visor_siovm_uuid) == 0) {drivers/staging/unisys/visorbus/visorchipset.c +1
-0+ if (guid_equal(&cmd->create_bus.bus_inst_guid,
&visor_siovm_guid)) {
err =save_crash_message(inmsg, CRASH_BUS); if (err)
gotoerr_free_bus_info;drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -617,7 +620,7 @@ visorbus_create(struct controlvm_message *inmsg)visorchannel = visorchannel_create(cmd-
Quoted 1 line
create_bus.channel_addr,
cmd-
Quoted 1 line
create_bus.channel_bytes,
GFP_KERNEL,
drivers/staging/unisys/visorbus/visorchipset.c +0
-1- cmd-Quoted 1 line
create_bus.bus_data_type_uuid);
drivers/staging/unisys/visorbus/visorchipset.c +1
-0+ &cmd-Quoted 1 line
create_bus.bus_data_type_guid);
if (!visorchannel) {
err =-ENOMEM;drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -722,7 +725,9 @@ visorbus_configure(struct controlvm_message *inmsg, goto err_respond;
if (parser_ctx) {drivers/staging/unisys/visorbus/visorchipset.c +1
-1- bus_info->partition_uuid =parser_id_get (parser_ctx); + const guid_t *partition_guid =
parser_id_get(parser_ctx);drivers/staging/unisys/visorbus/visorchipset.c +2
-0+ +guid_copy (&bus_info->partition_guid, partition_guid);
bus_info->name=parser_name_get(parser_ctx); }drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -781,7 +786,7 @@ visorbus_device_create(struct controlvm_message *inmsg)
dev_info->chipset_bus_no=bus_no;
dev_info->chipset_dev_no=dev_no;drivers/staging/unisys/visorbus/visorchipset.c +1
-1- dev_info->inst = cmd->create_device.dev_inst_uuid; + guid_copy(&dev_info->inst, &cmd-Quoted 1 line
create_device.dev_inst_guid);
/* not sure where the best place to set the 'parent' */dev_info->device.parent=&bus_info->device;drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -790,7 +795,7 @@ visorbus_device_create(struct controlvm_message *inmsg)visorchannel_create_with_lock(cmd-
Quoted 1 line
create_device.channel_addr,
cmd-
Quoted 1 line
create_device.channel_bytes,
GFP_KERNEL,
drivers/staging/unisys/visorbus/visorchipset.c +0
-1- cmd-Quoted 1 line
create_device.data_type_uuid);
drivers/staging/unisys/visorbus/visorchipset.c +1
-0+ &cmd-Quoted 1 line
create_device.data_type_guid);
if (!visorchannel) { dev_err(&chipset_dev->acpi_device->dev,drivers/staging/unisys/visorbus/visorchipset.c +2
-3@@ -800,9 +805,8 @@ visorbus_device_create(struct controlvm_message *inmsg) goto err_free_dev_info; } dev_info->visorchannel = visorchannel; - dev_info->channel_type_guid = cmd- >create_device.data_type_uuid; -if (uuid_le_cmp (cmd->create_device.data_type_uuid, - visor_vhba_channel_uuid) ==0 ) { +guid_copy (&dev_info->channel_type_guid, &cmd- >create_device.data_type_guid); + if (guid_equal(&cmd->create_device.data_type_guid,
&visor_vhba_channel_guid)) {
err =save_crash_message(inmsg, CRASH_DEV); if (err)
gotoerr_destroy_visorchannel;drivers/staging/unisys/visorbus/visorchipset.c +0
-1@@ -1817,7 +1821,6 @@ visorchipset_init(struct acpi_device *acpi_device) { int err = -ENODEV; u64 addr; -uuid_le uuid =VISOR_CONTROLVM_CHANNEL_UUID ; struct visorchannel *controlvm_channel;
chipset_dev=kzalloc(sizeof(*chipset_dev), GFP_KERNEL);drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -1832,9 +1835,9 @@ visorchipset_init(struct acpi_device *acpi_device)
chipset_dev->acpi_device=acpi_device;
chipset_dev->poll_jiffies=POLLJIFFIES_CONTROLVMCHANNEL_FAST;drivers/staging/unisys/visorbus/visorchipset.c +0
-2- controlvm_channel = visorchannel_create_with_lock(addr, - 0,
GFP_KERNEL, uuid);drivers/staging/unisys/visorbus/visorchipset.c +1
-0+ controlvm_channel = visorchannel_create_with_lock(addr, 0,
GFP_KERNEL,drivers/staging/unisys/visorbus/visorchipset.c +1
-0+ &visor_controlvm_chan
nel_guid);
if (!controlvm_channel)
gotoerror_free_chipset_dev;drivers/staging/unisys/visorbus/visorchipset.c +0
-0@@ -1845,8 +1848,12 @@ visorchipset_init(struct acpi_device *acpi_device) if (err < 0) goto error_destroy_channel;drivers/staging/unisys/visorbus/visorchipset.c +0
-2- if (!VISOR_CONTROLVM_CHANNEL_OK_CLIENT( - visorchannel_get_header(controlvm_channel)))
drivers/staging/unisys/visorbus/visorchipset.c +1
-0+ if(!visor_check_channel(visorchannel_get_header(controlvm_channel),
drivers/staging/unisys/visorbus/visorchipset.c +3
-0+ &visor_controlvm_channel_guid, + "controlvm", + sizeof(struct
visor_controlvm_channel),drivers/staging/unisys/visorbus/visorchipset.c +2
-0+ VISOR_CONTROLVM_CHANNEL_VERSIONID, + VISOR_CONTROLVM_CHANNEL_SIGNATURE))goto
error_delete_groups;
/* if booting in a crash kernel */drivers/staging/unisys/visorhba/visorhba_main.c +0
-0@@ -39,12 +39,12 @@ static struct visor_channeltype_descriptor visorhba_channel_types[] = { /* Note that the only channel type we expect to be reportedby the
* bus driver is theVISOR_VHBAchannel.
*/drivers/staging/unisys/visorhba/visorhba_main.c +2
-2- { VISOR_VHBA_CHANNEL_UUID, "sparvhba" }, - { NULL_UUID_LE, NULL } + { VISOR_VHBA_CHANNEL_GUID, "sparvhba" }, + {}};
MODULE_DEVICE_TABLE(visorbus,visorhba_channel_types);drivers/staging/unisys/visorhba/visorhba_main.c +1
-1-MODULE_ALIAS ("visorbus:" VISOR_VHBA_CHANNEL_UUID_STR ); +MODULE_ALIAS ("visorbus:" VISOR_VHBA_CHANNEL_GUID_STR );
structvisordisk_info{
u32 valid;drivers/staging/unisys/visorinput/visorinput.c +0
-0@@ -33,16 +33,16 @@ #include "ultrainputreport.h"
/* Keyboard channel {c73416d0-b0b8-44af-b304-9d2ae99f1b3d} */drivers/staging/unisys/visorinput/visorinput.c +0
-4-#define VISOR_KEYBOARD_CHANNEL_UUID \ - UUID_LE(0xc73416d0, 0xb0b8, 0x44af, \ - 0xb3, 0x4, 0x9d, 0x2a, 0xe9, 0x9f, 0x1b, 0x3d) -#define VISOR_KEYBOARD_CHANNEL_UUID_STR "c73416d0-b0b8-44af-b304-
9d2ae99f1b3d"drivers/staging/unisys/visorinput/visorinput.c +4
-0+#define VISOR_KEYBOARD_CHANNEL_GUID \ + GUID_INIT(0xc73416d0, 0xb0b8, 0x44af, \ + 0xb3, 0x4, 0x9d, 0x2a, 0xe9, 0x9f, 0x1b, 0x3d) +#define VISOR_KEYBOARD_CHANNEL_GUID_STR "c73416d0-b0b8-44af-b304-
9d2ae99f1b3d"
/* Mouse channel {addf07d4-94a9-46e2-81c3-61abcdbdbd87} */drivers/staging/unisys/visorinput/visorinput.c +0
-4-#define VISOR_MOUSE_CHANNEL_UUID \ - UUID_LE(0xaddf07d4, 0x94a9, 0x46e2, \ - 0x81, 0xc3, 0x61, 0xab, 0xcd, 0xbd, 0xbd, 0x87) -#define VISOR_MOUSE_CHANNEL_UUID_STR "addf07d4-94a9-46e2-81c3-
61abcdbdbd87"drivers/staging/unisys/visorinput/visorinput.c +4
-0+#define VISOR_MOUSE_CHANNEL_GUID \ + GUID_INIT(0xaddf07d4, 0x94a9, 0x46e2, \ + 0x81, 0xc3, 0x61, 0xab, 0xcd, 0xbd, 0xbd, 0x87) +#define VISOR_MOUSE_CHANNEL_GUID_STR "addf07d4-94a9-46e2-81c3-
61abcdbdbd87"
#definePIXELS_ACROSS_DEFAULT800
#define PIXELS_DOWN_DEFAULT 600drivers/staging/unisys/visorinput/visorinput.c +0
-0@@ -69,8 +69,8 @@ struct visorinput_devdata { unsigned char keycode_table[0]; };
-static constuuid_levisor_keyboard_channel_uuid=VISOR_KEYBOARD_CHANNEL_UUID;
-static constuuid_levisor_mouse_channel_uuid=VISOR_MOUSE_CHANNEL_UUID;
+static constguid_tvisor_keyboard_channel_guid=VISOR_KEYBOARD_CHANNEL_GUID;
+static constguid_tvisor_mouse_channel_guid=VISOR_MOUSE_CHANNEL_GUID;
/*
* Borrowed fromdrivers/input/keyboard/atakbd.cdrivers/staging/unisys/visorinput/visorinput.c +0
-0@@ -449,13 +449,13 @@ devdata_create(struct visor_device *dev, enum visorinput_device_type devtype)static int
visorinput_probe(structvisor_device*dev)
{drivers/staging/unisys/visorinput/visorinput.c +1
-1-uuid_le guid; +const guid_t *guid;enum
visorinput_device_typedevtype;drivers/staging/unisys/visorinput/visorinput.c +2
-2- guid =visorchannel_get_uuid (dev->visorchannel); -if (uuid_le_cmp (guid, visor_mouse_channel_uuid) ==0 ) + guid =visorchannel_get_guid (dev->visorchannel); +if (guid_equal (guid, &visor_mouse_channel_guid))devtype =
visorinput_mouse;drivers/staging/unisys/visorinput/visorinput.c +1
-1-else if (uuid_le_cmp (guid, visor_keyboard_channel_uuid) ==0 ) +else if (guid_equal (guid, &visor_keyboard_channel_guid))devtype =
visorinput_keyboard;
else
return-ENODEV;drivers/staging/unisys/visorinput/visorinput.c +0
-0@@ -727,9 +727,9 @@ visorinput_resume(struct visor_device *dev,
/* GUIDS for all channel types supported by this driver. */ static structvisor_channeltype_descriptorvisorinput_channel_types[] = {drivers/staging/unisys/visorinput/visorinput.c +3
-3- { VISOR_KEYBOARD_CHANNEL_UUID, "keyboard"}, - { VISOR_MOUSE_CHANNEL_UUID, "mouse"}, - { NULL_UUID_LE, NULL } + { VISOR_KEYBOARD_CHANNEL_GUID, "keyboard"}, + { VISOR_MOUSE_CHANNEL_GUID, "mouse"}, + {}};
static structvisor_drivervisorinput_driver= {drivers/staging/unisys/visorinput/visorinput.c +0
-0@@ -764,5 +764,5 @@ MODULE_AUTHOR("Unisys"); MODULE_LICENSE("GPL");MODULE_DESCRIPTION("s-Par human input driver for virtual keyboard/mouse");
drivers/staging/unisys/visorinput/visorinput.c +2
-2-MODULE_ALIAS ("visorbus:" VISOR_MOUSE_CHANNEL_UUID_STR ); -MODULE_ALIAS ("visorbus:" VISOR_KEYBOARD_CHANNEL_UUID_STR ); +MODULE_ALIAS ("visorbus:" VISOR_MOUSE_CHANNEL_GUID_STR ); +MODULE_ALIAS ("visorbus:" VISOR_KEYBOARD_CHANNEL_GUID_STR );drivers/staging/unisys/visornic/visornic_main.c +0
-0@@ -41,8 +41,8 @@ static struct visor_channeltype_descriptor visornic_channel_types[] = { /* Note that the only channel type we expect to be reportedby the
* bus driver is theVISOR_VNICchannel.
*/drivers/staging/unisys/visornic/visornic_main.c +2
-2- { VISOR_VNIC_CHANNEL_UUID, "ultravnic" }, - { NULL_UUID_LE, NULL } + { VISOR_VNIC_CHANNEL_GUID, "ultravnic" }, + {}};
MODULE_DEVICE_TABLE(visorbus,visornic_channel_types); /*drivers/staging/unisys/visornic/visornic_main.c +0
-0@@ -52,7 +52,7 @@ MODULE_DEVICE_TABLE(visorbus, visornic_channel_types); * must be added to scripts/mode/file2alias.c, etc., to get thisworking
* properly.
*/drivers/staging/unisys/visornic/visornic_main.c +1
-1-MODULE_ALIAS ("visorbus:" VISOR_VNIC_CHANNEL_UUID_STR ); +MODULE_ALIAS ("visorbus:" VISOR_VNIC_CHANNEL_GUID_STR );
struct chanstat {
unsigned longgot_rcv;
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Greg Kroah-Hartman
maintainerRe: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
Quoted 7 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Quoted 6 lines
Quoted 1 line
While here, re-indent couple of lines to increase readability.
This looks like no user space UUID API is involved, can be routed via either tree (uuid or staging).
Anyone to comment?
Doesn't apply to the staging tree at all :(
Re: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
Quoted 8 lines · Greg Kroah-Hartman
Quoted 7 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
While here, re-indent couple of lines to increase readability.
This looks like no user space UUID API is involved, can be routed via either tree (uuid or staging).
Anyone to comment?
Doesn't apply to the staging tree at all :(
No surprises, it was cooked against uuid tree in the first place. If you agree to take it through staging tree I will prepare a rebased version. Does it sound good?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Greg Kroah-Hartman
maintainerRe: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
Quoted 15 lines · Andy Shevchenko
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Andy Shevchenko
Quoted 7 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
While here, re-indent couple of lines to increase readability.
This looks like no user space UUID API is involved, can be routed via either tree (uuid or staging).
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Anyone to comment?
Doesn't apply to the staging tree at all :(
No surprises, it was cooked against uuid tree in the first place. If you agree to take it through staging tree I will prepare a rebased version. Does it sound good?
You can take it through the uuid tree if it's easier for you, but then someone will have to deal with the merge issues...
If it's easier, I can take it to prevent the merge problems.
thanks,
greg k-h
Andy Shevchenko
reviewerRe: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
Quoted 11 lines · Greg Kroah-Hartman
Quoted 9 lines · Andy Shevchenko
Quoted 1 line · Greg Kroah-Hartman
Doesn't apply to the staging tree at all :(
No surprises, it was cooked against uuid tree in the first place. If you agree to take it through staging tree I will prepare a rebased version.
Does it sound good?
Quoted 4 lines
You can take it through the uuid tree if it's easier for you, but then someone will have to deal with the merge issues...
If it's easier, I can take it to prevent the merge problems.
Yep! There are so many conflicts that would be better just to push through your tree.
I have just sent a v2 of this patch separately.
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Re: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
Quoted 4 lines · Andy Shevchenko
Yep! There are so many conflicts that would be better just to push through your tree.
I have just sent a v2 of this patch separately.
Greg, did you pick that patch up?
Andy Shevchenko
reviewerRe: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Andy Shevchenko
Yep! There are so many conflicts that would be better just to push through your tree.
I have just sent a v2 of this patch separately.
Greg, did you pick that patch up?
That patch in his tree.
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Greg Kroah-Hartman
maintainerRe: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
In reply to Christoph HellwigQuoted 7 lines · Christoph Hellwig
Quoted 4 lines · Andy Shevchenko
Yep! There are so many conflicts that would be better just to push through your tree.
I have just sent a v2 of this patch separately.
Greg, did you pick that patch up?
Yes, it's already in my tree and in linux-next.
thanks,
greg k-h
Andy Shevchenko
reviewerPATCH 4/6 vmbus: Switch to use new generic UUID API
In reply to Andy ShevchenkoThere are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
--- drivers/hv/channel.c | 4 +- drivers/hv/channel_mgmt.c | 18 ++++---- drivers/hv/hyperv_vmbus.h | 4 +- drivers/hv/vmbus_drv.c | 43 ++++++------------ include/linux/hyperv.h | 98 ++++++++++++++++++++--------------------- include/linux/mod_devicetable.h | 2 +- include/uapi/linux/hyperv.h | 6 +-- 7 files changed, 79 insertions(+), 96 deletions(-)
drivers/hv/channel.c +2 -2
@@ -225,8 +225,8 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,EXPORT_SYMBOL_GPL (vmbus_open);/* Used for Hyper-V Socket: a guest client's connect() to the host */ -int vmbus_send_tl_connect_request (const uuid_le *shv_guest_servie_id, -const uuid_le *shv_host_servie_id) +int vmbus_send_tl_connect_request (const guid_t *shv_guest_servie_id, +const guid_t *shv_host_servie_id) {struct vmbus_channel_tl_connect_request conn_msg;
drivers/hv/channel_mgmt.c +9 -9
@@ -141,7 +141,7 @@ static const struct vmbus_device vmbus_devs[] = { };static const struct { -uuid_le guid; +guid_t guid; } vmbus_unsupported_devs[] = { {HV_AVMA1_GUID }, {HV_AVMA2_GUID },
@@ -171,26 +171,26 @@ static void vmbus_rescind_cleanup(struct vmbus_channel *channel)spin_unlock_irqrestore (&vmbus_connection.channelmsg_lock, flags); } -static bool is_unsupported_vmbus_devs (const uuid_le *guid) +static bool is_unsupported_vmbus_devs (const guid_t *guid) {int i;for (i =0 ; i <ARRAY_SIZE (vmbus_unsupported_devs); i++) -if (!uuid_le_cmp (*guid, vmbus_unsupported_devs[i].guid)) +if (guid_equal (guid, &vmbus_unsupported_devs[i].guid))return true;return false; }static u16 hv_get_dev_type (const struct vmbus_channel *channel) { -const uuid_le *guid = &channel->offermsg.offer.if_type; +const guid_t *guid = &channel->offermsg.offer.if_type;u16 i;if (is_hvsock_channel (channel) ||is_unsupported_vmbus_devs (guid))return HV_UNKNOWN ;for (i =HV_IDE ; i <HV_UNKNOWN ; i++) { -if (!uuid_le_cmp (*guid, vmbus_devs[i].guid)) +if (guid_equal (guid, &vmbus_devs[i].guid))return i; }pr_info ("Unknown GUID: %pUl\n" , guid);
@@ -452,10 +452,10 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)mutex_lock (&vmbus_connection.channel_mutex);list_for_each_entry (channel, &vmbus_connection.chn_list, listentry) { -if (!uuid_le_cmp (channel->offermsg.offer.if_type, - newchannel->offermsg.offer.if_type) && - !uuid_le_cmp (channel->offermsg.offer.if_instance, - newchannel->offermsg.offer.if_instance)) { +if (guid_equal (&channel->offermsg.offer.if_type, + &newchannel->offermsg.offer.if_type) && +guid_equal (&channel->offermsg.offer.if_instance, + &newchannel->offermsg.offer.if_instance)) { fnew = false;break ; }
drivers/hv/hyperv_vmbus.h +2 -2
@@ -378,8 +378,8 @@ extern const struct vmbus_channel_message_table_entry/* General vmbus interface */ -struct hv_device *vmbus_device_create (const uuid_le *type, -const uuid_le *instance, +struct hv_device *vmbus_device_create (const guid_t *type, +const guid_t *instance,struct vmbus_channel *channel);int vmbus_device_register (struct hv_device *child_device_obj);
drivers/hv/vmbus_drv.c +14 -29
108 lines not on this page · raw message
include/linux/hyperv.h +49 -49
246 lines not on this page · raw message
include/linux/mod_devicetable.h +1 -1
@@ -405,7 +405,7 @@ struct virtio_device_id {* For Hyper-V devices we use the device guid as the id. */ struct hv_vmbus_device_id { -uuid_le guid; +guid_t guid;kernel_ulong_t driver_data;/* Data private to the driver */ };
include/uapi/linux/hyperv.h +2 -4
@@ -25,8 +25,6 @@#ifndef _UAPI_HYPERV_H#define _UAPI_HYPERV_H -#include <linux/uuid.h> -/* * Framework version for util services. */
@@ -118,8 +116,8 @@ enum hv_fcopy_op {struct hv_fcopy_hdr {__u32 operation; -uuid_le service_id0;/* currently unused */ -uuid_le service_id1;/* currently unused */ +__u8 service_id0[16 ];/* currently unused */ +__u8 service_id1[16 ];/* currently unused */ } __attribute__((packed));#define OVER_WRITE 0x1
Signature · 1 line
2.11.0
Haiyang Zhang
maintainerRE: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
Quoted 18 lines
-----Original Message-----
From: Andy Shevchenko [mailto:[email protected]]
Sent: Wednesday, July 19, 2017 2:29 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; Christoph Hellwig <[email protected]>; linux- [email protected]; Lukas Wunner <[email protected]>
Cc: Andy Shevchenko <[email protected]>; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Stephen Hemminger <[email protected]>
Subject: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
include/uapi/linux/hyperv.h enum hv_fcopy_op { · line 121
Quoted 8 lines
include/uapi/linux/hyperv.h +2
-2@@ -118,8 +116,8 @@ enum hv_fcopy_op {struct hv_fcopy_hdr {__u32 operation; -uuid_le service_id0;/* currently unused */ -uuid_le service_id1;/* currently unused */ +__u8 service_id0[16 ];/* currently unused */ +__u8 service_id1[16 ];/* currently unused */ } __attribute__((packed));
Even user space may not have all guid_t operations, could you still put guid_t here for consistency? This file is also used by our kernel mode code.
Thanks,
- Haiyang
Re: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
Quoted 10 lines · Haiyang Zhang
include/uapi/linux/hyperv.h enum hv_fcopy_op { · line 121
Quoted 7 lines
struct hv_fcopy_hdr { __u32 operation;include/uapi/linux/hyperv.h +2
-2-uuid_le service_id0;/* currently unused */ -uuid_le service_id1;/* currently unused */ +__u8 service_id0[16 ];/* currently unused */ +__u8 service_id1[16 ];/* currently unused */ } __attribute__((packed));Even user space may not have all
guid_toperations, could you still putguid_there for consistency?
I'm not sure how this code has been designed, though uuid_le followed by guid_t are kernel internal types mistakenly put to UAPI in the first place.
Consistency here is how we treat those types in user space, starting from v4.13 uuid_be gone from that header. uuid_le is luckily will be gone soon.
Quoted 2 lines
This file is also used by our kernel
mode code.
It will work still the same after this change.
Signature · 2 lines
With Best Regards, Andy Shevchenko
kbuild test robot
build botRe: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
In reply to Andy Shevchenkourl: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/uuid-Convert-rest-users-to-new-API/20170723-022330 config: i386-tinyconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0…
Hi Andy,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.13-rc1]
[cannot apply to next-20170721]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/uuid-Convert-rest-users-to-new-API/20170723-022330
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:
# save the attached .config to linux build tree
make ARCH=i386 Note: the linux-review/Andy-Shevchenko/uuid-Convert-rest-users-to-new-API/20170723-022330 HEAD f8d40b52dfac11e78d56509455812bcfe9962ce0 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
In file included from scripts//mod/file2alias.c:44:0:
scripts//mod/../../include/linux/mod_devicetable.h:408:2: error: unknown type name 'guid_t'
guid_t guid;
^~~~~~
scripts//mod/../../include/linux/mod_devicetable.h:638:2: error: unknown type name 'guid_t'
guid_t uuid;
^~~~~~
In file included from scripts//mod/file2alias.c:13:0:
scripts//mod/file2alias.c: In function 'do_vmbus_entry':
>> scripts//mod/file2alias.c:938:49: error: request for member 'b' in something not a structure or union
sprintf(&guid_name[i], "%02x", TO_NATIVE((guid->b)[i/2]));
^
scripts//mod/modpost.h:92:23: note: in definition of macro 'TO_NATIVE'
#define TO_NATIVE(x) (x)
^
scripts//mod/file2alias.c: In function 'do_mei_entry':
scripts//mod/file2alias.c:1233:18: error: incompatible type for argument 2 of 'add_uuid'
add_uuid(alias, *uuid);
^ scripts//mod/file2alias.c:137:20: note: expected 'uuid_le {aka struct <anonymous>}' but argument is of type 'int'
static inline void add_uuid(char *str, uuid_le uuid)
^~~~~~~~
vim +/b +938 scripts//mod/file2alias.c
b01d9f28 Rusty Russell 2007-10-22 923
d2ee52aa K. Y. Srinivasan 2011-08-25 924 /*
d2ee52aa K. Y. Srinivasan 2011-08-25 925 * Looks like: vmbus:guid
d2ee52aa K. Y. Srinivasan 2011-08-25 926 * Each byte of the guid will be represented by two hex characters
d2ee52aa K. Y. Srinivasan 2011-08-25 927 * in the name.
d2ee52aa K. Y. Srinivasan 2011-08-25 928 */
d2ee52aa K. Y. Srinivasan 2011-08-25 929
6543becf Andreas Schwab 2013-01-20 930 static int do_vmbus_entry(const char *filename, void *symval,
d2ee52aa K. Y. Srinivasan 2011-08-25 931 char *alias)
d2ee52aa K. Y. Srinivasan 2011-08-25 932 {
d2ee52aa K. Y. Srinivasan 2011-08-25 933 int i;
6543becf Andreas Schwab 2013-01-20 934 DEF_FIELD_ADDR(symval, hv_vmbus_device_id, guid);
6543becf Andreas Schwab 2013-01-20 935 char guid_name[(sizeof(*guid) + 1) * 2];
d2ee52aa K. Y. Srinivasan 2011-08-25 936
6543becf Andreas Schwab 2013-01-20 937 for (i = 0; i < (sizeof(*guid) * 2); i += 2)
af3ff643 K. Y. Srinivasan 2015-12-14 @938 sprintf(&guid_name[i], "%02x", TO_NATIVE((guid->b)[i/2]));
d2ee52aa K. Y. Srinivasan 2011-08-25 939
d2ee52aa K. Y. Srinivasan 2011-08-25 940 strcpy(alias, "vmbus:");
d2ee52aa K. Y. Srinivasan 2011-08-25 941 strcat(alias, guid_name);
d2ee52aa K. Y. Srinivasan 2011-08-25 942
d2ee52aa K. Y. Srinivasan 2011-08-25 943 return 1;
d2ee52aa K. Y. Srinivasan 2011-08-25 944 }
6543becf Andreas Schwab 2013-01-20 945 ADD_TO_DEVTABLE("vmbus", hv_vmbus_device_id, do_vmbus_entry);
d2ee52aa K. Y. Srinivasan 2011-08-25 946 :::::: The code at line 938 was first introduced by commit
:::::: af3ff643ea91ba64dd8d0b1cbed54d44512f96cd Drivers: hv: vmbus: Use uuid_le type consistently
:::::: TO: K. Y. Srinivasan <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
In reply to Andy ShevchenkoQuoted 4 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Can you split the uapi changes into a separate patch?
I'd love to kill the guid_le userspace exposure, but I'd also like to see how current userspace uses them. Obviously your change is not a break in the ABI, but it is a break in the API. I would prefer if we could not expose it, but I'd like to hear feedback from the consumers of these UAPI headers - the fields aren't used in kernel space at all, but userspace might be using it, and we'll need to look into alternatives for it.
Andy Shevchenko
reviewerPATCH 5/6 uuid: Kill uapi/uuid.h
In reply to Andy ShevchenkoThere is no more users for uapi/uuid.h. Remove it for good.
Anyone needs it in user space better to use libuuid.
--- include/linux/uuid.h | 20 +++++++++++++++++++- include/uapi/linux/uuid.h | 42 ------------------------------------------ scripts/mod/file2alias.c | 4 ++-- 3 files changed, 21 insertions(+), 45 deletions(-) delete mode 100644 include/uapi/linux/uuid.h
include/linux/uuid.h +19 -1
@@ -16,7 +16,19 @@#ifndef _LINUX_UUID_H_#define _LINUX_UUID_H_ -#include <uapi/linux/uuid.h> +#include <linux/types.h> +#include <linux/string.h> + +typedef struct { +__u8 b[16 ]; +}guid_t ; + +#define GUID_INIT (a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ +((guid_t) \ +{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ + (b) & 0xff, ((b) >> 8) & 0xff, \ + (c) & 0xff, ((c) >> 8) & 0xff, \ + (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})#define UUID_SIZE 16
@@ -84,12 +96,18 @@ int guid_parse(const char *uuid, guid_t *u);int uuid_parse (const char *uuid,uuid_t *u);/* backwards compatibility, don't use in new code */ +typedef guid_t uuid_le ;typedef uuid_t uuid_be ;#define UUID_BE (a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ UUID_INIT(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7) +#define UUID_LE (a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ + GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)#define NULL_UUID_BE \ UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00) +#define NULL_UUID_LE \ + UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00)#define uuid_le_gen (u) guid_gen(u)#define uuid_be_gen (u) uuid_gen(u)
include/uapi/linux/uuid.h deleted +0 -42
42 lines not on this page · raw message
scripts/mod/file2alias.c +2 -2
@@ -36,7 +36,7 @@ typedef uint16_t __u16;typedef unsigned char __u8 ;typedef struct {__u8 b[16 ]; -}uuid_le ; +}guid_t ;/* Big exception to the "don't include kernel headers into userspace, which * even potentially has different endianness and word sizes, since
@@ -134,7 +134,7 @@ static inline void add_wildcard(char *str)strcat (str + len,"*" ); } -static inline void add_uuid (char *str,uuid_le uuid) +static inline void add_uuid (char *str,guid_t uuid) {int len =strlen (str);
Signature · 1 line
2.11.0
kbuild test robot
build botRe: [PATCH v1 5/6] uuid: Kill uapi/uuid.h
url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/uuid-Convert-rest-users-to-new-API/20170723-022330 config: i386-tinyconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0…
Hi Andy,
[auto build test WARNING on linus/master]
[also build test WARNING on v4.13-rc1]
[cannot apply to next-20170721]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/uuid-Convert-rest-users-to-new-API/20170723-022330
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:
# save the attached .config to linux build tree
make ARCH=i386 All warnings (new ones prefixed by >>):
>> ./usr/include/linux/hyperv.h:71: found __[us]{8,16,32,64} type without #include <linux/types.h>
>> ./usr/include/linux/mei.h:93: found __[us]{8,16,32,64} type without #include <linux/types.h>---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH v1 5/6] uuid: Kill uapi/uuid.h
In reply to Andy ShevchenkoQuoted 14 lines
scripts/mod/file2alias.c +1
-1@@ -36,7 +36,7 @@ typedef uint16_t __u16;typedef unsigned char __u8 ;typedef struct {__u8 b[16 ]; -}uuid_le ; +}guid_t ;/* Big exception to the "don't include kernel headers into userspace, which * even potentially has different endianness and word sizes, since
scripts/mod/file2alias.c static inline void add_wildcard(char *str) · line 139
Quoted 7 lines
scripts/mod/file2alias.c +1
-1@@ -134,7 +134,7 @@ static inline void add_wildcard(char *str)strcat (str + len,"*" ); } -static inline void add_uuid (char *str,uuid_le uuid) +static inline void add_uuid (char *str,guid_t uuid) {int len =strlen (str);
This should probably be split into a separate patch.
Andy Shevchenko
reviewerPATCH 6/6 device property: Switch to use new generic UUID API
In reply to Andy ShevchenkoThere are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
--- drivers/acpi/property.c | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-)
drivers/acpi/property.c +25 -25
@@ -24,16 +24,14 @@ static int acpi_data_get_property_array(struct acpi_device_data *data,acpi_object_type type, const union acpi_object **obj); -/* ACPI _DSD device properties UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */ -static const u8 prp_uuid[16 ] = { -0x14 ,0xd8 ,0xff ,0xda ,0xba ,0x6e ,0x8c ,0x4d , -0x8a ,0x91 ,0xbc ,0x9b ,0xbf ,0x4a ,0xa3 ,0x01 -}; -/* ACPI _DSD data subnodes UUID: dbb8e3e6-5886-4ba6-8795-1319f52a966b */ -static const u8 ads_uuid[16 ] = { -0xe6 ,0xe3 ,0xb8 ,0xdb ,0x86 ,0x58 ,0xa6 ,0x4b , -0x87 ,0x95 ,0x13 ,0x19 ,0xf5 ,0x2a ,0x96 ,0x6b -}; +/* ACPI _DSD device properties GUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */ +static const guid_t prp_guid = +GUID_INIT (0xdaffd814 ,0x6eba ,0x4d8c , +0x8a ,0x91 ,0xbc ,0x9b ,0xbf ,0x4a ,0xa3 ,0x01 ); +/* ACPI _DSD data subnodes GUID: dbb8e3e6-5886-4ba6-8795-1319f52a966b */ +static const guid_t ads_guid = +GUID_INIT (0xdbb8e3e6 ,0x5886 ,0x4ba6 , +0x87 ,0x95 ,0x13 ,0x19 ,0xf5 ,0x2a ,0x96 ,0x6b ); static bool acpi_enumerate_nondev_subnodes(acpi_handle scope, const union acpi_object *desc,
@@ -190,22 +188,23 @@ static bool acpi_enumerate_nondev_subnodes(acpi_handle scope, {int i; -/* Look for the ACPI data subnodes UUID. */ +/* Look for the ACPI data subnodes GUID. */ for (i =0 ; i < desc->package.count; i +=2 ) { -const union acpi_object *uuid, *links; +const union acpi_object *guid, *links; - uuid = &desc->package.elements[i]; + guid = &desc->package.elements[i]; links = &desc->package.elements[i +1 ];/* -* The first element must be a UUID and the second one must be +* The first element must be a GUID and the second one must be * a package. */ -if (uuid->type !=ACPI_TYPE_BUFFER || uuid->buffer.length !=16 - || links->type !=ACPI_TYPE_PACKAGE ) +if (guid->type !=ACPI_TYPE_BUFFER || + guid->buffer.length !=16 || + links->type !=ACPI_TYPE_PACKAGE )break ; -if (memcmp (uuid->buffer.pointer, ads_uuid,sizeof (ads_uuid))) +if (!guid_equal ((guid_t *)guid->buffer.pointer, &ads_guid))continue ; return acpi_add_nondev_subnodes(scope, links, &data->subnodes,
@@ -298,26 +297,27 @@ static bool acpi_extract_properties(const union acpi_object *desc,if (desc->package.count %2 )return false; -/* Look for the device properties UUID. */ +/* Look for the device properties GUID. */ for (i =0 ; i < desc->package.count; i +=2 ) { -const union acpi_object *uuid, *properties; +const union acpi_object *guid, *properties; - uuid = &desc->package.elements[i]; + guid = &desc->package.elements[i]; properties = &desc->package.elements[i +1 ];/* -* The first element must be a UUID and the second one must be +* The first element must be a GUID and the second one must be * a package. */ -if (uuid->type !=ACPI_TYPE_BUFFER || uuid->buffer.length !=16 - || properties->type !=ACPI_TYPE_PACKAGE ) +if (guid->type !=ACPI_TYPE_BUFFER || + guid->buffer.length !=16 || + properties->type !=ACPI_TYPE_PACKAGE )break ; -if (memcmp (uuid->buffer.pointer, prp_uuid,sizeof (prp_uuid))) +if (!guid_equal ((guid_t *)guid->buffer.pointer, &prp_guid))continue ;/* -* We found the matching UUID. Now validate the format of the +* We found the matching GUID. Now validate the format of the * package immediately following it. */ if (!acpi_properties_format_valid (properties))
Signature · 1 line
2.11.0
Rafael J. Wysocki
maintainerRe: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Quoted 4 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Please talk to Mika about this one.
Thanks,
Rafael
Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
In reply to Andy ShevchenkoQuoted 7 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Cc "Rafael J. Wysocki" <[email protected]>Cc Mika Westerberg <[email protected]>
Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Quoted 10 lines · Mika Westerberg
Quoted 7 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Cc "Rafael J. Wysocki" <[email protected]>Cc Mika Westerberg <[email protected]>Acked-by Mika Westerberg <[email protected]>
OK
Andy, do you want me to apply this?
Thanks,
Rafael
Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Quoted 7 lines · Rafael J. Wysocki
Quoted 6 lines · Mika Westerberg
Quoted 5 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Cc "Rafael J. Wysocki" <[email protected]>Cc Mika Westerberg <[email protected]>Acked-by Mika Westerberg <[email protected]>OK
Andy, do you want me to apply this?
If you would like to.
The patch is now pretty independent since necessary stuff made v4.13-rc1.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Quoted 13 lines · Andy Shevchenko
Quoted 12 lines · Rafael J. Wysocki
Quoted 10 lines · Mika Westerberg
Quoted 7 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Cc "Rafael J. Wysocki" <[email protected]>Cc Mika Westerberg <[email protected]>Acked-by Mika Westerberg <[email protected]>
Quoted 7 lines
Quoted 3 lines
OK
Andy, do you want me to apply this?
If you would like to.
The patch is now pretty independent since necessary stuff made v4.13-rc1.
OK
Andy Shevchenko
reviewerRe: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Quoted 4 lines · Rafael J. Wysocki
Quoted 2 lines · Andy Shevchenko
On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <[email protected] t> wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Andy, do you want me to apply this?
If you would like to.
The patch is now pretty independent since necessary stuff made v4.13-rc1.
OK
Thanks!
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Quoted 7 lines · Andy Shevchenko
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Andy Shevchenko
Quoted 1 line · Rafael J. Wysocki
Andy, do you want me to apply this?
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
If you would like to.
The patch is now pretty independent since necessary stuff made v4.13-rc1.
OK
Thanks!
Applied now, thanks!
Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
In reply to Rafael J. WysockiQuoted 7 lines · Rafael J. Wysocki
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Cc "Rafael J. Wysocki" <[email protected]>Cc Mika Westerberg <[email protected]>Acked-by Mika Westerberg <[email protected]>OK
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Andy, do you want me to apply this?
If you would like to.
The patch is now pretty independent since necessary stuff made v4.13-rc1.
OK
This didn't seem to make it into linux-next so far, though.
Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Quoted 10 lines · CEST Christoph Hellwig
Quoted 9 lines · Rafael J. Wysocki
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Cc "Rafael J. Wysocki" <[email protected]>Cc Mika Westerberg <[email protected]>Acked-by Mika Westerberg <[email protected]>OK
Andy, do you want me to apply this?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
If you would like to.
The patch is now pretty independent since necessary stuff made v4.13-rc1.
OK
This didn't seem to make it into linux-next so far, though.
I have
3689d3d69072 ACPI: device property: Switch to use new generic UUID API
in my linux-next branch. Isn't it this one?
Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Quoted 3 lines · Rafael J. Wysocki
3689d3d69072ACPI: device property: Switch to use new generic UUID APIin my linux-next branch. Isn't it this one?
Yes, that should be it. Somehow my linux-next tree seems to be a mess through or my git log skills aren't what they used to be anymore.