* [PATCH v1 1/6] efi: Switch to use new generic UUID API
2017-07-19 18:28 [PATCH v1 0/6] uuid: Convert rest users to new API Andy Shevchenko
@ 2017-07-19 18:28 ` Andy Shevchenko
2017-07-20 12:18 ` Ard Biesheuvel
2017-08-30 12:41 ` Christoph Hellwig
2017-07-19 18:28 ` [PATCH v1 3/6] staging: unisys: " Andy Shevchenko
` (3 subsequent siblings)
4 siblings, 2 replies; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-19 18:28 UTC (permalink / raw)
To: linux-acpi, devel, sparmaintainer, devel, linux-wireless,
linux-watchdog, linux-efi, Christoph Hellwig, linux-kernel,
Lukas Wunner
Cc: Matt Fleming, Andy Shevchenko, Ard Biesheuvel
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 <matt@codeblueprint.co.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/firmware/efi/cper.c | 10 ++---
include/linux/cper.h | 94 ++++++++++++++++++++++-----------------------
include/linux/efi.h | 4 +-
3 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index 48a8f69da42a..684e65c11dde 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -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 *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->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 *gdata
cper_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);
diff --git a/include/linux/cper.h b/include/linux/cper.h
index 4c671fc2081e..723e952fde0d 100644
--- a/include/linux/cper.h
+++ b/include/linux/cper.h
@@ -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;
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 8269bcb8ccf7..7a322aed979f 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -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
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v1 1/6] efi: Switch to use new generic UUID API
2017-07-19 18:28 ` [PATCH v1 1/6] efi: Switch to use new generic UUID API Andy Shevchenko
@ 2017-07-20 12:18 ` Ard Biesheuvel
2017-07-25 10:40 ` Andy Shevchenko
2017-08-30 12:41 ` Christoph Hellwig
1 sibling, 1 reply; 37+ messages in thread
From: Ard Biesheuvel @ 2017-07-20 12:18 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-acpi@vger.kernel.org, devel, sparmaintainer, devel,
<linux-wireless@vger.kernel.org>, linux-watchdog,
linux-efi@vger.kernel.org, Christoph Hellwig,
linux-kernel@vger.kernel.org, Lukas Wunner, Matt Fleming
On 19 July 2017 at 19:28, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> 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 <matt@codeblueprint.co.uk>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> drivers/firmware/efi/cper.c | 10 ++---
> include/linux/cper.h | 94 ++++++++++++++++++++++-----------------------
> include/linux/efi.h | 4 +-
> 3 files changed, 54 insertions(+), 54 deletions(-)
>
> diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
> index 48a8f69da42a..684e65c11dde 100644
> --- a/drivers/firmware/efi/cper.c
> +++ b/drivers/firmware/efi/cper.c
> @@ -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 *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->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 *gdata
> cper_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);
> diff --git a/include/linux/cper.h b/include/linux/cper.h
> index 4c671fc2081e..723e952fde0d 100644
> --- a/include/linux/cper.h
> +++ b/include/linux/cper.h
> @@ -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;
> diff --git a/include/linux/efi.h b/include/linux/efi.h
> index 8269bcb8ccf7..7a322aed979f 100644
> --- a/include/linux/efi.h
> +++ b/include/linux/efi.h
> @@ -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
>
^ permalink raw reply [flat|nested] 37+ messages in thread* Re: [PATCH v1 1/6] efi: Switch to use new generic UUID API
2017-07-20 12:18 ` Ard Biesheuvel
@ 2017-07-25 10:40 ` Andy Shevchenko
[not found] ` <1500979206.29303.228.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
0 siblings, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-25 10:40 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: devel, linux-efi@vger.kernel.org, linux-watchdog, Matt Fleming,
sparmaintainer, <linux-wireless@vger.kernel.org>,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
Lukas Wunner, devel, Christoph Hellwig
On Thu, 2017-07-20 at 13:18 +0100, Ard Biesheuvel wrote:
> On 19 July 2017 at 19:28, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > 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 <matt@codeblueprint.co.uk>
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Thanks!
Christoph, can we apply this one at least to move things forward?
>
> > ---
> > drivers/firmware/efi/cper.c | 10 ++---
> > include/linux/cper.h | 94 ++++++++++++++++++++++----------
> > -------------
> > include/linux/efi.h | 4 +-
> > 3 files changed, 54 insertions(+), 54 deletions(-)
> >
> > diff --git a/drivers/firmware/efi/cper.c
> > b/drivers/firmware/efi/cper.c
> > index 48a8f69da42a..684e65c11dde 100644
> > --- a/drivers/firmware/efi/cper.c
> > +++ b/drivers/firmware/efi/cper.c
> > @@ -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 *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-
> > >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 *gdata
> > cper_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);
> > diff --git a/include/linux/cper.h b/include/linux/cper.h
> > index 4c671fc2081e..723e952fde0d 100644
> > --- a/include/linux/cper.h
> > +++ b/include/linux/cper.h
> > @@ -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;
> > diff --git a/include/linux/efi.h b/include/linux/efi.h
> > index 8269bcb8ccf7..7a322aed979f 100644
> > --- a/include/linux/efi.h
> > +++ b/include/linux/efi.h
> > @@ -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 <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 1/6] efi: Switch to use new generic UUID API
2017-07-19 18:28 ` [PATCH v1 1/6] efi: Switch to use new generic UUID API Andy Shevchenko
2017-07-20 12:18 ` Ard Biesheuvel
@ 2017-08-30 12:41 ` Christoph Hellwig
1 sibling, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2017-08-30 12:41 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-acpi, devel, sparmaintainer, devel, linux-wireless,
linux-watchdog, linux-efi, Christoph Hellwig, linux-kernel,
Lukas Wunner, Matt Fleming, Ard Biesheuvel
Thanks,
applied to the uuid for-next tree.
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
2017-07-19 18:28 [PATCH v1 0/6] uuid: Convert rest users to new API Andy Shevchenko
2017-07-19 18:28 ` [PATCH v1 1/6] efi: Switch to use new generic UUID API Andy Shevchenko
@ 2017-07-19 18:28 ` Andy Shevchenko
2017-07-26 10:01 ` Andy Shevchenko
2017-07-19 18:28 ` [PATCH v1 4/6] vmbus: " Andy Shevchenko
` (2 subsequent siblings)
4 siblings, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-19 18:28 UTC (permalink / raw)
To: linux-acpi, devel, sparmaintainer, devel, linux-wireless,
linux-watchdog, linux-efi, Christoph Hellwig, linux-kernel,
Lukas Wunner
Cc: Andy Shevchenko, David Kershner, Greg Kroah-Hartman
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.
Cc: David Kershner <david.kershner@unisys.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: sparmaintainer@unisys.com
Cc: devel@driverdev.osuosl.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
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(-)
diff --git a/drivers/staging/unisys/Documentation/overview.txt b/drivers/staging/unisys/Documentation/overview.txt
index e0466bfada2f..9ab30af265a5 100644
--- a/drivers/staging/unisys/Documentation/overview.txt
+++ b/drivers/staging/unisys/Documentation/overview.txt
@@ -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.:
diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h
index 692efcb38245..b09b1f55a6f1 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -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 */
- uuid_le chtype; /* Channel type: data, bus, control, etc. */
+ guid_t chtype; /* Channel type: data, bus, control, etc. */
u64 partition_handle; /* ID of guest partition */
u64 handle; /* Device number of this channel in client */
u64 ch_space_offset; /* Offset in bytes to channel specific area */
u32 version_id; /* struct channel_header Version ID */
u32 partition_index; /* Index of guest partition */
- 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)
@@ -205,25 +205,25 @@ struct signal_queue_header {
*/
static inline int
visor_check_channel(struct channel_header *ch,
- uuid_le expected_uuid,
+ const guid_t *expected_guid,
char *chname,
u64 expected_min_bytes,
u32 expected_version,
u64 expected_signature)
{
- if (uuid_le_cmp(expected_uuid, NULL_UUID_LE) != 0) {
+ if (!guid_is_null(expected_guid)) {
/* caller wants us to verify type GUID */
- 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",
- 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",
- chname, &expected_uuid,
+ chname, expected_guid,
(unsigned long long)expected_min_bytes,
ch->size);
return 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",
- chname, &expected_uuid,
+ chname, expected_guid,
(unsigned long)expected_version,
ch->version_id);
return 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",
- chname, &expected_uuid,
+ chname, expected_guid,
expected_signature, ch->signature);
return 0;
}
@@ -254,25 +254,22 @@ visor_check_channel(struct channel_header *ch,
*/
/* {414815ed-c58c-11da-95a9-00e08161165f} */
-#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;
-#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} */
-#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;
-#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} */
-#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)
#endif
diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h
index c7cb3fbde7b2..8f05bdd5197c 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -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
diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h
index de0635542fbd..38ce0878c55e 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -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,
diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h b/drivers/staging/unisys/visorbus/controlvmchannel.h
index ed045eff0e33..d9d7628aff50 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -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;
diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h b/drivers/staging/unisys/visorbus/vbuschannel.h
index 01d7d517dba7..8f256dbf7ad2 100644
--- a/drivers/staging/unisys/visorbus/vbuschannel.h
+++ b/drivers/staging/unisys/visorbus/vbuschannel.h
@@ -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
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1c785dd19ddd..dd932e39607b 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -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,
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h
index 98a5af19189d..0856179338df 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -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
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c
index 6885c2cb7135..fd64be952628 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -29,10 +29,10 @@
#define MYDRVNAME "visorchannel"
#define VISOR_CONSOLEVIDEO_CHANNEL_GUID \
- 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 const uuid_le visor_video_guid = VISOR_CONSOLEVIDEO_CHANNEL_GUID;
+static const guid_t visor_video_guid = VISOR_CONSOLEVIDEO_CHANNEL_GUID;
struct visorchannel {
u64 physaddr;
@@ -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_t insert_lock; /* protect head writes in chan_hdr */
spinlock_t remove_lock; /* protect tail writes in chan_hdr */
- uuid_le type;
- uuid_le inst;
+ guid_t type;
+ guid_t inst;
};
void
@@ -76,7 +76,7 @@ visorchannel_get_nbytes(struct visorchannel *channel)
}
char *
-visorchannel_uuid_id(uuid_le *guid, char *s)
+visorchannel_guid_id(const guid_t *guid, char *s)
{
sprintf(s, "%pUL", guid);
return s;
@@ -85,13 +85,13 @@ visorchannel_uuid_id(uuid_le *guid, char *s)
char *
visorchannel_id(struct visorchannel *channel, char *s)
{
- return visorchannel_uuid_id(&channel->guid, s);
+ return visorchannel_guid_id(&channel->guid, s);
}
char *
visorchannel_zoneid(struct visorchannel *channel, char *s)
{
- return visorchannel_uuid_id(&channel->chan_hdr.zone_uuid, s);
+ return visorchannel_guid_id(&channel->chan_hdr.zone_guid, s);
}
u64
@@ -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
*/
-uuid_le
-visorchannel_get_uuid(struct visorchannel *channel)
+const guid_t *
+visorchannel_get_guid(struct visorchannel *channel)
{
- return channel->guid;
+ return &channel->guid;
}
-EXPORT_SYMBOL_GPL(visorchannel_get_uuid);
+EXPORT_SYMBOL_GPL(visorchannel_get_guid);
int
visorchannel_read(struct visorchannel *channel, ulong offset,
@@ -376,7 +376,7 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg)
* back-end), in which case the actual channel size will 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 be
@@ -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,
- gfp_t gfp, uuid_le guid, bool needs_lock)
+ gfp_t gfp, const guid_t *guid, bool needs_lock)
{
struct visorchannel *channel;
int err;
@@ -415,7 +415,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long 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 */
goto err_destroy_channel;
@@ -436,8 +436,8 @@ visorchannel_create_guts(u64 physaddr, unsigned long 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)
@@ -445,7 +445,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long 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 */
goto err_destroy_channel;
@@ -457,7 +457,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
}
channel->nbytes = channel_bytes;
- channel->guid = guid;
+ guid_copy(&channel->guid, guid);
return channel;
err_destroy_channel:
@@ -467,7 +467,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
struct visorchannel *
visorchannel_create(u64 physaddr, unsigned long channel_bytes,
- gfp_t gfp, uuid_le guid)
+ gfp_t gfp, const guid_t *guid)
{
return visorchannel_create_guts(physaddr, channel_bytes, gfp, guid,
false);
@@ -475,7 +475,7 @@ visorchannel_create(u64 physaddr, unsigned long channel_bytes,
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)
{
return visorchannel_create_guts(physaddr, channel_bytes, gfp, guid,
true);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 22150564b4fb..5e2bb9b8fa1b 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -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 */
diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c
index a6e7a6bbc428..d0e84ca08a5a 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -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;
diff --git a/drivers/staging/unisys/visorinput/visorinput.c b/drivers/staging/unisys/visorinput/visorinput.c
index 45bc340d4e9d..fbf4957ffa15 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -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);
diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c
index 2891622eef18..10c1d036f996 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -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;
--
2.11.0
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
2017-07-19 18:28 ` [PATCH v1 3/6] staging: unisys: " Andy Shevchenko
@ 2017-07-26 10:01 ` Andy Shevchenko
2017-07-30 15:32 ` Greg Kroah-Hartman
0 siblings, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-26 10:01 UTC (permalink / raw)
To: linux-acpi, devel, sparmaintainer, devel, linux-wireless,
linux-watchdog, linux-efi, Christoph Hellwig, linux-kernel,
Lukas Wunner
Cc: David Kershner, Greg Kroah-Hartman
On Wed, 2017-07-19 at 21:28 +0300, Andy Shevchenko wrote:
> 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?
>
> Cc: David Kershner <david.kershner@unisys.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: sparmaintainer@unisys.com
> Cc: devel@driverdev.osuosl.org
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> 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(-)
>
> diff --git a/drivers/staging/unisys/Documentation/overview.txt
> b/drivers/staging/unisys/Documentation/overview.txt
> index e0466bfada2f..9ab30af265a5 100644
> --- a/drivers/staging/unisys/Documentation/overview.txt
> +++ b/drivers/staging/unisys/Documentation/overview.txt
> @@ -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.:
>
> diff --git a/drivers/staging/unisys/include/channel.h
> b/drivers/staging/unisys/include/channel.h
> index 692efcb38245..b09b1f55a6f1 100644
> --- a/drivers/staging/unisys/include/channel.h
> +++ b/drivers/staging/unisys/include/channel.h
> @@ -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 */
> - uuid_le chtype; /* Channel type: data, bus,
> control, etc. */
> + guid_t chtype; /* Channel type: data, bus,
> control, etc. */
> u64 partition_handle; /* ID of guest partition */
> u64 handle; /* Device number of this channel
> in client */
> u64 ch_space_offset; /* Offset in bytes to channel
> specific area */
> u32 version_id; /* struct channel_header
> Version ID */
> u32 partition_index; /* Index of guest partition */
> - 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)
> @@ -205,25 +205,25 @@ struct signal_queue_header {
> */
> static inline int
> visor_check_channel(struct channel_header *ch,
> - uuid_le expected_uuid,
> + const guid_t *expected_guid,
> char *chname,
> u64 expected_min_bytes,
> u32 expected_version,
> u64 expected_signature)
> {
> - if (uuid_le_cmp(expected_uuid, NULL_UUID_LE) != 0) {
> + if (!guid_is_null(expected_guid)) {
> /* caller wants us to verify type GUID */
> - 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",
> - 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",
> - chname, &expected_uuid,
> + chname, expected_guid,
> (unsigned long
> long)expected_min_bytes,
> ch->size);
> return 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",
> - chname, &expected_uuid,
> + chname, expected_guid,
> (unsigned long)expected_version,
> ch->version_id);
> return 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",
> - chname, &expected_uuid,
> + chname, expected_guid,
> expected_signature, ch->signature);
> return 0;
> }
> @@ -254,25 +254,22 @@ visor_check_channel(struct channel_header *ch,
> */
>
> /* {414815ed-c58c-11da-95a9-00e08161165f} */
> -#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;
> -#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} */
> -#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;
> -#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} */
> -#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)
>
> #endif
> diff --git a/drivers/staging/unisys/include/iochannel.h
> b/drivers/staging/unisys/include/iochannel.h
> index c7cb3fbde7b2..8f05bdd5197c 100644
> --- a/drivers/staging/unisys/include/iochannel.h
> +++ b/drivers/staging/unisys/include/iochannel.h
> @@ -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
> diff --git a/drivers/staging/unisys/include/visorbus.h
> b/drivers/staging/unisys/include/visorbus.h
> index de0635542fbd..38ce0878c55e 100644
> --- a/drivers/staging/unisys/include/visorbus.h
> +++ b/drivers/staging/unisys/include/visorbus.h
> @@ -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,
> diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h
> b/drivers/staging/unisys/visorbus/controlvmchannel.h
> index ed045eff0e33..d9d7628aff50 100644
> --- a/drivers/staging/unisys/visorbus/controlvmchannel.h
> +++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
> @@ -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;
> diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h
> b/drivers/staging/unisys/visorbus/vbuschannel.h
> index 01d7d517dba7..8f256dbf7ad2 100644
> --- a/drivers/staging/unisys/visorbus/vbuschannel.h
> +++ b/drivers/staging/unisys/visorbus/vbuschannel.h
> @@ -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
>
> diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c
> b/drivers/staging/unisys/visorbus/visorbus_main.c
> index 1c785dd19ddd..dd932e39607b 100644
> --- a/drivers/staging/unisys/visorbus/visorbus_main.c
> +++ b/drivers/staging/unisys/visorbus/visorbus_main.c
> @@ -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,
> diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h
> b/drivers/staging/unisys/visorbus/visorbus_private.h
> index 98a5af19189d..0856179338df 100644
> --- a/drivers/staging/unisys/visorbus/visorbus_private.h
> +++ b/drivers/staging/unisys/visorbus/visorbus_private.h
> @@ -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
> diff --git a/drivers/staging/unisys/visorbus/visorchannel.c
> b/drivers/staging/unisys/visorbus/visorchannel.c
> index 6885c2cb7135..fd64be952628 100644
> --- a/drivers/staging/unisys/visorbus/visorchannel.c
> +++ b/drivers/staging/unisys/visorbus/visorchannel.c
> @@ -29,10 +29,10 @@
> #define MYDRVNAME "visorchannel"
>
> #define VISOR_CONSOLEVIDEO_CHANNEL_GUID \
> - 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 const uuid_le visor_video_guid =
> VISOR_CONSOLEVIDEO_CHANNEL_GUID;
> +static const guid_t visor_video_guid =
> VISOR_CONSOLEVIDEO_CHANNEL_GUID;
>
> struct visorchannel {
> u64 physaddr;
> @@ -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_t insert_lock; /* protect head writes in chan_hdr */
> spinlock_t remove_lock; /* protect tail writes in
> chan_hdr */
>
> - uuid_le type;
> - uuid_le inst;
> + guid_t type;
> + guid_t inst;
> };
>
> void
> @@ -76,7 +76,7 @@ visorchannel_get_nbytes(struct visorchannel
> *channel)
> }
>
> char *
> -visorchannel_uuid_id(uuid_le *guid, char *s)
> +visorchannel_guid_id(const guid_t *guid, char *s)
> {
> sprintf(s, "%pUL", guid);
> return s;
> @@ -85,13 +85,13 @@ visorchannel_uuid_id(uuid_le *guid, char *s)
> char *
> visorchannel_id(struct visorchannel *channel, char *s)
> {
> - return visorchannel_uuid_id(&channel->guid, s);
> + return visorchannel_guid_id(&channel->guid, s);
> }
>
> char *
> visorchannel_zoneid(struct visorchannel *channel, char *s)
> {
> - return visorchannel_uuid_id(&channel->chan_hdr.zone_uuid, s);
> + return visorchannel_guid_id(&channel->chan_hdr.zone_guid, s);
> }
>
> u64
> @@ -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
> */
> -uuid_le
> -visorchannel_get_uuid(struct visorchannel *channel)
> +const guid_t *
> +visorchannel_get_guid(struct visorchannel *channel)
> {
> - return channel->guid;
> + return &channel->guid;
> }
> -EXPORT_SYMBOL_GPL(visorchannel_get_uuid);
> +EXPORT_SYMBOL_GPL(visorchannel_get_guid);
>
> int
> visorchannel_read(struct visorchannel *channel, ulong offset,
> @@ -376,7 +376,7 @@ signalinsert_inner(struct visorchannel *channel,
> u32 queue, void *msg)
> * back-end), in which case the actual channel size
> will 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 be
> @@ -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,
> - gfp_t gfp, uuid_le guid, bool needs_lock)
> + gfp_t gfp, const guid_t *guid, bool
> needs_lock)
> {
> struct visorchannel *channel;
> int err;
> @@ -415,7 +415,7 @@ visorchannel_create_guts(u64 physaddr, unsigned
> long 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 */
> goto err_destroy_channel;
>
> @@ -436,8 +436,8 @@ visorchannel_create_guts(u64 physaddr, unsigned
> long 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)
> @@ -445,7 +445,7 @@ visorchannel_create_guts(u64 physaddr, unsigned
> long 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 */
> goto err_destroy_channel;
>
> @@ -457,7 +457,7 @@ visorchannel_create_guts(u64 physaddr, unsigned
> long channel_bytes,
> }
>
> channel->nbytes = channel_bytes;
> - channel->guid = guid;
> + guid_copy(&channel->guid, guid);
> return channel;
>
> err_destroy_channel:
> @@ -467,7 +467,7 @@ visorchannel_create_guts(u64 physaddr, unsigned
> long channel_bytes,
>
> struct visorchannel *
> visorchannel_create(u64 physaddr, unsigned long channel_bytes,
> - gfp_t gfp, uuid_le guid)
> + gfp_t gfp, const guid_t *guid)
> {
> return visorchannel_create_guts(physaddr, channel_bytes, gfp,
> guid,
> false);
> @@ -475,7 +475,7 @@ visorchannel_create(u64 physaddr, unsigned long
> channel_bytes,
>
> 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)
> {
> return visorchannel_create_guts(physaddr, channel_bytes, gfp,
> guid,
> true);
> diff --git a/drivers/staging/unisys/visorbus/visorchipset.c
> b/drivers/staging/unisys/visorbus/visorchipset.c
> index 22150564b4fb..5e2bb9b8fa1b 100644
> --- a/drivers/staging/unisys/visorbus/visorchipset.c
> +++ b/drivers/staging/unisys/visorbus/visorchipset.c
> @@ -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_chan
> nel_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_cha
> nnel)))
> + 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 */
> diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c
> b/drivers/staging/unisys/visorhba/visorhba_main.c
> index a6e7a6bbc428..d0e84ca08a5a 100644
> --- a/drivers/staging/unisys/visorhba/visorhba_main.c
> +++ b/drivers/staging/unisys/visorhba/visorhba_main.c
> @@ -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;
> diff --git a/drivers/staging/unisys/visorinput/visorinput.c
> b/drivers/staging/unisys/visorinput/visorinput.c
> index 45bc340d4e9d..fbf4957ffa15 100644
> --- a/drivers/staging/unisys/visorinput/visorinput.c
> +++ b/drivers/staging/unisys/visorinput/visorinput.c
> @@ -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);
> diff --git a/drivers/staging/unisys/visornic/visornic_main.c
> b/drivers/staging/unisys/visornic/visornic_main.c
> index 2891622eef18..10c1d036f996 100644
> --- a/drivers/staging/unisys/visornic/visornic_main.c
> +++ b/drivers/staging/unisys/visornic/visornic_main.c
> @@ -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;
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 37+ messages in thread* Re: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
2017-07-26 10:01 ` Andy Shevchenko
@ 2017-07-30 15:32 ` Greg Kroah-Hartman
2017-07-30 17:26 ` Andy Shevchenko
0 siblings, 1 reply; 37+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-30 15:32 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-acpi, devel, sparmaintainer, devel, linux-wireless,
linux-watchdog, linux-efi, Christoph Hellwig, linux-kernel,
Lukas Wunner
On Wed, Jul 26, 2017 at 01:01:41PM +0300, Andy Shevchenko wrote:
> On Wed, 2017-07-19 at 21:28 +0300, Andy Shevchenko wrote:
> > 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?
Doesn't apply to the staging tree at all :(
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 3/6] staging: unisys: Switch to use new generic UUID API
2017-07-30 15:32 ` Greg Kroah-Hartman
@ 2017-07-30 17:26 ` Andy Shevchenko
[not found] ` <CAHp75Vf+Us5n2_u94sVGs7xuvfF-qoaG4tvmixvqRARo68TT7w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-30 17:26 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Andy Shevchenko, linux-acpi@vger.kernel.org, devel,
sparmaintainer, devel, open list:TI WILINK WIRELES...,
linux-watchdog, linux-efi, Christoph Hellwig,
linux-kernel@vger.kernel.org, Lukas Wunner
On Sun, Jul 30, 2017 at 6:32 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Wed, Jul 26, 2017 at 01:01:41PM +0300, Andy Shevchenko wrote:
>> On Wed, 2017-07-19 at 21:28 +0300, Andy Shevchenko wrote:
>> > 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?
>
> 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?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
2017-07-19 18:28 [PATCH v1 0/6] uuid: Convert rest users to new API Andy Shevchenko
2017-07-19 18:28 ` [PATCH v1 1/6] efi: Switch to use new generic UUID API Andy Shevchenko
2017-07-19 18:28 ` [PATCH v1 3/6] staging: unisys: " Andy Shevchenko
@ 2017-07-19 18:28 ` Andy Shevchenko
2017-07-19 20:18 ` Haiyang Zhang
` (2 more replies)
2017-07-19 18:28 ` [PATCH v1 5/6] uuid: Kill uapi/uuid.h Andy Shevchenko
[not found] ` <20170719182857.73693-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
4 siblings, 3 replies; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-19 18:28 UTC (permalink / raw)
To: linux-acpi, devel, sparmaintainer, devel, linux-wireless,
linux-watchdog, linux-efi, Christoph Hellwig, linux-kernel,
Lukas Wunner
Cc: Andy Shevchenko, K. Y. Srinivasan, Haiyang Zhang,
Stephen Hemminger
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: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: devel@linuxdriverproject.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
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(-)
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index e9bf0bb87ac4..ecc11df389e1 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -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;
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 4bbb8dea4727..28550e1e2cec 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -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;
}
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 1b6a5e0dfa75..e32a816a55d1 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -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);
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index ed84e96715a0..04e3acddebd4 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -535,21 +535,12 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
return ret;
}
-static const uuid_le null_guid;
-
-static inline bool is_null_guid(const uuid_le *guid)
-{
- if (uuid_le_cmp(*guid, null_guid))
- return false;
- return true;
-}
-
/*
* Return a matching hv_vmbus_device_id pointer.
* If there is no match, return NULL.
*/
static const struct hv_vmbus_device_id *hv_vmbus_get_id(struct hv_driver *drv,
- const uuid_le *guid)
+ const guid_t *guid)
{
const struct hv_vmbus_device_id *id = NULL;
struct vmbus_dynid *dynid;
@@ -557,7 +548,7 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id(struct hv_driver *drv,
/* Look at the dynamic ids first, before the static ones */
spin_lock(&drv->dynids.lock);
list_for_each_entry(dynid, &drv->dynids.list, node) {
- if (!uuid_le_cmp(dynid->id.guid, *guid)) {
+ if (guid_equal(&dynid->id.guid, guid)) {
id = &dynid->id;
break;
}
@@ -567,19 +558,15 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id(struct hv_driver *drv,
if (id)
return id;
- id = drv->id_table;
- if (id == NULL)
- return NULL; /* empty device table */
-
- for (; !is_null_guid(&id->guid); id++)
- if (!uuid_le_cmp(id->guid, *guid))
+ for (id = drv->id_table; id && !guid_is_null(&id->guid); id++)
+ if (guid_equal(&id->guid, guid))
return id;
return NULL;
}
/* vmbus_add_dynid - add a new device ID to this driver and re-probe devices */
-static int vmbus_add_dynid(struct hv_driver *drv, uuid_le *guid)
+static int vmbus_add_dynid(struct hv_driver *drv, guid_t *guid)
{
struct vmbus_dynid *dynid;
@@ -617,10 +604,10 @@ static ssize_t new_id_store(struct device_driver *driver, const char *buf,
size_t count)
{
struct hv_driver *drv = drv_to_hv_drv(driver);
- uuid_le guid;
+ guid_t guid;
ssize_t retval;
- retval = uuid_le_to_bin(buf, &guid);
+ retval = guid_parse(buf, &guid);
if (retval)
return retval;
@@ -644,10 +631,10 @@ static ssize_t remove_id_store(struct device_driver *driver, const char *buf,
{
struct hv_driver *drv = drv_to_hv_drv(driver);
struct vmbus_dynid *dynid, *n;
- uuid_le guid;
+ guid_t guid;
ssize_t retval;
- retval = uuid_le_to_bin(buf, &guid);
+ retval = guid_parse(buf, &guid);
if (retval)
return retval;
@@ -656,7 +643,7 @@ static ssize_t remove_id_store(struct device_driver *driver, const char *buf,
list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) {
struct hv_vmbus_device_id *id = &dynid->id;
- if (!uuid_le_cmp(id->guid, guid)) {
+ if (guid_equal(&id->guid, &guid)) {
list_del(&dynid->node);
kfree(dynid);
retval = count;
@@ -1135,8 +1122,8 @@ EXPORT_SYMBOL_GPL(vmbus_driver_unregister);
* vmbus_device_create - Creates and registers a new child device
* on the vmbus.
*/
-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)
{
struct hv_device *child_device_obj;
@@ -1148,12 +1135,10 @@ struct hv_device *vmbus_device_create(const uuid_le *type,
}
child_device_obj->channel = channel;
- memcpy(&child_device_obj->dev_type, type, sizeof(uuid_le));
- memcpy(&child_device_obj->dev_instance, instance,
- sizeof(uuid_le));
+ guid_copy(&child_device_obj->dev_type, type);
+ guid_copy(&child_device_obj->dev_instance, instance);
child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */
-
return child_device_obj;
}
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index b7d7bbec74e0..96c4e2f8ade3 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -232,8 +232,8 @@ static inline u32 hv_get_cached_bytes_to_write(
* struct contains the fundamental information about an offer.
*/
struct vmbus_channel_offer {
- uuid_le if_type;
- uuid_le if_instance;
+ guid_t if_type;
+ guid_t if_instance;
/*
* These two fields are not currently used.
@@ -617,8 +617,8 @@ struct vmbus_channel_initiate_contact {
/* Hyper-V socket: guest's connect()-ing to host */
struct vmbus_channel_tl_connect_request {
struct vmbus_channel_message_header header;
- uuid_le guest_endpoint_id;
- uuid_le host_service_id;
+ guid_t guest_endpoint_id;
+ guid_t host_service_id;
} __packed;
struct vmbus_channel_version_response {
@@ -716,7 +716,7 @@ enum vmbus_device_type {
struct vmbus_device {
u16 dev_type;
- uuid_le guid;
+ guid_t guid;
bool perf_device;
};
@@ -1107,7 +1107,7 @@ struct hv_driver {
bool hvsock;
/* the device type supported by this driver */
- uuid_le dev_type;
+ guid_t dev_type;
const struct hv_vmbus_device_id *id_table;
struct device_driver driver;
@@ -1127,10 +1127,10 @@ struct hv_driver {
/* Base device object */
struct hv_device {
/* the device type id of this device */
- uuid_le dev_type;
+ guid_t dev_type;
/* the device instance id of this device */
- uuid_le dev_instance;
+ guid_t dev_instance;
u16 vendor_id;
u16 device_id;
@@ -1198,102 +1198,102 @@ u64 hv_do_hypercall(u64 control, void *input, void *output);
* {f8615163-df3e-46c5-913f-f2d2f965ed0e}
*/
#define HV_NIC_GUID \
- .guid = UUID_LE(0xf8615163, 0xdf3e, 0x46c5, 0x91, 0x3f, \
- 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e)
+ .guid = GUID_INIT(0xf8615163, 0xdf3e, 0x46c5, 0x91, 0x3f, \
+ 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e)
/*
* IDE GUID
* {32412632-86cb-44a2-9b5c-50d1417354f5}
*/
#define HV_IDE_GUID \
- .guid = UUID_LE(0x32412632, 0x86cb, 0x44a2, 0x9b, 0x5c, \
- 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5)
+ .guid = GUID_INIT(0x32412632, 0x86cb, 0x44a2, 0x9b, 0x5c, \
+ 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5)
/*
* SCSI GUID
* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}
*/
#define HV_SCSI_GUID \
- .guid = UUID_LE(0xba6163d9, 0x04a1, 0x4d29, 0xb6, 0x05, \
- 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f)
+ .guid = GUID_INIT(0xba6163d9, 0x04a1, 0x4d29, 0xb6, 0x05, \
+ 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f)
/*
* Shutdown GUID
* {0e0b6031-5213-4934-818b-38d90ced39db}
*/
#define HV_SHUTDOWN_GUID \
- .guid = UUID_LE(0x0e0b6031, 0x5213, 0x4934, 0x81, 0x8b, \
- 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb)
+ .guid = GUID_INIT(0x0e0b6031, 0x5213, 0x4934, 0x81, 0x8b, \
+ 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb)
/*
* Time Synch GUID
* {9527E630-D0AE-497b-ADCE-E80AB0175CAF}
*/
#define HV_TS_GUID \
- .guid = UUID_LE(0x9527e630, 0xd0ae, 0x497b, 0xad, 0xce, \
- 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf)
+ .guid = GUID_INIT(0x9527e630, 0xd0ae, 0x497b, 0xad, 0xce, \
+ 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf)
/*
* Heartbeat GUID
* {57164f39-9115-4e78-ab55-382f3bd5422d}
*/
#define HV_HEART_BEAT_GUID \
- .guid = UUID_LE(0x57164f39, 0x9115, 0x4e78, 0xab, 0x55, \
- 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d)
+ .guid = GUID_INIT(0x57164f39, 0x9115, 0x4e78, 0xab, 0x55, \
+ 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d)
/*
* KVP GUID
* {a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}
*/
#define HV_KVP_GUID \
- .guid = UUID_LE(0xa9a0f4e7, 0x5a45, 0x4d96, 0xb8, 0x27, \
- 0x8a, 0x84, 0x1e, 0x8c, 0x03, 0xe6)
+ .guid = GUID_INIT(0xa9a0f4e7, 0x5a45, 0x4d96, 0xb8, 0x27, \
+ 0x8a, 0x84, 0x1e, 0x8c, 0x03, 0xe6)
/*
* Dynamic memory GUID
* {525074dc-8985-46e2-8057-a307dc18a502}
*/
#define HV_DM_GUID \
- .guid = UUID_LE(0x525074dc, 0x8985, 0x46e2, 0x80, 0x57, \
- 0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02)
+ .guid = GUID_INIT(0x525074dc, 0x8985, 0x46e2, 0x80, 0x57, \
+ 0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02)
/*
* Mouse GUID
* {cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}
*/
#define HV_MOUSE_GUID \
- .guid = UUID_LE(0xcfa8b69e, 0x5b4a, 0x4cc0, 0xb9, 0x8b, \
- 0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a)
+ .guid = GUID_INIT(0xcfa8b69e, 0x5b4a, 0x4cc0, 0xb9, 0x8b, \
+ 0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a)
/*
* Keyboard GUID
* {f912ad6d-2b17-48ea-bd65-f927a61c7684}
*/
#define HV_KBD_GUID \
- .guid = UUID_LE(0xf912ad6d, 0x2b17, 0x48ea, 0xbd, 0x65, \
- 0xf9, 0x27, 0xa6, 0x1c, 0x76, 0x84)
+ .guid = GUID_INIT(0xf912ad6d, 0x2b17, 0x48ea, 0xbd, 0x65, \
+ 0xf9, 0x27, 0xa6, 0x1c, 0x76, 0x84)
/*
* VSS (Backup/Restore) GUID
*/
#define HV_VSS_GUID \
- .guid = UUID_LE(0x35fa2e29, 0xea23, 0x4236, 0x96, 0xae, \
- 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40)
+ .guid = GUID_INIT(0x35fa2e29, 0xea23, 0x4236, 0x96, 0xae, \
+ 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40)
/*
* Synthetic Video GUID
* {DA0A7802-E377-4aac-8E77-0558EB1073F8}
*/
#define HV_SYNTHVID_GUID \
- .guid = UUID_LE(0xda0a7802, 0xe377, 0x4aac, 0x8e, 0x77, \
- 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8)
+ .guid = GUID_INIT(0xda0a7802, 0xe377, 0x4aac, 0x8e, 0x77, \
+ 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8)
/*
* Synthetic FC GUID
* {2f9bcc4a-0069-4af3-b76b-6fd0be528cda}
*/
#define HV_SYNTHFC_GUID \
- .guid = UUID_LE(0x2f9bcc4a, 0x0069, 0x4af3, 0xb7, 0x6b, \
- 0x6f, 0xd0, 0xbe, 0x52, 0x8c, 0xda)
+ .guid = GUID_INIT(0x2f9bcc4a, 0x0069, 0x4af3, 0xb7, 0x6b, \
+ 0x6f, 0xd0, 0xbe, 0x52, 0x8c, 0xda)
/*
* Guest File Copy Service
@@ -1301,16 +1301,16 @@ u64 hv_do_hypercall(u64 control, void *input, void *output);
*/
#define HV_FCOPY_GUID \
- .guid = UUID_LE(0x34d14be3, 0xdee4, 0x41c8, 0x9a, 0xe7, \
- 0x6b, 0x17, 0x49, 0x77, 0xc1, 0x92)
+ .guid = GUID_INIT(0x34d14be3, 0xdee4, 0x41c8, 0x9a, 0xe7, \
+ 0x6b, 0x17, 0x49, 0x77, 0xc1, 0x92)
/*
* NetworkDirect. This is the guest RDMA service.
* {8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}
*/
#define HV_ND_GUID \
- .guid = UUID_LE(0x8c2eaf3d, 0x32a7, 0x4b09, 0xab, 0x99, \
- 0xbd, 0x1f, 0x1c, 0x86, 0xb5, 0x01)
+ .guid = GUID_INIT(0x8c2eaf3d, 0x32a7, 0x4b09, 0xab, 0x99, \
+ 0xbd, 0x1f, 0x1c, 0x86, 0xb5, 0x01)
/*
* PCI Express Pass Through
@@ -1318,8 +1318,8 @@ u64 hv_do_hypercall(u64 control, void *input, void *output);
*/
#define HV_PCIE_GUID \
- .guid = UUID_LE(0x44c4f61d, 0x4444, 0x4400, 0x9d, 0x52, \
- 0x80, 0x2e, 0x27, 0xed, 0xe1, 0x9f)
+ .guid = GUID_INIT(0x44c4f61d, 0x4444, 0x4400, 0x9d, 0x52, \
+ 0x80, 0x2e, 0x27, 0xed, 0xe1, 0x9f)
/*
* Linux doesn't support the 3 devices: the first two are for
@@ -1331,16 +1331,16 @@ u64 hv_do_hypercall(u64 control, void *input, void *output);
*/
#define HV_AVMA1_GUID \
- .guid = UUID_LE(0xf8e65716, 0x3cb3, 0x4a06, 0x9a, 0x60, \
- 0x18, 0x89, 0xc5, 0xcc, 0xca, 0xb5)
+ .guid = GUID_INIT(0xf8e65716, 0x3cb3, 0x4a06, 0x9a, 0x60, \
+ 0x18, 0x89, 0xc5, 0xcc, 0xca, 0xb5)
#define HV_AVMA2_GUID \
- .guid = UUID_LE(0x3375baf4, 0x9e15, 0x4b30, 0xb7, 0x65, \
- 0x67, 0xac, 0xb1, 0x0d, 0x60, 0x7b)
+ .guid = GUID_INIT(0x3375baf4, 0x9e15, 0x4b30, 0xb7, 0x65, \
+ 0x67, 0xac, 0xb1, 0x0d, 0x60, 0x7b)
#define HV_RDV_GUID \
- .guid = UUID_LE(0x276aacf4, 0xac15, 0x426c, 0x98, 0xdd, \
- 0x75, 0x21, 0xad, 0x3f, 0x01, 0xfe)
+ .guid = GUID_INIT(0x276aacf4, 0xac15, 0x426c, 0x98, 0xdd, \
+ 0x75, 0x21, 0xad, 0x3f, 0x01, 0xfe)
/*
* Common header for Hyper-V ICs
@@ -1442,7 +1442,7 @@ struct ictimesync_ref_data {
struct hyperv_service_callback {
u8 msg_type;
char *log_msg;
- uuid_le data;
+ guid_t data;
struct vmbus_channel *channel;
void (*callback)(void *context);
};
@@ -1462,8 +1462,8 @@ void vmbus_setevent(struct vmbus_channel *channel);
extern __u32 vmbus_proto_version;
-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);
void vmbus_set_event(struct vmbus_channel *channel);
/* Get the start of the ring buffer. */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 13b403b8cec4..c36d274b7c91 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -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 */
};
diff --git a/include/uapi/linux/hyperv.h b/include/uapi/linux/hyperv.h
index e347b24ef9fb..7560c0aa60e3 100644
--- a/include/uapi/linux/hyperv.h
+++ b/include/uapi/linux/hyperv.h
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 37+ messages in thread* RE: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
2017-07-19 18:28 ` [PATCH v1 4/6] vmbus: " Andy Shevchenko
@ 2017-07-19 20:18 ` Haiyang Zhang
2017-07-19 21:54 ` Andy Shevchenko
2017-07-22 18:46 ` kbuild test robot
[not found] ` <20170719182857.73693-5-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2 siblings, 1 reply; 37+ messages in thread
From: Haiyang Zhang @ 2017-07-19 20:18 UTC (permalink / raw)
To: Andy Shevchenko, linux-acpi@vger.kernel.org,
devel@linuxdriverproject.org, sparmaintainer@unisys.com,
devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
linux-watchdog@vger.kernel.org, linux-efi@vger.kernel.org,
Christoph Hellwig, linux-kernel@vger.kernel.org, Lukas Wunner
Cc: KY Srinivasan, Stephen Hemminger
> -----Original Message-----
> From: Andy Shevchenko [mailto:andriy.shevchenko@linux.intel.com]
> Sent: Wednesday, July 19, 2017 2:29 PM
> To: linux-acpi@vger.kernel.org; devel@linuxdriverproject.org;
> sparmaintainer@unisys.com; devel@driverdev.osuosl.org; linux-
> wireless@vger.kernel.org; linux-watchdog@vger.kernel.org; linux-
> efi@vger.kernel.org; Christoph Hellwig <hch@lst.de>; linux-
> kernel@vger.kernel.org; Lukas Wunner <lukas@wunner.de>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>; KY Srinivasan
> <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Stephen
> Hemminger <sthemmin@microsoft.com>
> Subject: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
>
> @@ -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
^ permalink raw reply [flat|nested] 37+ messages in thread* Re: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
2017-07-19 20:18 ` Haiyang Zhang
@ 2017-07-19 21:54 ` Andy Shevchenko
0 siblings, 0 replies; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-19 21:54 UTC (permalink / raw)
To: Haiyang Zhang
Cc: Andy Shevchenko, linux-acpi@vger.kernel.org,
devel@linuxdriverproject.org, sparmaintainer@unisys.com,
devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
linux-watchdog@vger.kernel.org, linux-efi@vger.kernel.org,
Christoph Hellwig, linux-kernel@vger.kernel.org, Lukas Wunner,
KY Srinivasan, Stephen Hemminger
On Wed, Jul 19, 2017 at 11:18 PM, Haiyang Zhang <haiyangz@microsoft.com> wrote:
>> 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?
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.
> This file is also used by our kernel
> mode code.
It will work still the same after this change.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
2017-07-19 18:28 ` [PATCH v1 4/6] vmbus: " Andy Shevchenko
2017-07-19 20:18 ` Haiyang Zhang
@ 2017-07-22 18:46 ` kbuild test robot
[not found] ` <20170719182857.73693-5-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2 siblings, 0 replies; 37+ messages in thread
From: kbuild test robot @ 2017-07-22 18:46 UTC (permalink / raw)
Cc: kbuild-all, linux-acpi, devel, sparmaintainer, devel,
linux-wireless, linux-watchdog, linux-efi, Christoph Hellwig,
linux-kernel, Lukas Wunner, Andy Shevchenko, K. Y. Srinivasan,
Haiyang Zhang, Stephen Hemminger
[-- Attachment #1: Type: text/plain, Size: 3972 bytes --]
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 <kys@microsoft.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6684 bytes --]
^ permalink raw reply [flat|nested] 37+ messages in thread[parent not found: <20170719182857.73693-5-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* Re: [PATCH v1 4/6] vmbus: Switch to use new generic UUID API
[not found] ` <20170719182857.73693-5-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2017-07-24 15:54 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2017-07-24 15:54 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-acpi-u79uwXL29TY76Z2rM5mHXA,
devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X,
sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA, Christoph Hellwig,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lukas Wunner,
K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger
On Wed, Jul 19, 2017 at 09:28:55PM +0300, Andy Shevchenko wrote:
> 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.
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v1 5/6] uuid: Kill uapi/uuid.h
2017-07-19 18:28 [PATCH v1 0/6] uuid: Convert rest users to new API Andy Shevchenko
` (2 preceding siblings ...)
2017-07-19 18:28 ` [PATCH v1 4/6] vmbus: " Andy Shevchenko
@ 2017-07-19 18:28 ` Andy Shevchenko
[not found] ` <20170719182857.73693-6-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
[not found] ` <20170719182857.73693-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
4 siblings, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-19 18:28 UTC (permalink / raw)
To: linux-acpi, devel, sparmaintainer, devel, linux-wireless,
linux-watchdog, linux-efi, Christoph Hellwig, linux-kernel,
Lukas Wunner
Cc: Andy Shevchenko
There is no more users for uapi/uuid.h. Remove it for good.
Anyone needs it in user space better to use libuuid.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
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
diff --git a/include/linux/uuid.h b/include/linux/uuid.h
index 2251e1925ea4..3bc3e88c9fbd 100644
--- a/include/linux/uuid.h
+++ b/include/linux/uuid.h
@@ -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)
diff --git a/include/uapi/linux/uuid.h b/include/uapi/linux/uuid.h
deleted file mode 100644
index 8ef82f433877..000000000000
--- a/include/uapi/linux/uuid.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * UUID/GUID definition
- *
- * Copyright (C) 2010, Intel Corp.
- * Huang Ying <ying.huang@intel.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef _UAPI_LINUX_UUID_H_
-#define _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) }})
-
-/* backwards compatibility, don't use in new code */
-typedef guid_t uuid_le;
-#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_LE \
- UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00)
-
-#endif /* _UAPI_LINUX_UUID_H_ */
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 29d6699d5a06..1c68709123aa 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -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);
--
2.11.0
^ permalink raw reply related [flat|nested] 37+ messages in thread[parent not found: <20170719182857.73693-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* [PATCH v1 2/6] mei: Switch to use new generic UUID API
[not found] ` <20170719182857.73693-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2017-07-19 18:28 ` Andy Shevchenko
[not found] ` <20170719182857.73693-3-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-19 18:28 ` [PATCH v1 6/6] device property: " Andy Shevchenko
1 sibling, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-19 18:28 UTC (permalink / raw)
To: linux-acpi-u79uwXL29TY76Z2rM5mHXA,
devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X,
sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA, Christoph Hellwig,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lukas Wunner
Cc: Andy Shevchenko, Tomas Winkler, Guenter Roeck, Samuel Ortiz
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: Tomas Winkler <tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Cc: Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
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(-)
diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c
index 0208c4b027c5..9eaac4f2d427 100644
--- a/drivers/misc/mei/bus-fixup.c
+++ b/drivers/misc/mei/bus-fixup.c
@@ -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);
}
}
-
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 40c79089e548..c5165f2ec842 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -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))
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index be64969d986a..a44fb96452a9 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -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;
diff --git a/drivers/misc/mei/client.h b/drivers/misc/mei/client.h
index 5371df4d8af3..5d996e1e39fa 100644
--- a/drivers/misc/mei/client.h
+++ b/drivers/misc/mei/client.h
@@ -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);
}
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index fe6595fe94f1..059b8dfef67b 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -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);
diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h
index 5c8286b40b62..e061f449ea75 100644
--- a/drivers/misc/mei/hw.h
+++ b/drivers/misc/mei/hw.h
@@ -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;
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index e825f013e54e..be576c625f9f 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -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);
diff --git a/drivers/nfc/mei_phy.h b/drivers/nfc/mei_phy.h
index acd3a1fc69e6..bf4775a111e8 100644
--- a/drivers/nfc/mei_phy.h
+++ b/drivers/nfc/mei_phy.h
@@ -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
diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
index b29c6fde7473..a0f052a96913 100644
--- a/drivers/watchdog/mei_wdt.c
+++ b/drivers/watchdog/mei_wdt.c
@@ -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 },
diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h
index a0d274fe08f1..81a860bfd076 100644
--- a/include/linux/mei_cl_bus.h
+++ b/include/linux/mei_cl_bus.h
@@ -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);
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 3f74ef2281e8..13b403b8cec4 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -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;
};
diff --git a/include/uapi/linux/mei.h b/include/uapi/linux/mei.h
index 7c3b64f6a215..cf02d56a13e6 100644
--- a/include/uapi/linux/mei.h
+++ b/include/uapi/linux/mei.h
@@ -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;
};
};
diff --git a/samples/mei/mei-amt-version.c b/samples/mei/mei-amt-version.c
index 57d0d871dcf7..26d85860c838 100644
--- a/samples/mei/mei-amt-version.c
+++ b/samples/mei/mei-amt-version.c
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 37+ messages in thread* [PATCH v1 6/6] device property: Switch to use new generic UUID API
[not found] ` <20170719182857.73693-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-19 18:28 ` [PATCH v1 2/6] mei: Switch to use new generic UUID API Andy Shevchenko
@ 2017-07-19 18:28 ` Andy Shevchenko
[not found] ` <20170719182857.73693-7-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-25 14:12 ` Mika Westerberg
1 sibling, 2 replies; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-19 18:28 UTC (permalink / raw)
To: linux-acpi-u79uwXL29TY76Z2rM5mHXA,
devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X,
sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA, Christoph Hellwig,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lukas Wunner
Cc: Andy Shevchenko, Rafael J. Wysocki, Mika Westerberg
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" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>
Cc: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
drivers/acpi/property.c | 50 ++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 917c789f953d..a7fdbe083a7e 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -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))
--
2.11.0
^ permalink raw reply related [flat|nested] 37+ messages in thread[parent not found: <20170719182857.73693-7-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
[not found] ` <20170719182857.73693-7-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2017-07-19 19:27 ` Rafael J. Wysocki
0 siblings, 0 replies; 37+ messages in thread
From: Rafael J. Wysocki @ 2017-07-19 19:27 UTC (permalink / raw)
To: Andy Shevchenko
Cc: ACPI Devel Maling List, devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X,
sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
open list:NETWORKING DRIVERS (WIRELESS),
linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-efi-u79uwXL29TY76Z2rM5mHXA, Christoph Hellwig,
Linux Kernel Mailing List, Lukas Wunner, Rafael J. Wysocki,
Mika Westerberg
On Wed, Jul 19, 2017 at 8:28 PM, Andy Shevchenko
<andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote:
> 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
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-07-19 18:28 ` [PATCH v1 6/6] device property: " Andy Shevchenko
[not found] ` <20170719182857.73693-7-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2017-07-25 14:12 ` Mika Westerberg
2017-07-26 0:21 ` Rafael J. Wysocki
1 sibling, 1 reply; 37+ messages in thread
From: Mika Westerberg @ 2017-07-25 14:12 UTC (permalink / raw)
To: Andy Shevchenko
Cc: devel, linux-efi, linux-watchdog, Rafael J. Wysocki,
sparmaintainer, linux-wireless, linux-kernel, linux-acpi,
Lukas Wunner, devel, Christoph Hellwig
On Wed, Jul 19, 2017 at 09:28:57PM +0300, Andy Shevchenko wrote:
> 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" <rjw@rjwysocki.net>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
^ permalink raw reply [flat|nested] 37+ messages in thread* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-07-25 14:12 ` Mika Westerberg
@ 2017-07-26 0:21 ` Rafael J. Wysocki
2017-07-26 0:35 ` Andy Shevchenko
0 siblings, 1 reply; 37+ messages in thread
From: Rafael J. Wysocki @ 2017-07-26 0:21 UTC (permalink / raw)
To: Mika Westerberg, Andy Shevchenko
Cc: linux-acpi, devel, sparmaintainer, devel, linux-wireless,
linux-watchdog, linux-efi, Christoph Hellwig, linux-kernel,
Lukas Wunner
On Tuesday, July 25, 2017 05:12:35 PM Mika Westerberg wrote:
> On Wed, Jul 19, 2017 at 09:28:57PM +0300, Andy Shevchenko wrote:
> > 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" <rjw@rjwysocki.net>
> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
OK
Andy, do you want me to apply this?
Thanks,
Rafael
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-07-26 0:21 ` Rafael J. Wysocki
@ 2017-07-26 0:35 ` Andy Shevchenko
2017-07-26 0:27 ` Rafael J. Wysocki
0 siblings, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-26 0:35 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: devel, linux-efi, linux-watchdog, sparmaintainer,
open list:TI WILINK WIRELES..., linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, Lukas Wunner, devel, Andy Shevchenko,
Mika Westerberg, Christoph Hellwig
On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Tuesday, July 25, 2017 05:12:35 PM Mika Westerberg wrote:
>> On Wed, Jul 19, 2017 at 09:28:57PM +0300, Andy Shevchenko wrote:
>> > 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" <rjw@rjwysocki.net>
>> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
>>
>> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> 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.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-07-26 0:35 ` Andy Shevchenko
@ 2017-07-26 0:27 ` Rafael J. Wysocki
2017-07-26 10:03 ` Andy Shevchenko
2017-08-30 12:41 ` Christoph Hellwig
0 siblings, 2 replies; 37+ messages in thread
From: Rafael J. Wysocki @ 2017-07-26 0:27 UTC (permalink / raw)
To: Andy Shevchenko
Cc: devel, linux-efi, linux-watchdog, sparmaintainer,
open list:TI WILINK WIRELES..., linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, Lukas Wunner, devel, Andy Shevchenko,
Mika Westerberg, Christoph Hellwig
On Wednesday, July 26, 2017 03:35:01 AM Andy Shevchenko wrote:
> On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Tuesday, July 25, 2017 05:12:35 PM Mika Westerberg wrote:
> >> On Wed, Jul 19, 2017 at 09:28:57PM +0300, Andy Shevchenko wrote:
> >> > 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" <rjw@rjwysocki.net>
> >> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> >>
> >> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> >
> > 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
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-07-26 0:27 ` Rafael J. Wysocki
@ 2017-07-26 10:03 ` Andy Shevchenko
2017-07-26 18:58 ` Rafael J. Wysocki
2017-08-30 12:41 ` Christoph Hellwig
1 sibling, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2017-07-26 10:03 UTC (permalink / raw)
To: Rafael J. Wysocki, Andy Shevchenko
Cc: Mika Westerberg, linux-acpi@vger.kernel.org, devel,
sparmaintainer, devel, open list:TI WILINK WIRELES...,
linux-watchdog, linux-efi, Christoph Hellwig,
linux-kernel@vger.kernel.org, Lukas Wunner
On Wed, 2017-07-26 at 02:27 +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 26, 2017 03:35:01 AM Andy Shevchenko wrote:
> > On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <rjw@rjwysocki.ne
> > t> wrote:
> > > 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!
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-07-26 10:03 ` Andy Shevchenko
@ 2017-07-26 18:58 ` Rafael J. Wysocki
0 siblings, 0 replies; 37+ messages in thread
From: Rafael J. Wysocki @ 2017-07-26 18:58 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Andy Shevchenko, Mika Westerberg, linux-acpi@vger.kernel.org,
devel, sparmaintainer, devel, open list:TI WILINK WIRELES...,
linux-watchdog, linux-efi, Christoph Hellwig,
linux-kernel@vger.kernel.org, Lukas Wunner
On Wednesday, July 26, 2017 01:03:03 PM Andy Shevchenko wrote:
> On Wed, 2017-07-26 at 02:27 +0200, Rafael J. Wysocki wrote:
> > On Wednesday, July 26, 2017 03:35:01 AM Andy Shevchenko wrote:
> > > On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <rjw@rjwysocki.ne
> > > t> wrote:
>
> > > > 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!
Applied now, thanks!
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-07-26 0:27 ` Rafael J. Wysocki
2017-07-26 10:03 ` Andy Shevchenko
@ 2017-08-30 12:41 ` Christoph Hellwig
2017-08-30 13:46 ` Rafael J. Wysocki
1 sibling, 1 reply; 37+ messages in thread
From: Christoph Hellwig @ 2017-08-30 12:41 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: devel, linux-efi, linux-watchdog, sparmaintainer,
open list:TI WILINK WIRELES..., linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, Andy Shevchenko, Lukas Wunner, devel,
Andy Shevchenko, Mika Westerberg, Christoph Hellwig
On Wed, Jul 26, 2017 at 02:27:44AM +0200, Rafael J. Wysocki wrote:
> > >> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > >> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> > >>
> > >> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > >
> > > 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
This didn't seem to make it into linux-next so far, though.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-08-30 12:41 ` Christoph Hellwig
@ 2017-08-30 13:46 ` Rafael J. Wysocki
2017-08-30 13:57 ` Christoph Hellwig
0 siblings, 1 reply; 37+ messages in thread
From: Rafael J. Wysocki @ 2017-08-30 13:46 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Andy Shevchenko, Mika Westerberg, Andy Shevchenko,
linux-acpi@vger.kernel.org, devel, sparmaintainer, devel,
open list:TI WILINK WIRELES..., linux-watchdog, linux-efi,
Christoph Hellwig, linux-kernel@vger.kernel.org, Lukas Wunner
On Wednesday, August 30, 2017 2:41:41 PM CEST Christoph Hellwig wrote:
> On Wed, Jul 26, 2017 at 02:27:44AM +0200, Rafael J. Wysocki wrote:
> > > >> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > > >> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> > > >>
> > > >> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > > >
> > > > 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
>
> 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?
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API
2017-08-30 13:46 ` Rafael J. Wysocki
@ 2017-08-30 13:57 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2017-08-30 13:57 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: devel, linux-efi, linux-watchdog, sparmaintainer,
open list:TI WILINK WIRELES..., linux-kernel@vger.kernel.org,
Christoph Hellwig, linux-acpi@vger.kernel.org, Andy Shevchenko,
Lukas Wunner, devel, Andy Shevchenko, Mika Westerberg,
Christoph Hellwig
On Wed, Aug 30, 2017 at 03:46:34PM +0200, Rafael J. Wysocki wrote:
> 3689d3d69072 ACPI: device property: Switch to use new generic UUID API
>
> in 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.
^ permalink raw reply [flat|nested] 37+ messages in thread