diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-03 12:55:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-03 12:55:26 -0400 |
commit | 81e3e044897b0875a52953b3fb6241a33428e4f9 (patch) | |
tree | 17181c7c4e8392b96d2f9a57e537170029595ea4 | |
parent | 6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c (diff) | |
parent | b86a496a42064e2a864bae31306e0c78eced2a3b (diff) |
Merge tag 'uuid-for-4.13' of git://git.infradead.org/users/hch/uuid
Pull uuid subsystem from Christoph Hellwig:
"This is the new uuid subsystem, in which Amir, Andy and I have started
consolidating our uuid/guid helpers and improving the types used for
them. Note that various other subsystems have pulled in this tree, so
I'd like it to go in early.
UUID/GUID summary:
- introduce the new uuid_t/guid_t types that are going to replace the
somewhat confusing uuid_be/uuid_le types and make the terminology
fit the various specs, as well as the userspace libuuid library.
(me, based on a previous version from Amir)
- consolidated generic uuid/guid helper functions lifted from XFS and
libnvdimm (Amir and me)
- conversions to the new types and helpers (Amir, Andy and me)"
* tag 'uuid-for-4.13' of git://git.infradead.org/users/hch/uuid: (34 commits)
ACPI: hns_dsaf_acpi_dsm_guid can be static
mmc: sdhci-pci: make guid intel_dsm_guid static
uuid: Take const on input of uuid_is_null() and guid_is_null()
thermal: int340x_thermal: fix compile after the UUID API switch
thermal: int340x_thermal: Switch to use new generic UUID API
acpi: always include uuid.h
ACPI: Switch to use generic guid_t in acpi_evaluate_dsm()
ACPI / extlog: Switch to use new generic UUID API
ACPI / bus: Switch to use new generic UUID API
ACPI / APEI: Switch to use new generic UUID API
acpi, nfit: Switch to use new generic UUID API
MAINTAINERS: add uuid entry
tmpfs: generate random sb->s_uuid
scsi_debug: switch to uuid_t
nvme: switch to uuid_t
sysctl: switch to use uuid_t
partitions/ldm: switch to use uuid_t
overlayfs: use uuid_t instead of uuid_be
fs: switch ->s_uuid to uuid_t
ima/policy: switch to use uuid_t
...
76 files changed, 373 insertions, 500 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 767e9d202adf..503f80a43bec 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -13462,6 +13462,17 @@ W: http://en.wikipedia.org/wiki/Util-linux | |||
13462 | T: git git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git | 13462 | T: git git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git |
13463 | S: Maintained | 13463 | S: Maintained |
13464 | 13464 | ||
13465 | UUID HELPERS | ||
13466 | M: Christoph Hellwig <hch@lst.de> | ||
13467 | R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> | ||
13468 | L: linux-kernel@vger.kernel.org | ||
13469 | T: git git://git.infradead.org/users/hch/uuid.git | ||
13470 | F: lib/uuid.c | ||
13471 | F: lib/test_uuid.c | ||
13472 | F: include/linux/uuid.h | ||
13473 | F: include/uapi/linux/uuid.h | ||
13474 | S: Maintained | ||
13475 | |||
13465 | UVESAFB DRIVER | 13476 | UVESAFB DRIVER |
13466 | M: Michal Januszewski <spock@gentoo.org> | 13477 | M: Michal Januszewski <spock@gentoo.org> |
13467 | L: linux-fbdev@vger.kernel.org | 13478 | L: linux-fbdev@vger.kernel.org |
diff --git a/arch/s390/include/asm/sysinfo.h b/arch/s390/include/asm/sysinfo.h index e784bed6ed7f..2b498e58b914 100644 --- a/arch/s390/include/asm/sysinfo.h +++ b/arch/s390/include/asm/sysinfo.h | |||
@@ -109,7 +109,7 @@ struct sysinfo_2_2_2 { | |||
109 | unsigned short cpus_shared; | 109 | unsigned short cpus_shared; |
110 | char reserved_4[3]; | 110 | char reserved_4[3]; |
111 | unsigned char vsne; | 111 | unsigned char vsne; |
112 | uuid_be uuid; | 112 | uuid_t uuid; |
113 | char reserved_5[160]; | 113 | char reserved_5[160]; |
114 | char ext_name[256]; | 114 | char ext_name[256]; |
115 | }; | 115 | }; |
@@ -134,7 +134,7 @@ struct sysinfo_3_2_2 { | |||
134 | char reserved_1[3]; | 134 | char reserved_1[3]; |
135 | unsigned char evmne; | 135 | unsigned char evmne; |
136 | unsigned int reserved_2; | 136 | unsigned int reserved_2; |
137 | uuid_be uuid; | 137 | uuid_t uuid; |
138 | } vm[8]; | 138 | } vm[8]; |
139 | char reserved_3[1504]; | 139 | char reserved_3[1504]; |
140 | char ext_names[8][256]; | 140 | char ext_names[8][256]; |
diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c index eefcb54872a5..fb869b103825 100644 --- a/arch/s390/kernel/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c | |||
@@ -242,7 +242,7 @@ static void print_ext_name(struct seq_file *m, int lvl, | |||
242 | 242 | ||
243 | static void print_uuid(struct seq_file *m, int i, struct sysinfo_3_2_2 *info) | 243 | static void print_uuid(struct seq_file *m, int i, struct sysinfo_3_2_2 *info) |
244 | { | 244 | { |
245 | if (!memcmp(&info->vm[i].uuid, &NULL_UUID_BE, sizeof(uuid_be))) | 245 | if (uuid_is_null(&info->vm[i].uuid)) |
246 | return; | 246 | return; |
247 | seq_printf(m, "VM%02d UUID: %pUb\n", i, &info->vm[i].uuid); | 247 | seq_printf(m, "VM%02d UUID: %pUb\n", i, &info->vm[i].uuid); |
248 | } | 248 | } |
diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c index edcea70674c9..2a365c756648 100644 --- a/block/partitions/ldm.c +++ b/block/partitions/ldm.c | |||
@@ -115,7 +115,7 @@ static bool ldm_parse_privhead(const u8 *data, struct privhead *ph) | |||
115 | ldm_error("PRIVHEAD disk size doesn't match real disk size"); | 115 | ldm_error("PRIVHEAD disk size doesn't match real disk size"); |
116 | return false; | 116 | return false; |
117 | } | 117 | } |
118 | if (uuid_be_to_bin(data + 0x0030, (uuid_be *)ph->disk_id)) { | 118 | if (uuid_parse(data + 0x0030, &ph->disk_id)) { |
119 | ldm_error("PRIVHEAD contains an invalid GUID."); | 119 | ldm_error("PRIVHEAD contains an invalid GUID."); |
120 | return false; | 120 | return false; |
121 | } | 121 | } |
@@ -234,7 +234,7 @@ static bool ldm_compare_privheads (const struct privhead *ph1, | |||
234 | (ph1->logical_disk_size == ph2->logical_disk_size) && | 234 | (ph1->logical_disk_size == ph2->logical_disk_size) && |
235 | (ph1->config_start == ph2->config_start) && | 235 | (ph1->config_start == ph2->config_start) && |
236 | (ph1->config_size == ph2->config_size) && | 236 | (ph1->config_size == ph2->config_size) && |
237 | !memcmp (ph1->disk_id, ph2->disk_id, GUID_SIZE)); | 237 | uuid_equal(&ph1->disk_id, &ph2->disk_id)); |
238 | } | 238 | } |
239 | 239 | ||
240 | /** | 240 | /** |
@@ -557,7 +557,7 @@ static struct vblk * ldm_get_disk_objid (const struct ldmdb *ldb) | |||
557 | 557 | ||
558 | list_for_each (item, &ldb->v_disk) { | 558 | list_for_each (item, &ldb->v_disk) { |
559 | struct vblk *v = list_entry (item, struct vblk, list); | 559 | struct vblk *v = list_entry (item, struct vblk, list); |
560 | if (!memcmp (v->vblk.disk.disk_id, ldb->ph.disk_id, GUID_SIZE)) | 560 | if (uuid_equal(&v->vblk.disk.disk_id, &ldb->ph.disk_id)) |
561 | return v; | 561 | return v; |
562 | } | 562 | } |
563 | 563 | ||
@@ -892,7 +892,7 @@ static bool ldm_parse_dsk3 (const u8 *buffer, int buflen, struct vblk *vb) | |||
892 | disk = &vb->vblk.disk; | 892 | disk = &vb->vblk.disk; |
893 | ldm_get_vstr (buffer + 0x18 + r_diskid, disk->alt_name, | 893 | ldm_get_vstr (buffer + 0x18 + r_diskid, disk->alt_name, |
894 | sizeof (disk->alt_name)); | 894 | sizeof (disk->alt_name)); |
895 | if (uuid_be_to_bin(buffer + 0x19 + r_name, (uuid_be *)disk->disk_id)) | 895 | if (uuid_parse(buffer + 0x19 + r_name, &disk->disk_id)) |
896 | return false; | 896 | return false; |
897 | 897 | ||
898 | return true; | 898 | return true; |
@@ -927,7 +927,7 @@ static bool ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb) | |||
927 | return false; | 927 | return false; |
928 | 928 | ||
929 | disk = &vb->vblk.disk; | 929 | disk = &vb->vblk.disk; |
930 | memcpy (disk->disk_id, buffer + 0x18 + r_name, GUID_SIZE); | 930 | uuid_copy(&disk->disk_id, (uuid_t *)(buffer + 0x18 + r_name)); |
931 | return true; | 931 | return true; |
932 | } | 932 | } |
933 | 933 | ||
diff --git a/block/partitions/ldm.h b/block/partitions/ldm.h index 374242c0971a..f4c6055df956 100644 --- a/block/partitions/ldm.h +++ b/block/partitions/ldm.h | |||
@@ -112,8 +112,6 @@ struct frag { /* VBLK Fragment handling */ | |||
112 | 112 | ||
113 | /* In memory LDM database structures. */ | 113 | /* In memory LDM database structures. */ |
114 | 114 | ||
115 | #define GUID_SIZE 16 | ||
116 | |||
117 | struct privhead { /* Offsets and sizes are in sectors. */ | 115 | struct privhead { /* Offsets and sizes are in sectors. */ |
118 | u16 ver_major; | 116 | u16 ver_major; |
119 | u16 ver_minor; | 117 | u16 ver_minor; |
@@ -121,7 +119,7 @@ struct privhead { /* Offsets and sizes are in sectors. */ | |||
121 | u64 logical_disk_size; | 119 | u64 logical_disk_size; |
122 | u64 config_start; | 120 | u64 config_start; |
123 | u64 config_size; | 121 | u64 config_size; |
124 | u8 disk_id[GUID_SIZE]; | 122 | uuid_t disk_id; |
125 | }; | 123 | }; |
126 | 124 | ||
127 | struct tocblock { /* We have exactly two bitmaps. */ | 125 | struct tocblock { /* We have exactly two bitmaps. */ |
@@ -154,7 +152,7 @@ struct vblk_dgrp { /* VBLK Disk Group */ | |||
154 | }; | 152 | }; |
155 | 153 | ||
156 | struct vblk_disk { /* VBLK Disk */ | 154 | struct vblk_disk { /* VBLK Disk */ |
157 | u8 disk_id[GUID_SIZE]; | 155 | uuid_t disk_id; |
158 | u8 alt_name[128]; | 156 | u8 alt_name[128]; |
159 | }; | 157 | }; |
160 | 158 | ||
diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index 502ea4dc2080..560fdae8cc59 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c | |||
@@ -141,9 +141,9 @@ static int extlog_print(struct notifier_block *nb, unsigned long val, | |||
141 | int cpu = mce->extcpu; | 141 | int cpu = mce->extcpu; |
142 | struct acpi_hest_generic_status *estatus, *tmp; | 142 | struct acpi_hest_generic_status *estatus, *tmp; |
143 | struct acpi_hest_generic_data *gdata; | 143 | struct acpi_hest_generic_data *gdata; |
144 | const uuid_le *fru_id = &NULL_UUID_LE; | 144 | const guid_t *fru_id = &guid_null; |
145 | char *fru_text = ""; | 145 | char *fru_text = ""; |
146 | uuid_le *sec_type; | 146 | guid_t *sec_type; |
147 | static u32 err_seq; | 147 | static u32 err_seq; |
148 | 148 | ||
149 | estatus = extlog_elog_entry_check(cpu, bank); | 149 | estatus = extlog_elog_entry_check(cpu, bank); |
@@ -165,11 +165,11 @@ static int extlog_print(struct notifier_block *nb, unsigned long val, | |||
165 | err_seq++; | 165 | err_seq++; |
166 | gdata = (struct acpi_hest_generic_data *)(tmp + 1); | 166 | gdata = (struct acpi_hest_generic_data *)(tmp + 1); |
167 | if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID) | 167 | if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID) |
168 | fru_id = (uuid_le *)gdata->fru_id; | 168 | fru_id = (guid_t *)gdata->fru_id; |
169 | if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT) | 169 | if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT) |
170 | fru_text = gdata->fru_text; | 170 | fru_text = gdata->fru_text; |
171 | sec_type = (uuid_le *)gdata->section_type; | 171 | sec_type = (guid_t *)gdata->section_type; |
172 | if (!uuid_le_cmp(*sec_type, CPER_SEC_PLATFORM_MEM)) { | 172 | if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) { |
173 | struct cper_sec_mem_err *mem = (void *)(gdata + 1); | 173 | struct cper_sec_mem_err *mem = (void *)(gdata + 1); |
174 | if (gdata->error_data_length >= sizeof(*mem)) | 174 | if (gdata->error_data_length >= sizeof(*mem)) |
175 | trace_extlog_mem_event(mem, err_seq, fru_id, fru_text, | 175 | trace_extlog_mem_event(mem, err_seq, fru_id, fru_text, |
@@ -182,17 +182,17 @@ out: | |||
182 | 182 | ||
183 | static bool __init extlog_get_l1addr(void) | 183 | static bool __init extlog_get_l1addr(void) |
184 | { | 184 | { |
185 | u8 uuid[16]; | 185 | guid_t guid; |
186 | acpi_handle handle; | 186 | acpi_handle handle; |
187 | union acpi_object *obj; | 187 | union acpi_object *obj; |
188 | 188 | ||
189 | acpi_str_to_uuid(extlog_dsm_uuid, uuid); | 189 | if (guid_parse(extlog_dsm_uuid, &guid)) |
190 | 190 | return false; | |
191 | if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) | 191 | if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) |
192 | return false; | 192 | return false; |
193 | if (!acpi_check_dsm(handle, uuid, EXTLOG_DSM_REV, 1 << EXTLOG_FN_ADDR)) | 193 | if (!acpi_check_dsm(handle, &guid, EXTLOG_DSM_REV, 1 << EXTLOG_FN_ADDR)) |
194 | return false; | 194 | return false; |
195 | obj = acpi_evaluate_dsm_typed(handle, uuid, EXTLOG_DSM_REV, | 195 | obj = acpi_evaluate_dsm_typed(handle, &guid, EXTLOG_DSM_REV, |
196 | EXTLOG_FN_ADDR, NULL, ACPI_TYPE_INTEGER); | 196 | EXTLOG_FN_ADDR, NULL, ACPI_TYPE_INTEGER); |
197 | if (!obj) { | 197 | if (!obj) { |
198 | return false; | 198 | return false; |
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index d0855c09f32f..980515e029fa 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
@@ -431,12 +431,13 @@ static void ghes_do_proc(struct ghes *ghes, | |||
431 | { | 431 | { |
432 | int sev, sec_sev; | 432 | int sev, sec_sev; |
433 | struct acpi_hest_generic_data *gdata; | 433 | struct acpi_hest_generic_data *gdata; |
434 | guid_t *sec_type; | ||
434 | 435 | ||
435 | sev = ghes_severity(estatus->error_severity); | 436 | sev = ghes_severity(estatus->error_severity); |
436 | apei_estatus_for_each_section(estatus, gdata) { | 437 | apei_estatus_for_each_section(estatus, gdata) { |
438 | sec_type = (guid_t *)gdata->section_type; | ||
437 | sec_sev = ghes_severity(gdata->error_severity); | 439 | sec_sev = ghes_severity(gdata->error_severity); |
438 | if (!uuid_le_cmp(*(uuid_le *)gdata->section_type, | 440 | if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) { |
439 | CPER_SEC_PLATFORM_MEM)) { | ||
440 | struct cper_sec_mem_err *mem_err; | 441 | struct cper_sec_mem_err *mem_err; |
441 | mem_err = (struct cper_sec_mem_err *)(gdata+1); | 442 | mem_err = (struct cper_sec_mem_err *)(gdata+1); |
442 | ghes_edac_report_mem_error(ghes, sev, mem_err); | 443 | ghes_edac_report_mem_error(ghes, sev, mem_err); |
@@ -445,8 +446,7 @@ static void ghes_do_proc(struct ghes *ghes, | |||
445 | ghes_handle_memory_failure(gdata, sev); | 446 | ghes_handle_memory_failure(gdata, sev); |
446 | } | 447 | } |
447 | #ifdef CONFIG_ACPI_APEI_PCIEAER | 448 | #ifdef CONFIG_ACPI_APEI_PCIEAER |
448 | else if (!uuid_le_cmp(*(uuid_le *)gdata->section_type, | 449 | else if (guid_equal(sec_type, &CPER_SEC_PCIE)) { |
449 | CPER_SEC_PCIE)) { | ||
450 | struct cper_sec_pcie *pcie_err; | 450 | struct cper_sec_pcie *pcie_err; |
451 | pcie_err = (struct cper_sec_pcie *)(gdata+1); | 451 | pcie_err = (struct cper_sec_pcie *)(gdata+1); |
452 | if (sev == GHES_SEV_RECOVERABLE && | 452 | if (sev == GHES_SEV_RECOVERABLE && |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 784bda663d16..5a6fbe0fcaf2 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -196,42 +196,19 @@ static void acpi_print_osc_error(acpi_handle handle, | |||
196 | pr_debug("\n"); | 196 | pr_debug("\n"); |
197 | } | 197 | } |
198 | 198 | ||
199 | acpi_status acpi_str_to_uuid(char *str, u8 *uuid) | ||
200 | { | ||
201 | int i; | ||
202 | static int opc_map_to_uuid[16] = {6, 4, 2, 0, 11, 9, 16, 14, 19, 21, | ||
203 | 24, 26, 28, 30, 32, 34}; | ||
204 | |||
205 | if (strlen(str) != 36) | ||
206 | return AE_BAD_PARAMETER; | ||
207 | for (i = 0; i < 36; i++) { | ||
208 | if (i == 8 || i == 13 || i == 18 || i == 23) { | ||
209 | if (str[i] != '-') | ||
210 | return AE_BAD_PARAMETER; | ||
211 | } else if (!isxdigit(str[i])) | ||
212 | return AE_BAD_PARAMETER; | ||
213 | } | ||
214 | for (i = 0; i < 16; i++) { | ||
215 | uuid[i] = hex_to_bin(str[opc_map_to_uuid[i]]) << 4; | ||
216 | uuid[i] |= hex_to_bin(str[opc_map_to_uuid[i] + 1]); | ||
217 | } | ||
218 | return AE_OK; | ||
219 | } | ||
220 | EXPORT_SYMBOL_GPL(acpi_str_to_uuid); | ||
221 | |||
222 | acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context) | 199 | acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context) |
223 | { | 200 | { |
224 | acpi_status status; | 201 | acpi_status status; |
225 | struct acpi_object_list input; | 202 | struct acpi_object_list input; |
226 | union acpi_object in_params[4]; | 203 | union acpi_object in_params[4]; |
227 | union acpi_object *out_obj; | 204 | union acpi_object *out_obj; |
228 | u8 uuid[16]; | 205 | guid_t guid; |
229 | u32 errors; | 206 | u32 errors; |
230 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; | 207 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; |
231 | 208 | ||
232 | if (!context) | 209 | if (!context) |
233 | return AE_ERROR; | 210 | return AE_ERROR; |
234 | if (ACPI_FAILURE(acpi_str_to_uuid(context->uuid_str, uuid))) | 211 | if (guid_parse(context->uuid_str, &guid)) |
235 | return AE_ERROR; | 212 | return AE_ERROR; |
236 | context->ret.length = ACPI_ALLOCATE_BUFFER; | 213 | context->ret.length = ACPI_ALLOCATE_BUFFER; |
237 | context->ret.pointer = NULL; | 214 | context->ret.pointer = NULL; |
@@ -241,7 +218,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context) | |||
241 | input.pointer = in_params; | 218 | input.pointer = in_params; |
242 | in_params[0].type = ACPI_TYPE_BUFFER; | 219 | in_params[0].type = ACPI_TYPE_BUFFER; |
243 | in_params[0].buffer.length = 16; | 220 | in_params[0].buffer.length = 16; |
244 | in_params[0].buffer.pointer = uuid; | 221 | in_params[0].buffer.pointer = (u8 *)&guid; |
245 | in_params[1].type = ACPI_TYPE_INTEGER; | 222 | in_params[1].type = ACPI_TYPE_INTEGER; |
246 | in_params[1].integer.value = context->rev; | 223 | in_params[1].integer.value = context->rev; |
247 | in_params[2].type = ACPI_TYPE_INTEGER; | 224 | in_params[2].type = ACPI_TYPE_INTEGER; |
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 656acb5d7166..097eff0b963d 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c | |||
@@ -74,11 +74,11 @@ struct nfit_table_prev { | |||
74 | struct list_head flushes; | 74 | struct list_head flushes; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | static u8 nfit_uuid[NFIT_UUID_MAX][16]; | 77 | static guid_t nfit_uuid[NFIT_UUID_MAX]; |
78 | 78 | ||
79 | const u8 *to_nfit_uuid(enum nfit_uuids id) | 79 | const guid_t *to_nfit_uuid(enum nfit_uuids id) |
80 | { | 80 | { |
81 | return nfit_uuid[id]; | 81 | return &nfit_uuid[id]; |
82 | } | 82 | } |
83 | EXPORT_SYMBOL(to_nfit_uuid); | 83 | EXPORT_SYMBOL(to_nfit_uuid); |
84 | 84 | ||
@@ -222,7 +222,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | |||
222 | u32 offset, fw_status = 0; | 222 | u32 offset, fw_status = 0; |
223 | acpi_handle handle; | 223 | acpi_handle handle; |
224 | unsigned int func; | 224 | unsigned int func; |
225 | const u8 *uuid; | 225 | const guid_t *guid; |
226 | int rc, i; | 226 | int rc, i; |
227 | 227 | ||
228 | func = cmd; | 228 | func = cmd; |
@@ -245,7 +245,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | |||
245 | cmd_mask = nvdimm_cmd_mask(nvdimm); | 245 | cmd_mask = nvdimm_cmd_mask(nvdimm); |
246 | dsm_mask = nfit_mem->dsm_mask; | 246 | dsm_mask = nfit_mem->dsm_mask; |
247 | desc = nd_cmd_dimm_desc(cmd); | 247 | desc = nd_cmd_dimm_desc(cmd); |
248 | uuid = to_nfit_uuid(nfit_mem->family); | 248 | guid = to_nfit_uuid(nfit_mem->family); |
249 | handle = adev->handle; | 249 | handle = adev->handle; |
250 | } else { | 250 | } else { |
251 | struct acpi_device *adev = to_acpi_dev(acpi_desc); | 251 | struct acpi_device *adev = to_acpi_dev(acpi_desc); |
@@ -254,7 +254,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | |||
254 | cmd_mask = nd_desc->cmd_mask; | 254 | cmd_mask = nd_desc->cmd_mask; |
255 | dsm_mask = cmd_mask; | 255 | dsm_mask = cmd_mask; |
256 | desc = nd_cmd_bus_desc(cmd); | 256 | desc = nd_cmd_bus_desc(cmd); |
257 | uuid = to_nfit_uuid(NFIT_DEV_BUS); | 257 | guid = to_nfit_uuid(NFIT_DEV_BUS); |
258 | handle = adev->handle; | 258 | handle = adev->handle; |
259 | dimm_name = "bus"; | 259 | dimm_name = "bus"; |
260 | } | 260 | } |
@@ -289,7 +289,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | |||
289 | in_buf.buffer.pointer, | 289 | in_buf.buffer.pointer, |
290 | min_t(u32, 256, in_buf.buffer.length), true); | 290 | min_t(u32, 256, in_buf.buffer.length), true); |
291 | 291 | ||
292 | out_obj = acpi_evaluate_dsm(handle, uuid, 1, func, &in_obj); | 292 | out_obj = acpi_evaluate_dsm(handle, guid, 1, func, &in_obj); |
293 | if (!out_obj) { | 293 | if (!out_obj) { |
294 | dev_dbg(dev, "%s:%s _DSM failed cmd: %s\n", __func__, dimm_name, | 294 | dev_dbg(dev, "%s:%s _DSM failed cmd: %s\n", __func__, dimm_name, |
295 | cmd_name); | 295 | cmd_name); |
@@ -409,7 +409,7 @@ int nfit_spa_type(struct acpi_nfit_system_address *spa) | |||
409 | int i; | 409 | int i; |
410 | 410 | ||
411 | for (i = 0; i < NFIT_UUID_MAX; i++) | 411 | for (i = 0; i < NFIT_UUID_MAX; i++) |
412 | if (memcmp(to_nfit_uuid(i), spa->range_guid, 16) == 0) | 412 | if (guid_equal(to_nfit_uuid(i), (guid_t *)&spa->range_guid)) |
413 | return i; | 413 | return i; |
414 | return -1; | 414 | return -1; |
415 | } | 415 | } |
@@ -1415,7 +1415,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, | |||
1415 | struct acpi_device *adev, *adev_dimm; | 1415 | struct acpi_device *adev, *adev_dimm; |
1416 | struct device *dev = acpi_desc->dev; | 1416 | struct device *dev = acpi_desc->dev; |
1417 | unsigned long dsm_mask; | 1417 | unsigned long dsm_mask; |
1418 | const u8 *uuid; | 1418 | const guid_t *guid; |
1419 | int i; | 1419 | int i; |
1420 | int family = -1; | 1420 | int family = -1; |
1421 | 1421 | ||
@@ -1444,7 +1444,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, | |||
1444 | /* | 1444 | /* |
1445 | * Until standardization materializes we need to consider 4 | 1445 | * Until standardization materializes we need to consider 4 |
1446 | * different command sets. Note, that checking for function0 (bit0) | 1446 | * different command sets. Note, that checking for function0 (bit0) |
1447 | * tells us if any commands are reachable through this uuid. | 1447 | * tells us if any commands are reachable through this GUID. |
1448 | */ | 1448 | */ |
1449 | for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++) | 1449 | for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++) |
1450 | if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1)) | 1450 | if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1)) |
@@ -1474,9 +1474,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, | |||
1474 | return 0; | 1474 | return 0; |
1475 | } | 1475 | } |
1476 | 1476 | ||
1477 | uuid = to_nfit_uuid(nfit_mem->family); | 1477 | guid = to_nfit_uuid(nfit_mem->family); |
1478 | for_each_set_bit(i, &dsm_mask, BITS_PER_LONG) | 1478 | for_each_set_bit(i, &dsm_mask, BITS_PER_LONG) |
1479 | if (acpi_check_dsm(adev_dimm->handle, uuid, 1, 1ULL << i)) | 1479 | if (acpi_check_dsm(adev_dimm->handle, guid, 1, 1ULL << i)) |
1480 | set_bit(i, &nfit_mem->dsm_mask); | 1480 | set_bit(i, &nfit_mem->dsm_mask); |
1481 | 1481 | ||
1482 | return 0; | 1482 | return 0; |
@@ -1611,7 +1611,7 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc) | |||
1611 | static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc) | 1611 | static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc) |
1612 | { | 1612 | { |
1613 | struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc; | 1613 | struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc; |
1614 | const u8 *uuid = to_nfit_uuid(NFIT_DEV_BUS); | 1614 | const guid_t *guid = to_nfit_uuid(NFIT_DEV_BUS); |
1615 | struct acpi_device *adev; | 1615 | struct acpi_device *adev; |
1616 | int i; | 1616 | int i; |
1617 | 1617 | ||
@@ -1621,7 +1621,7 @@ static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc) | |||
1621 | return; | 1621 | return; |
1622 | 1622 | ||
1623 | for (i = ND_CMD_ARS_CAP; i <= ND_CMD_CLEAR_ERROR; i++) | 1623 | for (i = ND_CMD_ARS_CAP; i <= ND_CMD_CLEAR_ERROR; i++) |
1624 | if (acpi_check_dsm(adev->handle, uuid, 1, 1ULL << i)) | 1624 | if (acpi_check_dsm(adev->handle, guid, 1, 1ULL << i)) |
1625 | set_bit(i, &nd_desc->cmd_mask); | 1625 | set_bit(i, &nd_desc->cmd_mask); |
1626 | } | 1626 | } |
1627 | 1627 | ||
@@ -3051,19 +3051,19 @@ static __init int nfit_init(void) | |||
3051 | BUILD_BUG_ON(sizeof(struct acpi_nfit_control_region) != 80); | 3051 | BUILD_BUG_ON(sizeof(struct acpi_nfit_control_region) != 80); |
3052 | BUILD_BUG_ON(sizeof(struct acpi_nfit_data_region) != 40); | 3052 | BUILD_BUG_ON(sizeof(struct acpi_nfit_data_region) != 40); |
3053 | 3053 | ||
3054 | acpi_str_to_uuid(UUID_VOLATILE_MEMORY, nfit_uuid[NFIT_SPA_VOLATILE]); | 3054 | guid_parse(UUID_VOLATILE_MEMORY, &nfit_uuid[NFIT_SPA_VOLATILE]); |
3055 | acpi_str_to_uuid(UUID_PERSISTENT_MEMORY, nfit_uuid[NFIT_SPA_PM]); | 3055 | guid_parse(UUID_PERSISTENT_MEMORY, &nfit_uuid[NFIT_SPA_PM]); |
3056 | acpi_str_to_uuid(UUID_CONTROL_REGION, nfit_uuid[NFIT_SPA_DCR]); | 3056 | guid_parse(UUID_CONTROL_REGION, &nfit_uuid[NFIT_SPA_DCR]); |
3057 | acpi_str_to_uuid(UUID_DATA_REGION, nfit_uuid[NFIT_SPA_BDW]); | 3057 | guid_parse(UUID_DATA_REGION, &nfit_uuid[NFIT_SPA_BDW]); |
3058 | acpi_str_to_uuid(UUID_VOLATILE_VIRTUAL_DISK, nfit_uuid[NFIT_SPA_VDISK]); | 3058 | guid_parse(UUID_VOLATILE_VIRTUAL_DISK, &nfit_uuid[NFIT_SPA_VDISK]); |
3059 | acpi_str_to_uuid(UUID_VOLATILE_VIRTUAL_CD, nfit_uuid[NFIT_SPA_VCD]); | 3059 | guid_parse(UUID_VOLATILE_VIRTUAL_CD, &nfit_uuid[NFIT_SPA_VCD]); |
3060 | acpi_str_to_uuid(UUID_PERSISTENT_VIRTUAL_DISK, nfit_uuid[NFIT_SPA_PDISK]); | 3060 | guid_parse(UUID_PERSISTENT_VIRTUAL_DISK, &nfit_uuid[NFIT_SPA_PDISK]); |
3061 | acpi_str_to_uuid(UUID_PERSISTENT_VIRTUAL_CD, nfit_uuid[NFIT_SPA_PCD]); | 3061 | guid_parse(UUID_PERSISTENT_VIRTUAL_CD, &nfit_uuid[NFIT_SPA_PCD]); |
3062 | acpi_str_to_uuid(UUID_NFIT_BUS, nfit_uuid[NFIT_DEV_BUS]); | 3062 | guid_parse(UUID_NFIT_BUS, &nfit_uuid[NFIT_DEV_BUS]); |
3063 | acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]); | 3063 | guid_parse(UUID_NFIT_DIMM, &nfit_uuid[NFIT_DEV_DIMM]); |
3064 | acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1, nfit_uuid[NFIT_DEV_DIMM_N_HPE1]); | 3064 | guid_parse(UUID_NFIT_DIMM_N_HPE1, &nfit_uuid[NFIT_DEV_DIMM_N_HPE1]); |
3065 | acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2, nfit_uuid[NFIT_DEV_DIMM_N_HPE2]); | 3065 | guid_parse(UUID_NFIT_DIMM_N_HPE2, &nfit_uuid[NFIT_DEV_DIMM_N_HPE2]); |
3066 | acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT, nfit_uuid[NFIT_DEV_DIMM_N_MSFT]); | 3066 | guid_parse(UUID_NFIT_DIMM_N_MSFT, &nfit_uuid[NFIT_DEV_DIMM_N_MSFT]); |
3067 | 3067 | ||
3068 | nfit_wq = create_singlethread_workqueue("nfit"); | 3068 | nfit_wq = create_singlethread_workqueue("nfit"); |
3069 | if (!nfit_wq) | 3069 | if (!nfit_wq) |
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h index 58fb7d68e04a..29bdd959517f 100644 --- a/drivers/acpi/nfit/nfit.h +++ b/drivers/acpi/nfit/nfit.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/libnvdimm.h> | 18 | #include <linux/libnvdimm.h> |
19 | #include <linux/ndctl.h> | 19 | #include <linux/ndctl.h> |
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/uuid.h> | ||
22 | #include <linux/acpi.h> | 21 | #include <linux/acpi.h> |
23 | #include <acpi/acuuid.h> | 22 | #include <acpi/acuuid.h> |
24 | 23 | ||
@@ -237,7 +236,7 @@ static inline struct acpi_nfit_desc *to_acpi_desc( | |||
237 | return container_of(nd_desc, struct acpi_nfit_desc, nd_desc); | 236 | return container_of(nd_desc, struct acpi_nfit_desc, nd_desc); |
238 | } | 237 | } |
239 | 238 | ||
240 | const u8 *to_nfit_uuid(enum nfit_uuids id); | 239 | const guid_t *to_nfit_uuid(enum nfit_uuids id); |
241 | int acpi_nfit_init(struct acpi_nfit_desc *acpi_desc, void *nfit, acpi_size sz); | 240 | int acpi_nfit_init(struct acpi_nfit_desc *acpi_desc, void *nfit, acpi_size sz); |
242 | void acpi_nfit_shutdown(void *data); | 241 | void acpi_nfit_shutdown(void *data); |
243 | void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event); | 242 | void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event); |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 27d0dcfcf47d..b9d956c916f5 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -613,19 +613,19 @@ acpi_status acpi_evaluate_lck(acpi_handle handle, int lock) | |||
613 | /** | 613 | /** |
614 | * acpi_evaluate_dsm - evaluate device's _DSM method | 614 | * acpi_evaluate_dsm - evaluate device's _DSM method |
615 | * @handle: ACPI device handle | 615 | * @handle: ACPI device handle |
616 | * @uuid: UUID of requested functions, should be 16 bytes | 616 | * @guid: GUID of requested functions, should be 16 bytes |
617 | * @rev: revision number of requested function | 617 | * @rev: revision number of requested function |
618 | * @func: requested function number | 618 | * @func: requested function number |
619 | * @argv4: the function specific parameter | 619 | * @argv4: the function specific parameter |
620 | * | 620 | * |
621 | * Evaluate device's _DSM method with specified UUID, revision id and | 621 | * Evaluate device's _DSM method with specified GUID, revision id and |
622 | * function number. Caller needs to free the returned object. | 622 | * function number. Caller needs to free the returned object. |
623 | * | 623 | * |
624 | * Though ACPI defines the fourth parameter for _DSM should be a package, | 624 | * Though ACPI defines the fourth parameter for _DSM should be a package, |
625 | * some old BIOSes do expect a buffer or an integer etc. | 625 | * some old BIOSes do expect a buffer or an integer etc. |
626 | */ | 626 | */ |
627 | union acpi_object * | 627 | union acpi_object * |
628 | acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 func, | 628 | acpi_evaluate_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 func, |
629 | union acpi_object *argv4) | 629 | union acpi_object *argv4) |
630 | { | 630 | { |
631 | acpi_status ret; | 631 | acpi_status ret; |
@@ -638,7 +638,7 @@ acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 func, | |||
638 | 638 | ||
639 | params[0].type = ACPI_TYPE_BUFFER; | 639 | params[0].type = ACPI_TYPE_BUFFER; |
640 | params[0].buffer.length = 16; | 640 | params[0].buffer.length = 16; |
641 | params[0].buffer.pointer = (char *)uuid; | 641 | params[0].buffer.pointer = (u8 *)guid; |
642 | params[1].type = ACPI_TYPE_INTEGER; | 642 | params[1].type = ACPI_TYPE_INTEGER; |
643 | params[1].integer.value = rev; | 643 | params[1].integer.value = rev; |
644 | params[2].type = ACPI_TYPE_INTEGER; | 644 | params[2].type = ACPI_TYPE_INTEGER; |
@@ -666,7 +666,7 @@ EXPORT_SYMBOL(acpi_evaluate_dsm); | |||
666 | /** | 666 | /** |
667 | * acpi_check_dsm - check if _DSM method supports requested functions. | 667 | * acpi_check_dsm - check if _DSM method supports requested functions. |
668 | * @handle: ACPI device handle | 668 | * @handle: ACPI device handle |
669 | * @uuid: UUID of requested functions, should be 16 bytes at least | 669 | * @guid: GUID of requested functions, should be 16 bytes at least |
670 | * @rev: revision number of requested functions | 670 | * @rev: revision number of requested functions |
671 | * @funcs: bitmap of requested functions | 671 | * @funcs: bitmap of requested functions |
672 | * | 672 | * |
@@ -674,7 +674,7 @@ EXPORT_SYMBOL(acpi_evaluate_dsm); | |||
674 | * functions. Currently only support 64 functions at maximum, should be | 674 | * functions. Currently only support 64 functions at maximum, should be |
675 | * enough for now. | 675 | * enough for now. |
676 | */ | 676 | */ |
677 | bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs) | 677 | bool acpi_check_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 funcs) |
678 | { | 678 | { |
679 | int i; | 679 | int i; |
680 | u64 mask = 0; | 680 | u64 mask = 0; |
@@ -683,7 +683,7 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs) | |||
683 | if (funcs == 0) | 683 | if (funcs == 0) |
684 | return false; | 684 | return false; |
685 | 685 | ||
686 | obj = acpi_evaluate_dsm(handle, uuid, rev, 0, NULL); | 686 | obj = acpi_evaluate_dsm(handle, guid, rev, 0, NULL); |
687 | if (!obj) | 687 | if (!obj) |
688 | return false; | 688 | return false; |
689 | 689 | ||
@@ -697,7 +697,7 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs) | |||
697 | 697 | ||
698 | /* | 698 | /* |
699 | * Bit 0 indicates whether there's support for any functions other than | 699 | * Bit 0 indicates whether there's support for any functions other than |
700 | * function 0 for the specified UUID and revision. | 700 | * function 0 for the specified GUID and revision. |
701 | */ | 701 | */ |
702 | if ((mask & 0x1) && (mask & funcs) == funcs) | 702 | if ((mask & 0x1) && (mask & funcs) == funcs) |
703 | return true; | 703 | return true; |
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index b917b9d5f710..c378c7b15d49 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c | |||
@@ -27,10 +27,9 @@ | |||
27 | 27 | ||
28 | #define ACPI_SIG_TPM2 "TPM2" | 28 | #define ACPI_SIG_TPM2 "TPM2" |
29 | 29 | ||
30 | static const u8 CRB_ACPI_START_UUID[] = { | 30 | static const guid_t crb_acpi_start_guid = |
31 | /* 0000 */ 0xAB, 0x6C, 0xBF, 0x6B, 0x63, 0x54, 0x14, 0x47, | 31 | GUID_INIT(0x6BBF6CAB, 0x5463, 0x4714, |
32 | /* 0008 */ 0xB7, 0xCD, 0xF0, 0x20, 0x3C, 0x03, 0x68, 0xD4 | 32 | 0xB7, 0xCD, 0xF0, 0x20, 0x3C, 0x03, 0x68, 0xD4); |
33 | }; | ||
34 | 33 | ||
35 | enum crb_defaults { | 34 | enum crb_defaults { |
36 | CRB_ACPI_START_REVISION_ID = 1, | 35 | CRB_ACPI_START_REVISION_ID = 1, |
@@ -266,7 +265,7 @@ static int crb_do_acpi_start(struct tpm_chip *chip) | |||
266 | int rc; | 265 | int rc; |
267 | 266 | ||
268 | obj = acpi_evaluate_dsm(chip->acpi_dev_handle, | 267 | obj = acpi_evaluate_dsm(chip->acpi_dev_handle, |
269 | CRB_ACPI_START_UUID, | 268 | &crb_acpi_start_guid, |
270 | CRB_ACPI_START_REVISION_ID, | 269 | CRB_ACPI_START_REVISION_ID, |
271 | CRB_ACPI_START_INDEX, | 270 | CRB_ACPI_START_INDEX, |
272 | NULL); | 271 | NULL); |
diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c index 692a2c6ae036..86dd8521feef 100644 --- a/drivers/char/tpm/tpm_ppi.c +++ b/drivers/char/tpm/tpm_ppi.c | |||
@@ -32,20 +32,16 @@ | |||
32 | #define PPI_VS_REQ_START 128 | 32 | #define PPI_VS_REQ_START 128 |
33 | #define PPI_VS_REQ_END 255 | 33 | #define PPI_VS_REQ_END 255 |
34 | 34 | ||
35 | static const u8 tpm_ppi_uuid[] = { | 35 | static const guid_t tpm_ppi_guid = |
36 | 0xA6, 0xFA, 0xDD, 0x3D, | 36 | GUID_INIT(0x3DDDFAA6, 0x361B, 0x4EB4, |
37 | 0x1B, 0x36, | 37 | 0xA4, 0x24, 0x8D, 0x10, 0x08, 0x9D, 0x16, 0x53); |
38 | 0xB4, 0x4E, | ||
39 | 0xA4, 0x24, | ||
40 | 0x8D, 0x10, 0x08, 0x9D, 0x16, 0x53 | ||
41 | }; | ||
42 | 38 | ||
43 | static inline union acpi_object * | 39 | static inline union acpi_object * |
44 | tpm_eval_dsm(acpi_handle ppi_handle, int func, acpi_object_type type, | 40 | tpm_eval_dsm(acpi_handle ppi_handle, int func, acpi_object_type type, |
45 | union acpi_object *argv4) | 41 | union acpi_object *argv4) |
46 | { | 42 | { |
47 | BUG_ON(!ppi_handle); | 43 | BUG_ON(!ppi_handle); |
48 | return acpi_evaluate_dsm_typed(ppi_handle, tpm_ppi_uuid, | 44 | return acpi_evaluate_dsm_typed(ppi_handle, &tpm_ppi_guid, |
49 | TPM_PPI_REVISION_ID, | 45 | TPM_PPI_REVISION_ID, |
50 | func, argv4, type); | 46 | func, argv4, type); |
51 | } | 47 | } |
@@ -107,7 +103,7 @@ static ssize_t tpm_store_ppi_request(struct device *dev, | |||
107 | * is updated with function index from SUBREQ to SUBREQ2 since PPI | 103 | * is updated with function index from SUBREQ to SUBREQ2 since PPI |
108 | * version 1.1 | 104 | * version 1.1 |
109 | */ | 105 | */ |
110 | if (acpi_check_dsm(chip->acpi_dev_handle, tpm_ppi_uuid, | 106 | if (acpi_check_dsm(chip->acpi_dev_handle, &tpm_ppi_guid, |
111 | TPM_PPI_REVISION_ID, 1 << TPM_PPI_FN_SUBREQ2)) | 107 | TPM_PPI_REVISION_ID, 1 << TPM_PPI_FN_SUBREQ2)) |
112 | func = TPM_PPI_FN_SUBREQ2; | 108 | func = TPM_PPI_FN_SUBREQ2; |
113 | 109 | ||
@@ -268,7 +264,7 @@ static ssize_t show_ppi_operations(acpi_handle dev_handle, char *buf, u32 start, | |||
268 | "User not required", | 264 | "User not required", |
269 | }; | 265 | }; |
270 | 266 | ||
271 | if (!acpi_check_dsm(dev_handle, tpm_ppi_uuid, TPM_PPI_REVISION_ID, | 267 | if (!acpi_check_dsm(dev_handle, &tpm_ppi_guid, TPM_PPI_REVISION_ID, |
272 | 1 << TPM_PPI_FN_GETOPR)) | 268 | 1 << TPM_PPI_FN_GETOPR)) |
273 | return -EPERM; | 269 | return -EPERM; |
274 | 270 | ||
@@ -341,12 +337,12 @@ void tpm_add_ppi(struct tpm_chip *chip) | |||
341 | if (!chip->acpi_dev_handle) | 337 | if (!chip->acpi_dev_handle) |
342 | return; | 338 | return; |
343 | 339 | ||
344 | if (!acpi_check_dsm(chip->acpi_dev_handle, tpm_ppi_uuid, | 340 | if (!acpi_check_dsm(chip->acpi_dev_handle, &tpm_ppi_guid, |
345 | TPM_PPI_REVISION_ID, 1 << TPM_PPI_FN_VERSION)) | 341 | TPM_PPI_REVISION_ID, 1 << TPM_PPI_FN_VERSION)) |
346 | return; | 342 | return; |
347 | 343 | ||
348 | /* Cache PPI version string. */ | 344 | /* Cache PPI version string. */ |
349 | obj = acpi_evaluate_dsm_typed(chip->acpi_dev_handle, tpm_ppi_uuid, | 345 | obj = acpi_evaluate_dsm_typed(chip->acpi_dev_handle, &tpm_ppi_guid, |
350 | TPM_PPI_REVISION_ID, TPM_PPI_FN_VERSION, | 346 | TPM_PPI_REVISION_ID, TPM_PPI_FN_VERSION, |
351 | NULL, ACPI_TYPE_STRING); | 347 | NULL, ACPI_TYPE_STRING); |
352 | if (obj) { | 348 | if (obj) { |
diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c index eb638a1e69d2..42fb436f6cdc 100644 --- a/drivers/gpu/drm/i915/intel_acpi.c +++ b/drivers/gpu/drm/i915/intel_acpi.c | |||
@@ -15,13 +15,9 @@ static struct intel_dsm_priv { | |||
15 | acpi_handle dhandle; | 15 | acpi_handle dhandle; |
16 | } intel_dsm_priv; | 16 | } intel_dsm_priv; |
17 | 17 | ||
18 | static const u8 intel_dsm_guid[] = { | 18 | static const guid_t intel_dsm_guid = |
19 | 0xd3, 0x73, 0xd8, 0x7e, | 19 | GUID_INIT(0x7ed873d3, 0xc2d0, 0x4e4f, |
20 | 0xd0, 0xc2, | 20 | 0xa8, 0x54, 0x0f, 0x13, 0x17, 0xb0, 0x1c, 0x2c); |
21 | 0x4f, 0x4e, | ||
22 | 0xa8, 0x54, | ||
23 | 0x0f, 0x13, 0x17, 0xb0, 0x1c, 0x2c | ||
24 | }; | ||
25 | 21 | ||
26 | static char *intel_dsm_port_name(u8 id) | 22 | static char *intel_dsm_port_name(u8 id) |
27 | { | 23 | { |
@@ -80,7 +76,7 @@ static void intel_dsm_platform_mux_info(void) | |||
80 | int i; | 76 | int i; |
81 | union acpi_object *pkg, *connector_count; | 77 | union acpi_object *pkg, *connector_count; |
82 | 78 | ||
83 | pkg = acpi_evaluate_dsm_typed(intel_dsm_priv.dhandle, intel_dsm_guid, | 79 | pkg = acpi_evaluate_dsm_typed(intel_dsm_priv.dhandle, &intel_dsm_guid, |
84 | INTEL_DSM_REVISION_ID, INTEL_DSM_FN_PLATFORM_MUX_INFO, | 80 | INTEL_DSM_REVISION_ID, INTEL_DSM_FN_PLATFORM_MUX_INFO, |
85 | NULL, ACPI_TYPE_PACKAGE); | 81 | NULL, ACPI_TYPE_PACKAGE); |
86 | if (!pkg) { | 82 | if (!pkg) { |
@@ -118,7 +114,7 @@ static bool intel_dsm_pci_probe(struct pci_dev *pdev) | |||
118 | if (!dhandle) | 114 | if (!dhandle) |
119 | return false; | 115 | return false; |
120 | 116 | ||
121 | if (!acpi_check_dsm(dhandle, intel_dsm_guid, INTEL_DSM_REVISION_ID, | 117 | if (!acpi_check_dsm(dhandle, &intel_dsm_guid, INTEL_DSM_REVISION_ID, |
122 | 1 << INTEL_DSM_FN_PLATFORM_MUX_INFO)) { | 118 | 1 << INTEL_DSM_FN_PLATFORM_MUX_INFO)) { |
123 | DRM_DEBUG_KMS("no _DSM method for intel device\n"); | 119 | DRM_DEBUG_KMS("no _DSM method for intel device\n"); |
124 | return false; | 120 | return false; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index 39468c218027..7459ef9943ec 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c | |||
@@ -60,15 +60,13 @@ bool nouveau_is_v1_dsm(void) { | |||
60 | } | 60 | } |
61 | 61 | ||
62 | #ifdef CONFIG_VGA_SWITCHEROO | 62 | #ifdef CONFIG_VGA_SWITCHEROO |
63 | static const char nouveau_dsm_muid[] = { | 63 | static const guid_t nouveau_dsm_muid = |
64 | 0xA0, 0xA0, 0x95, 0x9D, 0x60, 0x00, 0x48, 0x4D, | 64 | GUID_INIT(0x9D95A0A0, 0x0060, 0x4D48, |
65 | 0xB3, 0x4D, 0x7E, 0x5F, 0xEA, 0x12, 0x9F, 0xD4, | 65 | 0xB3, 0x4D, 0x7E, 0x5F, 0xEA, 0x12, 0x9F, 0xD4); |
66 | }; | ||
67 | 66 | ||
68 | static const char nouveau_op_dsm_muid[] = { | 67 | static const guid_t nouveau_op_dsm_muid = |
69 | 0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47, | 68 | GUID_INIT(0xA486D8F8, 0x0BDA, 0x471B, |
70 | 0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0, | 69 | 0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0); |
71 | }; | ||
72 | 70 | ||
73 | static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *result) | 71 | static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *result) |
74 | { | 72 | { |
@@ -86,7 +84,7 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t * | |||
86 | args_buff[i] = (arg >> i * 8) & 0xFF; | 84 | args_buff[i] = (arg >> i * 8) & 0xFF; |
87 | 85 | ||
88 | *result = 0; | 86 | *result = 0; |
89 | obj = acpi_evaluate_dsm_typed(handle, nouveau_op_dsm_muid, 0x00000100, | 87 | obj = acpi_evaluate_dsm_typed(handle, &nouveau_op_dsm_muid, 0x00000100, |
90 | func, &argv4, ACPI_TYPE_BUFFER); | 88 | func, &argv4, ACPI_TYPE_BUFFER); |
91 | if (!obj) { | 89 | if (!obj) { |
92 | acpi_handle_info(handle, "failed to evaluate _DSM\n"); | 90 | acpi_handle_info(handle, "failed to evaluate _DSM\n"); |
@@ -138,7 +136,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg) | |||
138 | .integer.value = arg, | 136 | .integer.value = arg, |
139 | }; | 137 | }; |
140 | 138 | ||
141 | obj = acpi_evaluate_dsm_typed(handle, nouveau_dsm_muid, 0x00000102, | 139 | obj = acpi_evaluate_dsm_typed(handle, &nouveau_dsm_muid, 0x00000102, |
142 | func, &argv4, ACPI_TYPE_INTEGER); | 140 | func, &argv4, ACPI_TYPE_INTEGER); |
143 | if (!obj) { | 141 | if (!obj) { |
144 | acpi_handle_info(handle, "failed to evaluate _DSM\n"); | 142 | acpi_handle_info(handle, "failed to evaluate _DSM\n"); |
@@ -259,7 +257,7 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out | |||
259 | if (!acpi_has_method(dhandle, "_DSM")) | 257 | if (!acpi_has_method(dhandle, "_DSM")) |
260 | return; | 258 | return; |
261 | 259 | ||
262 | supports_mux = acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102, | 260 | supports_mux = acpi_check_dsm(dhandle, &nouveau_dsm_muid, 0x00000102, |
263 | 1 << NOUVEAU_DSM_POWER); | 261 | 1 << NOUVEAU_DSM_POWER); |
264 | optimus_funcs = nouveau_dsm_get_optimus_functions(dhandle); | 262 | optimus_funcs = nouveau_dsm_get_optimus_functions(dhandle); |
265 | 263 | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c index e3e2f5e83815..f44682d62f75 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c | |||
@@ -81,10 +81,9 @@ mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version) | |||
81 | { | 81 | { |
82 | struct nvkm_subdev *subdev = &mxm->subdev; | 82 | struct nvkm_subdev *subdev = &mxm->subdev; |
83 | struct nvkm_device *device = subdev->device; | 83 | struct nvkm_device *device = subdev->device; |
84 | static char muid[] = { | 84 | static guid_t muid = |
85 | 0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C, | 85 | GUID_INIT(0x4004A400, 0x917D, 0x4CF2, |
86 | 0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65 | 86 | 0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65); |
87 | }; | ||
88 | u32 mxms_args[] = { 0x00000000 }; | 87 | u32 mxms_args[] = { 0x00000000 }; |
89 | union acpi_object argv4 = { | 88 | union acpi_object argv4 = { |
90 | .buffer.type = ACPI_TYPE_BUFFER, | 89 | .buffer.type = ACPI_TYPE_BUFFER, |
@@ -105,7 +104,7 @@ mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version) | |||
105 | * unless you pass in exactly the version it supports.. | 104 | * unless you pass in exactly the version it supports.. |
106 | */ | 105 | */ |
107 | rev = (version & 0xf0) << 4 | (version & 0x0f); | 106 | rev = (version & 0xf0) << 4 | (version & 0x0f); |
108 | obj = acpi_evaluate_dsm(handle, muid, rev, 0x00000010, &argv4); | 107 | obj = acpi_evaluate_dsm(handle, &muid, rev, 0x00000010, &argv4); |
109 | if (!obj) { | 108 | if (!obj) { |
110 | nvkm_debug(subdev, "DSM MXMS failed\n"); | 109 | nvkm_debug(subdev, "DSM MXMS failed\n"); |
111 | return false; | 110 | return false; |
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index fb55fb4c39fc..04015032a35a 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
@@ -872,10 +872,9 @@ static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid) | |||
872 | static int i2c_hid_acpi_pdata(struct i2c_client *client, | 872 | static int i2c_hid_acpi_pdata(struct i2c_client *client, |
873 | struct i2c_hid_platform_data *pdata) | 873 | struct i2c_hid_platform_data *pdata) |
874 | { | 874 | { |
875 | static u8 i2c_hid_guid[] = { | 875 | static guid_t i2c_hid_guid = |
876 | 0xF7, 0xF6, 0xDF, 0x3C, 0x67, 0x42, 0x55, 0x45, | 876 | GUID_INIT(0x3CDFF6F7, 0x4267, 0x4555, |
877 | 0xAD, 0x05, 0xB3, 0x0A, 0x3D, 0x89, 0x38, 0xDE, | 877 | 0xAD, 0x05, 0xB3, 0x0A, 0x3D, 0x89, 0x38, 0xDE); |
878 | }; | ||
879 | union acpi_object *obj; | 878 | union acpi_object *obj; |
880 | struct acpi_device *adev; | 879 | struct acpi_device *adev; |
881 | acpi_handle handle; | 880 | acpi_handle handle; |
@@ -884,7 +883,7 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client, | |||
884 | if (!handle || acpi_bus_get_device(handle, &adev)) | 883 | if (!handle || acpi_bus_get_device(handle, &adev)) |
885 | return -ENODEV; | 884 | return -ENODEV; |
886 | 885 | ||
887 | obj = acpi_evaluate_dsm_typed(handle, i2c_hid_guid, 1, 1, NULL, | 886 | obj = acpi_evaluate_dsm_typed(handle, &i2c_hid_guid, 1, 1, NULL, |
888 | ACPI_TYPE_INTEGER); | 887 | ACPI_TYPE_INTEGER); |
889 | if (!obj) { | 888 | if (!obj) { |
890 | dev_err(&client->dev, "device _DSM execution failed\n"); | 889 | dev_err(&client->dev, "device _DSM execution failed\n"); |
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index cbf7763d8091..c8b0329c85d2 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c | |||
@@ -1808,10 +1808,9 @@ IOMMU_INIT_POST(detect_intel_iommu); | |||
1808 | * for Directed-IO Architecture Specifiction, Rev 2.2, Section 8.8 | 1808 | * for Directed-IO Architecture Specifiction, Rev 2.2, Section 8.8 |
1809 | * "Remapping Hardware Unit Hot Plug". | 1809 | * "Remapping Hardware Unit Hot Plug". |
1810 | */ | 1810 | */ |
1811 | static u8 dmar_hp_uuid[] = { | 1811 | static guid_t dmar_hp_guid = |
1812 | /* 0000 */ 0xA6, 0xA3, 0xC1, 0xD8, 0x9B, 0xBE, 0x9B, 0x4C, | 1812 | GUID_INIT(0xD8C1A3A6, 0xBE9B, 0x4C9B, |
1813 | /* 0008 */ 0x91, 0xBF, 0xC3, 0xCB, 0x81, 0xFC, 0x5D, 0xAF | 1813 | 0x91, 0xBF, 0xC3, 0xCB, 0x81, 0xFC, 0x5D, 0xAF); |
1814 | }; | ||
1815 | 1814 | ||
1816 | /* | 1815 | /* |
1817 | * Currently there's only one revision and BIOS will not check the revision id, | 1816 | * Currently there's only one revision and BIOS will not check the revision id, |
@@ -1824,7 +1823,7 @@ static u8 dmar_hp_uuid[] = { | |||
1824 | 1823 | ||
1825 | static inline bool dmar_detect_dsm(acpi_handle handle, int func) | 1824 | static inline bool dmar_detect_dsm(acpi_handle handle, int func) |
1826 | { | 1825 | { |
1827 | return acpi_check_dsm(handle, dmar_hp_uuid, DMAR_DSM_REV_ID, 1 << func); | 1826 | return acpi_check_dsm(handle, &dmar_hp_guid, DMAR_DSM_REV_ID, 1 << func); |
1828 | } | 1827 | } |
1829 | 1828 | ||
1830 | static int dmar_walk_dsm_resource(acpi_handle handle, int func, | 1829 | static int dmar_walk_dsm_resource(acpi_handle handle, int func, |
@@ -1843,7 +1842,7 @@ static int dmar_walk_dsm_resource(acpi_handle handle, int func, | |||
1843 | if (!dmar_detect_dsm(handle, func)) | 1842 | if (!dmar_detect_dsm(handle, func)) |
1844 | return 0; | 1843 | return 0; |
1845 | 1844 | ||
1846 | obj = acpi_evaluate_dsm_typed(handle, dmar_hp_uuid, DMAR_DSM_REV_ID, | 1845 | obj = acpi_evaluate_dsm_typed(handle, &dmar_hp_guid, DMAR_DSM_REV_ID, |
1847 | func, NULL, ACPI_TYPE_BUFFER); | 1846 | func, NULL, ACPI_TYPE_BUFFER); |
1848 | if (!obj) | 1847 | if (!obj) |
1849 | return -ENODEV; | 1848 | return -ENODEV; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 87edc342ccb3..84e76ebac4d4 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -825,7 +825,7 @@ fail: | |||
825 | return -EINVAL; | 825 | return -EINVAL; |
826 | } | 826 | } |
827 | 827 | ||
828 | static int uuid_equal(mdp_super_t *sb1, mdp_super_t *sb2) | 828 | static int md_uuid_equal(mdp_super_t *sb1, mdp_super_t *sb2) |
829 | { | 829 | { |
830 | return sb1->set_uuid0 == sb2->set_uuid0 && | 830 | return sb1->set_uuid0 == sb2->set_uuid0 && |
831 | sb1->set_uuid1 == sb2->set_uuid1 && | 831 | sb1->set_uuid1 == sb2->set_uuid1 && |
@@ -833,7 +833,7 @@ static int uuid_equal(mdp_super_t *sb1, mdp_super_t *sb2) | |||
833 | sb1->set_uuid3 == sb2->set_uuid3; | 833 | sb1->set_uuid3 == sb2->set_uuid3; |
834 | } | 834 | } |
835 | 835 | ||
836 | static int sb_equal(mdp_super_t *sb1, mdp_super_t *sb2) | 836 | static int md_sb_equal(mdp_super_t *sb1, mdp_super_t *sb2) |
837 | { | 837 | { |
838 | int ret; | 838 | int ret; |
839 | mdp_super_t *tmp1, *tmp2; | 839 | mdp_super_t *tmp1, *tmp2; |
@@ -1025,12 +1025,12 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor | |||
1025 | } else { | 1025 | } else { |
1026 | __u64 ev1, ev2; | 1026 | __u64 ev1, ev2; |
1027 | mdp_super_t *refsb = page_address(refdev->sb_page); | 1027 | mdp_super_t *refsb = page_address(refdev->sb_page); |
1028 | if (!uuid_equal(refsb, sb)) { | 1028 | if (!md_uuid_equal(refsb, sb)) { |
1029 | pr_warn("md: %s has different UUID to %s\n", | 1029 | pr_warn("md: %s has different UUID to %s\n", |
1030 | b, bdevname(refdev->bdev,b2)); | 1030 | b, bdevname(refdev->bdev,b2)); |
1031 | goto abort; | 1031 | goto abort; |
1032 | } | 1032 | } |
1033 | if (!sb_equal(refsb, sb)) { | 1033 | if (!md_sb_equal(refsb, sb)) { |
1034 | pr_warn("md: %s has same UUID but different superblock to %s\n", | 1034 | pr_warn("md: %s has same UUID but different superblock to %s\n", |
1035 | b, bdevname(refdev->bdev, b2)); | 1035 | b, bdevname(refdev->bdev, b2)); |
1036 | goto abort; | 1036 | goto abort; |
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 92fc3f7c538d..18957fea82ff 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c | |||
@@ -404,10 +404,9 @@ struct intel_host { | |||
404 | bool d3_retune; | 404 | bool d3_retune; |
405 | }; | 405 | }; |
406 | 406 | ||
407 | const u8 intel_dsm_uuid[] = { | 407 | static const guid_t intel_dsm_guid = |
408 | 0xA5, 0x3E, 0xC1, 0xF6, 0xCD, 0x65, 0x1F, 0x46, | 408 | GUID_INIT(0xF6C13EA5, 0x65CD, 0x461F, |
409 | 0xAB, 0x7A, 0x29, 0xF7, 0xE8, 0xD5, 0xBD, 0x61, | 409 | 0xAB, 0x7A, 0x29, 0xF7, 0xE8, 0xD5, 0xBD, 0x61); |
410 | }; | ||
411 | 410 | ||
412 | static int __intel_dsm(struct intel_host *intel_host, struct device *dev, | 411 | static int __intel_dsm(struct intel_host *intel_host, struct device *dev, |
413 | unsigned int fn, u32 *result) | 412 | unsigned int fn, u32 *result) |
@@ -416,7 +415,7 @@ static int __intel_dsm(struct intel_host *intel_host, struct device *dev, | |||
416 | int err = 0; | 415 | int err = 0; |
417 | size_t len; | 416 | size_t len; |
418 | 417 | ||
419 | obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), intel_dsm_uuid, 0, fn, NULL); | 418 | obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL); |
420 | if (!obj) | 419 | if (!obj) |
421 | return -EOPNOTSUPP; | 420 | return -EOPNOTSUPP; |
422 | 421 | ||
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c index e13aa064a8e9..7a8addda726e 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c | |||
@@ -29,10 +29,9 @@ enum _dsm_rst_type { | |||
29 | HNS_ROCE_RESET_FUNC = 0x7, | 29 | HNS_ROCE_RESET_FUNC = 0x7, |
30 | }; | 30 | }; |
31 | 31 | ||
32 | const u8 hns_dsaf_acpi_dsm_uuid[] = { | 32 | static const guid_t hns_dsaf_acpi_dsm_guid = |
33 | 0x1A, 0xAA, 0x85, 0x1A, 0x93, 0xE2, 0x5E, 0x41, | 33 | GUID_INIT(0x1A85AA1A, 0xE293, 0x415E, |
34 | 0x8E, 0x28, 0x8D, 0x69, 0x0A, 0x0F, 0x82, 0x0A | 34 | 0x8E, 0x28, 0x8D, 0x69, 0x0A, 0x0F, 0x82, 0x0A); |
35 | }; | ||
36 | 35 | ||
37 | static void dsaf_write_sub(struct dsaf_device *dsaf_dev, u32 reg, u32 val) | 36 | static void dsaf_write_sub(struct dsaf_device *dsaf_dev, u32 reg, u32 val) |
38 | { | 37 | { |
@@ -151,7 +150,7 @@ static void hns_dsaf_acpi_srst_by_port(struct dsaf_device *dsaf_dev, u8 op_type, | |||
151 | argv4.package.elements = obj_args; | 150 | argv4.package.elements = obj_args; |
152 | 151 | ||
153 | obj = acpi_evaluate_dsm(ACPI_HANDLE(dsaf_dev->dev), | 152 | obj = acpi_evaluate_dsm(ACPI_HANDLE(dsaf_dev->dev), |
154 | hns_dsaf_acpi_dsm_uuid, 0, op_type, &argv4); | 153 | &hns_dsaf_acpi_dsm_guid, 0, op_type, &argv4); |
155 | if (!obj) { | 154 | if (!obj) { |
156 | dev_warn(dsaf_dev->dev, "reset port_type%d port%d fail!", | 155 | dev_warn(dsaf_dev->dev, "reset port_type%d port%d fail!", |
157 | port_type, port); | 156 | port_type, port); |
@@ -434,7 +433,7 @@ static phy_interface_t hns_mac_get_phy_if_acpi(struct hns_mac_cb *mac_cb) | |||
434 | argv4.package.elements = &obj_args, | 433 | argv4.package.elements = &obj_args, |
435 | 434 | ||
436 | obj = acpi_evaluate_dsm(ACPI_HANDLE(mac_cb->dev), | 435 | obj = acpi_evaluate_dsm(ACPI_HANDLE(mac_cb->dev), |
437 | hns_dsaf_acpi_dsm_uuid, 0, | 436 | &hns_dsaf_acpi_dsm_guid, 0, |
438 | HNS_OP_GET_PORT_TYPE_FUNC, &argv4); | 437 | HNS_OP_GET_PORT_TYPE_FUNC, &argv4); |
439 | 438 | ||
440 | if (!obj || obj->type != ACPI_TYPE_INTEGER) | 439 | if (!obj || obj->type != ACPI_TYPE_INTEGER) |
@@ -474,7 +473,7 @@ int hns_mac_get_sfp_prsnt_acpi(struct hns_mac_cb *mac_cb, int *sfp_prsnt) | |||
474 | argv4.package.elements = &obj_args, | 473 | argv4.package.elements = &obj_args, |
475 | 474 | ||
476 | obj = acpi_evaluate_dsm(ACPI_HANDLE(mac_cb->dev), | 475 | obj = acpi_evaluate_dsm(ACPI_HANDLE(mac_cb->dev), |
477 | hns_dsaf_acpi_dsm_uuid, 0, | 476 | &hns_dsaf_acpi_dsm_guid, 0, |
478 | HNS_OP_GET_SFP_STAT_FUNC, &argv4); | 477 | HNS_OP_GET_SFP_STAT_FUNC, &argv4); |
479 | 478 | ||
480 | if (!obj || obj->type != ACPI_TYPE_INTEGER) | 479 | if (!obj || obj->type != ACPI_TYPE_INTEGER) |
@@ -565,7 +564,7 @@ hns_mac_config_sds_loopback_acpi(struct hns_mac_cb *mac_cb, bool en) | |||
565 | argv4.package.elements = obj_args; | 564 | argv4.package.elements = obj_args; |
566 | 565 | ||
567 | obj = acpi_evaluate_dsm(ACPI_HANDLE(mac_cb->dsaf_dev->dev), | 566 | obj = acpi_evaluate_dsm(ACPI_HANDLE(mac_cb->dsaf_dev->dev), |
568 | hns_dsaf_acpi_dsm_uuid, 0, | 567 | &hns_dsaf_acpi_dsm_guid, 0, |
569 | HNS_OP_SERDES_LP_FUNC, &argv4); | 568 | HNS_OP_SERDES_LP_FUNC, &argv4); |
570 | if (!obj) { | 569 | if (!obj) { |
571 | dev_warn(mac_cb->dsaf_dev->dev, "set port%d serdes lp fail!", | 570 | dev_warn(mac_cb->dsaf_dev->dev, "set port%d serdes lp fail!", |
diff --git a/drivers/nvdimm/btt_devs.c b/drivers/nvdimm/btt_devs.c index ae00dc0d9791..4c989bb9a8a0 100644 --- a/drivers/nvdimm/btt_devs.c +++ b/drivers/nvdimm/btt_devs.c | |||
@@ -222,13 +222,6 @@ struct device *nd_btt_create(struct nd_region *nd_region) | |||
222 | return dev; | 222 | return dev; |
223 | } | 223 | } |
224 | 224 | ||
225 | static bool uuid_is_null(u8 *uuid) | ||
226 | { | ||
227 | static const u8 null_uuid[16]; | ||
228 | |||
229 | return (memcmp(uuid, null_uuid, 16) == 0); | ||
230 | } | ||
231 | |||
232 | /** | 225 | /** |
233 | * nd_btt_arena_is_valid - check if the metadata layout is valid | 226 | * nd_btt_arena_is_valid - check if the metadata layout is valid |
234 | * @nd_btt: device with BTT geometry and backing device info | 227 | * @nd_btt: device with BTT geometry and backing device info |
@@ -249,7 +242,7 @@ bool nd_btt_arena_is_valid(struct nd_btt *nd_btt, struct btt_sb *super) | |||
249 | if (memcmp(super->signature, BTT_SIG, BTT_SIG_LEN) != 0) | 242 | if (memcmp(super->signature, BTT_SIG, BTT_SIG_LEN) != 0) |
250 | return false; | 243 | return false; |
251 | 244 | ||
252 | if (!uuid_is_null(super->parent_uuid)) | 245 | if (!guid_is_null((guid_t *)&super->parent_uuid)) |
253 | if (memcmp(super->parent_uuid, parent_uuid, 16) != 0) | 246 | if (memcmp(super->parent_uuid, parent_uuid, 16) != 0) |
254 | return false; | 247 | return false; |
255 | 248 | ||
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 990e6fb32a63..c190d7e36900 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c | |||
@@ -58,7 +58,7 @@ static struct nvmf_host *nvmf_host_add(const char *hostnqn) | |||
58 | 58 | ||
59 | kref_init(&host->ref); | 59 | kref_init(&host->ref); |
60 | memcpy(host->nqn, hostnqn, NVMF_NQN_SIZE); | 60 | memcpy(host->nqn, hostnqn, NVMF_NQN_SIZE); |
61 | uuid_be_gen(&host->id); | 61 | uuid_gen(&host->id); |
62 | 62 | ||
63 | list_add_tail(&host->list, &nvmf_hosts); | 63 | list_add_tail(&host->list, &nvmf_hosts); |
64 | out_unlock: | 64 | out_unlock: |
@@ -75,7 +75,7 @@ static struct nvmf_host *nvmf_host_default(void) | |||
75 | return NULL; | 75 | return NULL; |
76 | 76 | ||
77 | kref_init(&host->ref); | 77 | kref_init(&host->ref); |
78 | uuid_be_gen(&host->id); | 78 | uuid_gen(&host->id); |
79 | snprintf(host->nqn, NVMF_NQN_SIZE, | 79 | snprintf(host->nqn, NVMF_NQN_SIZE, |
80 | "nqn.2014-08.org.nvmexpress:NVMf:uuid:%pUb", &host->id); | 80 | "nqn.2014-08.org.nvmexpress:NVMf:uuid:%pUb", &host->id); |
81 | 81 | ||
@@ -395,7 +395,7 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl) | |||
395 | if (!data) | 395 | if (!data) |
396 | return -ENOMEM; | 396 | return -ENOMEM; |
397 | 397 | ||
398 | memcpy(&data->hostid, &ctrl->opts->host->id, sizeof(uuid_be)); | 398 | uuid_copy(&data->hostid, &ctrl->opts->host->id); |
399 | data->cntlid = cpu_to_le16(0xffff); | 399 | data->cntlid = cpu_to_le16(0xffff); |
400 | strncpy(data->subsysnqn, ctrl->opts->subsysnqn, NVMF_NQN_SIZE); | 400 | strncpy(data->subsysnqn, ctrl->opts->subsysnqn, NVMF_NQN_SIZE); |
401 | strncpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE); | 401 | strncpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE); |
@@ -454,7 +454,7 @@ int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid) | |||
454 | if (!data) | 454 | if (!data) |
455 | return -ENOMEM; | 455 | return -ENOMEM; |
456 | 456 | ||
457 | memcpy(&data->hostid, &ctrl->opts->host->id, sizeof(uuid_be)); | 457 | uuid_copy(&data->hostid, &ctrl->opts->host->id); |
458 | data->cntlid = cpu_to_le16(ctrl->cntlid); | 458 | data->cntlid = cpu_to_le16(ctrl->cntlid); |
459 | strncpy(data->subsysnqn, ctrl->opts->subsysnqn, NVMF_NQN_SIZE); | 459 | strncpy(data->subsysnqn, ctrl->opts->subsysnqn, NVMF_NQN_SIZE); |
460 | strncpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE); | 460 | strncpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE); |
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h index f5a9c1fb186f..29be7600689d 100644 --- a/drivers/nvme/host/fabrics.h +++ b/drivers/nvme/host/fabrics.h | |||
@@ -36,7 +36,7 @@ struct nvmf_host { | |||
36 | struct kref ref; | 36 | struct kref ref; |
37 | struct list_head list; | 37 | struct list_head list; |
38 | char nqn[NVMF_NQN_SIZE]; | 38 | char nqn[NVMF_NQN_SIZE]; |
39 | uuid_be id; | 39 | uuid_t id; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | /** | 42 | /** |
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 92964cef0f4b..5ee4c71d168d 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c | |||
@@ -878,8 +878,7 @@ nvme_fc_connect_admin_queue(struct nvme_fc_ctrl *ctrl, | |||
878 | assoc_rqst->assoc_cmd.sqsize = cpu_to_be16(qsize); | 878 | assoc_rqst->assoc_cmd.sqsize = cpu_to_be16(qsize); |
879 | /* Linux supports only Dynamic controllers */ | 879 | /* Linux supports only Dynamic controllers */ |
880 | assoc_rqst->assoc_cmd.cntlid = cpu_to_be16(0xffff); | 880 | assoc_rqst->assoc_cmd.cntlid = cpu_to_be16(0xffff); |
881 | memcpy(&assoc_rqst->assoc_cmd.hostid, &ctrl->ctrl.opts->host->id, | 881 | uuid_copy(&assoc_rqst->assoc_cmd.hostid, &ctrl->ctrl.opts->host->id); |
882 | min_t(size_t, FCNVME_ASSOC_HOSTID_LEN, sizeof(uuid_be))); | ||
883 | strncpy(assoc_rqst->assoc_cmd.hostnqn, ctrl->ctrl.opts->host->nqn, | 882 | strncpy(assoc_rqst->assoc_cmd.hostnqn, ctrl->ctrl.opts->host->nqn, |
884 | min(FCNVME_ASSOC_HOSTNQN_LEN, NVMF_NQN_SIZE)); | 883 | min(FCNVME_ASSOC_HOSTNQN_LEN, NVMF_NQN_SIZE)); |
885 | strncpy(assoc_rqst->assoc_cmd.subnqn, ctrl->ctrl.opts->subsysnqn, | 884 | strncpy(assoc_rqst->assoc_cmd.subnqn, ctrl->ctrl.opts->subsysnqn, |
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h index cfc5c7fb0ab7..8ff6e430b30a 100644 --- a/drivers/nvme/target/nvmet.h +++ b/drivers/nvme/target/nvmet.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/percpu-refcount.h> | 21 | #include <linux/percpu-refcount.h> |
22 | #include <linux/list.h> | 22 | #include <linux/list.h> |
23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/uuid.h> | ||
24 | #include <linux/nvme.h> | 25 | #include <linux/nvme.h> |
25 | #include <linux/configfs.h> | 26 | #include <linux/configfs.h> |
26 | #include <linux/rcupdate.h> | 27 | #include <linux/rcupdate.h> |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 001860361434..47070cff508c 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -21,13 +21,12 @@ | |||
21 | #include "pci.h" | 21 | #include "pci.h" |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * The UUID is defined in the PCI Firmware Specification available here: | 24 | * The GUID is defined in the PCI Firmware Specification available here: |
25 | * https://www.pcisig.com/members/downloads/pcifw_r3_1_13Dec10.pdf | 25 | * https://www.pcisig.com/members/downloads/pcifw_r3_1_13Dec10.pdf |
26 | */ | 26 | */ |
27 | const u8 pci_acpi_dsm_uuid[] = { | 27 | const guid_t pci_acpi_dsm_guid = |
28 | 0xd0, 0x37, 0xc9, 0xe5, 0x53, 0x35, 0x7a, 0x4d, | 28 | GUID_INIT(0xe5c937d0, 0x3553, 0x4d7a, |
29 | 0x91, 0x17, 0xea, 0x4d, 0x19, 0xc3, 0x43, 0x4d | 29 | 0x91, 0x17, 0xea, 0x4d, 0x19, 0xc3, 0x43, 0x4d); |
30 | }; | ||
31 | 30 | ||
32 | #if defined(CONFIG_PCI_QUIRKS) && defined(CONFIG_ARM64) | 31 | #if defined(CONFIG_PCI_QUIRKS) && defined(CONFIG_ARM64) |
33 | static int acpi_get_rc_addr(struct acpi_device *adev, struct resource *res) | 32 | static int acpi_get_rc_addr(struct acpi_device *adev, struct resource *res) |
@@ -680,7 +679,7 @@ void acpi_pci_add_bus(struct pci_bus *bus) | |||
680 | if (!pci_is_root_bus(bus)) | 679 | if (!pci_is_root_bus(bus)) |
681 | return; | 680 | return; |
682 | 681 | ||
683 | obj = acpi_evaluate_dsm(ACPI_HANDLE(bus->bridge), pci_acpi_dsm_uuid, 3, | 682 | obj = acpi_evaluate_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 3, |
684 | RESET_DELAY_DSM, NULL); | 683 | RESET_DELAY_DSM, NULL); |
685 | if (!obj) | 684 | if (!obj) |
686 | return; | 685 | return; |
@@ -745,7 +744,7 @@ static void pci_acpi_optimize_delay(struct pci_dev *pdev, | |||
745 | if (bridge->ignore_reset_delay) | 744 | if (bridge->ignore_reset_delay) |
746 | pdev->d3cold_delay = 0; | 745 | pdev->d3cold_delay = 0; |
747 | 746 | ||
748 | obj = acpi_evaluate_dsm(handle, pci_acpi_dsm_uuid, 3, | 747 | obj = acpi_evaluate_dsm(handle, &pci_acpi_dsm_guid, 3, |
749 | FUNCTION_DELAY_DSM, NULL); | 748 | FUNCTION_DELAY_DSM, NULL); |
750 | if (!obj) | 749 | if (!obj) |
751 | return; | 750 | return; |
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c index 51357377efbc..2d8db3ead6e8 100644 --- a/drivers/pci/pci-label.c +++ b/drivers/pci/pci-label.c | |||
@@ -172,7 +172,7 @@ static int dsm_get_label(struct device *dev, char *buf, | |||
172 | if (!handle) | 172 | if (!handle) |
173 | return -1; | 173 | return -1; |
174 | 174 | ||
175 | obj = acpi_evaluate_dsm(handle, pci_acpi_dsm_uuid, 0x2, | 175 | obj = acpi_evaluate_dsm(handle, &pci_acpi_dsm_guid, 0x2, |
176 | DEVICE_LABEL_DSM, NULL); | 176 | DEVICE_LABEL_DSM, NULL); |
177 | if (!obj) | 177 | if (!obj) |
178 | return -1; | 178 | return -1; |
@@ -212,7 +212,7 @@ static bool device_has_dsm(struct device *dev) | |||
212 | if (!handle) | 212 | if (!handle) |
213 | return false; | 213 | return false; |
214 | 214 | ||
215 | return !!acpi_check_dsm(handle, pci_acpi_dsm_uuid, 0x2, | 215 | return !!acpi_check_dsm(handle, &pci_acpi_dsm_guid, 0x2, |
216 | 1 << DEVICE_LABEL_DSM); | 216 | 1 << DEVICE_LABEL_DSM); |
217 | } | 217 | } |
218 | 218 | ||
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index dc095a292c61..3be980d47268 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
@@ -245,7 +245,7 @@ struct sdebug_dev_info { | |||
245 | unsigned int channel; | 245 | unsigned int channel; |
246 | unsigned int target; | 246 | unsigned int target; |
247 | u64 lun; | 247 | u64 lun; |
248 | uuid_be lu_name; | 248 | uuid_t lu_name; |
249 | struct sdebug_host_info *sdbg_host; | 249 | struct sdebug_host_info *sdbg_host; |
250 | unsigned long uas_bm[1]; | 250 | unsigned long uas_bm[1]; |
251 | atomic_t num_in_q; | 251 | atomic_t num_in_q; |
@@ -965,7 +965,7 @@ static const u64 naa3_comp_c = 0x3111111000000000ULL; | |||
965 | static int inquiry_vpd_83(unsigned char *arr, int port_group_id, | 965 | static int inquiry_vpd_83(unsigned char *arr, int port_group_id, |
966 | int target_dev_id, int dev_id_num, | 966 | int target_dev_id, int dev_id_num, |
967 | const char *dev_id_str, int dev_id_str_len, | 967 | const char *dev_id_str, int dev_id_str_len, |
968 | const uuid_be *lu_name) | 968 | const uuid_t *lu_name) |
969 | { | 969 | { |
970 | int num, port_a; | 970 | int num, port_a; |
971 | char b[32]; | 971 | char b[32]; |
@@ -3568,7 +3568,7 @@ static void sdebug_q_cmd_wq_complete(struct work_struct *work) | |||
3568 | } | 3568 | } |
3569 | 3569 | ||
3570 | static bool got_shared_uuid; | 3570 | static bool got_shared_uuid; |
3571 | static uuid_be shared_uuid; | 3571 | static uuid_t shared_uuid; |
3572 | 3572 | ||
3573 | static struct sdebug_dev_info *sdebug_device_create( | 3573 | static struct sdebug_dev_info *sdebug_device_create( |
3574 | struct sdebug_host_info *sdbg_host, gfp_t flags) | 3574 | struct sdebug_host_info *sdbg_host, gfp_t flags) |
@@ -3578,12 +3578,12 @@ static struct sdebug_dev_info *sdebug_device_create( | |||
3578 | devip = kzalloc(sizeof(*devip), flags); | 3578 | devip = kzalloc(sizeof(*devip), flags); |
3579 | if (devip) { | 3579 | if (devip) { |
3580 | if (sdebug_uuid_ctl == 1) | 3580 | if (sdebug_uuid_ctl == 1) |
3581 | uuid_be_gen(&devip->lu_name); | 3581 | uuid_gen(&devip->lu_name); |
3582 | else if (sdebug_uuid_ctl == 2) { | 3582 | else if (sdebug_uuid_ctl == 2) { |
3583 | if (got_shared_uuid) | 3583 | if (got_shared_uuid) |
3584 | devip->lu_name = shared_uuid; | 3584 | devip->lu_name = shared_uuid; |
3585 | else { | 3585 | else { |
3586 | uuid_be_gen(&shared_uuid); | 3586 | uuid_gen(&shared_uuid); |
3587 | got_shared_uuid = true; | 3587 | got_shared_uuid = true; |
3588 | devip->lu_name = shared_uuid; | 3588 | devip->lu_name = shared_uuid; |
3589 | } | 3589 | } |
diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/thermal/int340x_thermal/int3400_thermal.c index 9413c4abf0b9..a9ec94ed7a42 100644 --- a/drivers/thermal/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/int340x_thermal/int3400_thermal.c | |||
@@ -23,7 +23,7 @@ enum int3400_thermal_uuid { | |||
23 | INT3400_THERMAL_MAXIMUM_UUID, | 23 | INT3400_THERMAL_MAXIMUM_UUID, |
24 | }; | 24 | }; |
25 | 25 | ||
26 | static u8 *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = { | 26 | static char *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = { |
27 | "42A441D6-AE6A-462b-A84B-4A8CE79027D3", | 27 | "42A441D6-AE6A-462b-A84B-4A8CE79027D3", |
28 | "3A95C389-E4B8-4629-A526-C52C88626BAE", | 28 | "3A95C389-E4B8-4629-A526-C52C88626BAE", |
29 | "97C68AE7-15FA-499c-B8C9-5DA81D606E0A", | 29 | "97C68AE7-15FA-499c-B8C9-5DA81D606E0A", |
@@ -141,10 +141,10 @@ static int int3400_thermal_get_uuids(struct int3400_thermal_priv *priv) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | for (j = 0; j < INT3400_THERMAL_MAXIMUM_UUID; j++) { | 143 | for (j = 0; j < INT3400_THERMAL_MAXIMUM_UUID; j++) { |
144 | u8 uuid[16]; | 144 | guid_t guid; |
145 | 145 | ||
146 | acpi_str_to_uuid(int3400_thermal_uuids[j], uuid); | 146 | guid_parse(int3400_thermal_uuids[j], &guid); |
147 | if (!strncmp(uuid, objb->buffer.pointer, 16)) { | 147 | if (guid_equal((guid_t *)objb->buffer.pointer, &guid)) { |
148 | priv->uuid_bitmap |= (1 << j); | 148 | priv->uuid_bitmap |= (1 << j); |
149 | break; | 149 | break; |
150 | } | 150 | } |
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 84a2cebfc712..fe851544d7fb 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee | 42 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee |
43 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e | 43 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e |
44 | 44 | ||
45 | #define PCI_INTEL_BXT_DSM_UUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" | 45 | #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" |
46 | #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 | 46 | #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 |
47 | #define PCI_INTEL_BXT_STATE_D0 0 | 47 | #define PCI_INTEL_BXT_STATE_D0 0 |
48 | #define PCI_INTEL_BXT_STATE_D3 3 | 48 | #define PCI_INTEL_BXT_STATE_D3 3 |
@@ -51,14 +51,14 @@ | |||
51 | * struct dwc3_pci - Driver private structure | 51 | * struct dwc3_pci - Driver private structure |
52 | * @dwc3: child dwc3 platform_device | 52 | * @dwc3: child dwc3 platform_device |
53 | * @pci: our link to PCI bus | 53 | * @pci: our link to PCI bus |
54 | * @uuid: _DSM UUID | 54 | * @guid: _DSM GUID |
55 | * @has_dsm_for_pm: true for devices which need to run _DSM on runtime PM | 55 | * @has_dsm_for_pm: true for devices which need to run _DSM on runtime PM |
56 | */ | 56 | */ |
57 | struct dwc3_pci { | 57 | struct dwc3_pci { |
58 | struct platform_device *dwc3; | 58 | struct platform_device *dwc3; |
59 | struct pci_dev *pci; | 59 | struct pci_dev *pci; |
60 | 60 | ||
61 | u8 uuid[16]; | 61 | guid_t guid; |
62 | 62 | ||
63 | unsigned int has_dsm_for_pm:1; | 63 | unsigned int has_dsm_for_pm:1; |
64 | }; | 64 | }; |
@@ -120,7 +120,7 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc) | |||
120 | 120 | ||
121 | if (pdev->device == PCI_DEVICE_ID_INTEL_BXT || | 121 | if (pdev->device == PCI_DEVICE_ID_INTEL_BXT || |
122 | pdev->device == PCI_DEVICE_ID_INTEL_BXT_M) { | 122 | pdev->device == PCI_DEVICE_ID_INTEL_BXT_M) { |
123 | acpi_str_to_uuid(PCI_INTEL_BXT_DSM_UUID, dwc->uuid); | 123 | guid_parse(PCI_INTEL_BXT_DSM_GUID, &dwc->guid); |
124 | dwc->has_dsm_for_pm = true; | 124 | dwc->has_dsm_for_pm = true; |
125 | } | 125 | } |
126 | 126 | ||
@@ -292,7 +292,7 @@ static int dwc3_pci_dsm(struct dwc3_pci *dwc, int param) | |||
292 | tmp.type = ACPI_TYPE_INTEGER; | 292 | tmp.type = ACPI_TYPE_INTEGER; |
293 | tmp.integer.value = param; | 293 | tmp.integer.value = param; |
294 | 294 | ||
295 | obj = acpi_evaluate_dsm(ACPI_HANDLE(&dwc->pci->dev), dwc->uuid, | 295 | obj = acpi_evaluate_dsm(ACPI_HANDLE(&dwc->pci->dev), &dwc->guid, |
296 | 1, PCI_INTEL_BXT_FUNC_PMU_PWR, &argv4); | 296 | 1, PCI_INTEL_BXT_FUNC_PMU_PWR, &argv4); |
297 | if (!obj) { | 297 | if (!obj) { |
298 | dev_err(&dwc->pci->dev, "failed to evaluate _DSM\n"); | 298 | dev_err(&dwc->pci->dev, "failed to evaluate _DSM\n"); |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 1bcf971141c0..783e6687bf4a 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -216,13 +216,12 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
216 | #ifdef CONFIG_ACPI | 216 | #ifdef CONFIG_ACPI |
217 | static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) | 217 | static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) |
218 | { | 218 | { |
219 | static const u8 intel_dsm_uuid[] = { | 219 | static const guid_t intel_dsm_guid = |
220 | 0xb7, 0x0c, 0x34, 0xac, 0x01, 0xe9, 0xbf, 0x45, | 220 | GUID_INIT(0xac340cb7, 0xe901, 0x45bf, |
221 | 0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23, | 221 | 0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23); |
222 | }; | ||
223 | union acpi_object *obj; | 222 | union acpi_object *obj; |
224 | 223 | ||
225 | obj = acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1, | 224 | obj = acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), &intel_dsm_guid, 3, 1, |
226 | NULL); | 225 | NULL); |
227 | ACPI_FREE(obj); | 226 | ACPI_FREE(obj); |
228 | } | 227 | } |
diff --git a/drivers/usb/misc/ucsi.c b/drivers/usb/misc/ucsi.c index 07397bddefa3..81251aaa20f9 100644 --- a/drivers/usb/misc/ucsi.c +++ b/drivers/usb/misc/ucsi.c | |||
@@ -55,13 +55,13 @@ struct ucsi { | |||
55 | 55 | ||
56 | static int ucsi_acpi_cmd(struct ucsi *ucsi, struct ucsi_control *ctrl) | 56 | static int ucsi_acpi_cmd(struct ucsi *ucsi, struct ucsi_control *ctrl) |
57 | { | 57 | { |
58 | uuid_le uuid = UUID_LE(0x6f8398c2, 0x7ca4, 0x11e4, | 58 | guid_t guid = GUID_INIT(0x6f8398c2, 0x7ca4, 0x11e4, |
59 | 0xad, 0x36, 0x63, 0x10, 0x42, 0xb5, 0x00, 0x8f); | 59 | 0xad, 0x36, 0x63, 0x10, 0x42, 0xb5, 0x00, 0x8f); |
60 | union acpi_object *obj; | 60 | union acpi_object *obj; |
61 | 61 | ||
62 | ucsi->data->ctrl.raw_cmd = ctrl->raw_cmd; | 62 | ucsi->data->ctrl.raw_cmd = ctrl->raw_cmd; |
63 | 63 | ||
64 | obj = acpi_evaluate_dsm(ACPI_HANDLE(ucsi->dev), uuid.b, 1, 1, NULL); | 64 | obj = acpi_evaluate_dsm(ACPI_HANDLE(ucsi->dev), &guid, 1, 1, NULL); |
65 | if (!obj) { | 65 | if (!obj) { |
66 | dev_err(ucsi->dev, "%s: failed to evaluate _DSM\n", __func__); | 66 | dev_err(ucsi->dev, "%s: failed to evaluate _DSM\n", __func__); |
67 | return -EIO; | 67 | return -EIO; |
diff --git a/drivers/usb/typec/typec_wcove.c b/drivers/usb/typec/typec_wcove.c index d5a7b21fa3f1..c2ce25289027 100644 --- a/drivers/usb/typec/typec_wcove.c +++ b/drivers/usb/typec/typec_wcove.c | |||
@@ -105,8 +105,8 @@ enum wcove_typec_role { | |||
105 | WCOVE_ROLE_DEVICE, | 105 | WCOVE_ROLE_DEVICE, |
106 | }; | 106 | }; |
107 | 107 | ||
108 | static uuid_le uuid = UUID_LE(0x482383f0, 0x2876, 0x4e49, | 108 | static guid_t guid = GUID_INIT(0x482383f0, 0x2876, 0x4e49, |
109 | 0x86, 0x85, 0xdb, 0x66, 0x21, 0x1a, 0xf0, 0x37); | 109 | 0x86, 0x85, 0xdb, 0x66, 0x21, 0x1a, 0xf0, 0x37); |
110 | 110 | ||
111 | static int wcove_typec_func(struct wcove_typec *wcove, | 111 | static int wcove_typec_func(struct wcove_typec *wcove, |
112 | enum wcove_typec_func func, int param) | 112 | enum wcove_typec_func func, int param) |
@@ -118,7 +118,7 @@ static int wcove_typec_func(struct wcove_typec *wcove, | |||
118 | tmp.type = ACPI_TYPE_INTEGER; | 118 | tmp.type = ACPI_TYPE_INTEGER; |
119 | tmp.integer.value = param; | 119 | tmp.integer.value = param; |
120 | 120 | ||
121 | obj = acpi_evaluate_dsm(ACPI_HANDLE(wcove->dev), uuid.b, 1, func, | 121 | obj = acpi_evaluate_dsm(ACPI_HANDLE(wcove->dev), &guid, 1, func, |
122 | &argv4); | 122 | &argv4); |
123 | if (!obj) { | 123 | if (!obj) { |
124 | dev_err(wcove->dev, "%s: failed to evaluate _DSM\n", __func__); | 124 | dev_err(wcove->dev, "%s: failed to evaluate _DSM\n", __func__); |
@@ -314,7 +314,7 @@ static int wcove_typec_probe(struct platform_device *pdev) | |||
314 | if (ret) | 314 | if (ret) |
315 | return ret; | 315 | return ret; |
316 | 316 | ||
317 | if (!acpi_check_dsm(ACPI_HANDLE(&pdev->dev), uuid.b, 0, 0x1f)) { | 317 | if (!acpi_check_dsm(ACPI_HANDLE(&pdev->dev), &guid, 0, 0x1f)) { |
318 | dev_err(&pdev->dev, "Missing _DSM functions\n"); | 318 | dev_err(&pdev->dev, "Missing _DSM functions\n"); |
319 | return -ENODEV; | 319 | return -ENODEV; |
320 | } | 320 | } |
diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c index 4ac2ca8a7656..bf13d1ec51f3 100644 --- a/drivers/xen/tmem.c +++ b/drivers/xen/tmem.c | |||
@@ -233,12 +233,12 @@ static int tmem_cleancache_init_fs(size_t pagesize) | |||
233 | return xen_tmem_new_pool(uuid_private, 0, pagesize); | 233 | return xen_tmem_new_pool(uuid_private, 0, pagesize); |
234 | } | 234 | } |
235 | 235 | ||
236 | static int tmem_cleancache_init_shared_fs(char *uuid, size_t pagesize) | 236 | static int tmem_cleancache_init_shared_fs(uuid_t *uuid, size_t pagesize) |
237 | { | 237 | { |
238 | struct tmem_pool_uuid shared_uuid; | 238 | struct tmem_pool_uuid shared_uuid; |
239 | 239 | ||
240 | shared_uuid.uuid_lo = *(u64 *)uuid; | 240 | shared_uuid.uuid_lo = *(u64 *)&uuid->b[0]; |
241 | shared_uuid.uuid_hi = *(u64 *)(&uuid[8]); | 241 | shared_uuid.uuid_hi = *(u64 *)&uuid->b[8]; |
242 | return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize); | 242 | return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize); |
243 | } | 243 | } |
244 | 244 | ||
diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c index 3062cceb5c2a..782d4d05a53b 100644 --- a/fs/afs/cmservice.c +++ b/fs/afs/cmservice.c | |||
@@ -350,7 +350,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call) | |||
350 | { | 350 | { |
351 | struct sockaddr_rxrpc srx; | 351 | struct sockaddr_rxrpc srx; |
352 | struct afs_server *server; | 352 | struct afs_server *server; |
353 | struct uuid_v1 *r; | 353 | struct afs_uuid *r; |
354 | unsigned loop; | 354 | unsigned loop; |
355 | __be32 *b; | 355 | __be32 *b; |
356 | int ret; | 356 | int ret; |
@@ -380,7 +380,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call) | |||
380 | } | 380 | } |
381 | 381 | ||
382 | _debug("unmarshall UUID"); | 382 | _debug("unmarshall UUID"); |
383 | call->request = kmalloc(sizeof(struct uuid_v1), GFP_KERNEL); | 383 | call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL); |
384 | if (!call->request) | 384 | if (!call->request) |
385 | return -ENOMEM; | 385 | return -ENOMEM; |
386 | 386 | ||
@@ -453,7 +453,7 @@ static int afs_deliver_cb_probe(struct afs_call *call) | |||
453 | static void SRXAFSCB_ProbeUuid(struct work_struct *work) | 453 | static void SRXAFSCB_ProbeUuid(struct work_struct *work) |
454 | { | 454 | { |
455 | struct afs_call *call = container_of(work, struct afs_call, work); | 455 | struct afs_call *call = container_of(work, struct afs_call, work); |
456 | struct uuid_v1 *r = call->request; | 456 | struct afs_uuid *r = call->request; |
457 | 457 | ||
458 | struct { | 458 | struct { |
459 | __be32 match; | 459 | __be32 match; |
@@ -476,7 +476,7 @@ static void SRXAFSCB_ProbeUuid(struct work_struct *work) | |||
476 | */ | 476 | */ |
477 | static int afs_deliver_cb_probe_uuid(struct afs_call *call) | 477 | static int afs_deliver_cb_probe_uuid(struct afs_call *call) |
478 | { | 478 | { |
479 | struct uuid_v1 *r; | 479 | struct afs_uuid *r; |
480 | unsigned loop; | 480 | unsigned loop; |
481 | __be32 *b; | 481 | __be32 *b; |
482 | int ret; | 482 | int ret; |
@@ -502,15 +502,15 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call) | |||
502 | } | 502 | } |
503 | 503 | ||
504 | _debug("unmarshall UUID"); | 504 | _debug("unmarshall UUID"); |
505 | call->request = kmalloc(sizeof(struct uuid_v1), GFP_KERNEL); | 505 | call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL); |
506 | if (!call->request) | 506 | if (!call->request) |
507 | return -ENOMEM; | 507 | return -ENOMEM; |
508 | 508 | ||
509 | b = call->buffer; | 509 | b = call->buffer; |
510 | r = call->request; | 510 | r = call->request; |
511 | r->time_low = b[0]; | 511 | r->time_low = ntohl(b[0]); |
512 | r->time_mid = htons(ntohl(b[1])); | 512 | r->time_mid = ntohl(b[1]); |
513 | r->time_hi_and_version = htons(ntohl(b[2])); | 513 | r->time_hi_and_version = ntohl(b[2]); |
514 | r->clock_seq_hi_and_reserved = ntohl(b[3]); | 514 | r->clock_seq_hi_and_reserved = ntohl(b[3]); |
515 | r->clock_seq_low = ntohl(b[4]); | 515 | r->clock_seq_low = ntohl(b[4]); |
516 | 516 | ||
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 393672997cc2..4e2556606623 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h | |||
@@ -410,6 +410,15 @@ struct afs_interface { | |||
410 | unsigned mtu; /* MTU of interface */ | 410 | unsigned mtu; /* MTU of interface */ |
411 | }; | 411 | }; |
412 | 412 | ||
413 | struct afs_uuid { | ||
414 | __be32 time_low; /* low part of timestamp */ | ||
415 | __be16 time_mid; /* mid part of timestamp */ | ||
416 | __be16 time_hi_and_version; /* high part of timestamp and version */ | ||
417 | __u8 clock_seq_hi_and_reserved; /* clock seq hi and variant */ | ||
418 | __u8 clock_seq_low; /* clock seq low */ | ||
419 | __u8 node[6]; /* spatially unique node ID (MAC addr) */ | ||
420 | }; | ||
421 | |||
413 | /*****************************************************************************/ | 422 | /*****************************************************************************/ |
414 | /* | 423 | /* |
415 | * cache.c | 424 | * cache.c |
@@ -544,7 +553,7 @@ extern int afs_drop_inode(struct inode *); | |||
544 | * main.c | 553 | * main.c |
545 | */ | 554 | */ |
546 | extern struct workqueue_struct *afs_wq; | 555 | extern struct workqueue_struct *afs_wq; |
547 | extern struct uuid_v1 afs_uuid; | 556 | extern struct afs_uuid afs_uuid; |
548 | 557 | ||
549 | /* | 558 | /* |
550 | * misc.c | 559 | * misc.c |
diff --git a/fs/afs/main.c b/fs/afs/main.c index 51d7d17bca57..9944770849da 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c | |||
@@ -31,7 +31,7 @@ static char *rootcell; | |||
31 | module_param(rootcell, charp, 0); | 31 | module_param(rootcell, charp, 0); |
32 | MODULE_PARM_DESC(rootcell, "root AFS cell name and VL server IP addr list"); | 32 | MODULE_PARM_DESC(rootcell, "root AFS cell name and VL server IP addr list"); |
33 | 33 | ||
34 | struct uuid_v1 afs_uuid; | 34 | struct afs_uuid afs_uuid; |
35 | struct workqueue_struct *afs_wq; | 35 | struct workqueue_struct *afs_wq; |
36 | 36 | ||
37 | /* | 37 | /* |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index d37c81f327e7..9006cb5857b8 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3950,7 +3950,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3950 | sb->s_qcop = &ext4_qctl_operations; | 3950 | sb->s_qcop = &ext4_qctl_operations; |
3951 | sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ; | 3951 | sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ; |
3952 | #endif | 3952 | #endif |
3953 | memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); | 3953 | memcpy(&sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); |
3954 | 3954 | ||
3955 | INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ | 3955 | INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ |
3956 | mutex_init(&sbi->s_orphan_lock); | 3956 | mutex_init(&sbi->s_orphan_lock); |
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 83355ec4a92c..0b89b0b7b9f7 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -1937,7 +1937,7 @@ try_onemore: | |||
1937 | sb->s_time_gran = 1; | 1937 | sb->s_time_gran = 1; |
1938 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | 1938 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |
1939 | (test_opt(sbi, POSIX_ACL) ? MS_POSIXACL : 0); | 1939 | (test_opt(sbi, POSIX_ACL) ? MS_POSIXACL : 0); |
1940 | memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid)); | 1940 | memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid)); |
1941 | 1941 | ||
1942 | /* init f2fs-specific super block info */ | 1942 | /* init f2fs-specific super block info */ |
1943 | sbi->valid_super_block = valid_super_block; | 1943 | sbi->valid_super_block = valid_super_block; |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index ed67548b286c..b92135c202c2 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -203,7 +203,7 @@ static void gfs2_sb_in(struct gfs2_sbd *sdp, const void *buf) | |||
203 | 203 | ||
204 | memcpy(sb->sb_lockproto, str->sb_lockproto, GFS2_LOCKNAME_LEN); | 204 | memcpy(sb->sb_lockproto, str->sb_lockproto, GFS2_LOCKNAME_LEN); |
205 | memcpy(sb->sb_locktable, str->sb_locktable, GFS2_LOCKNAME_LEN); | 205 | memcpy(sb->sb_locktable, str->sb_locktable, GFS2_LOCKNAME_LEN); |
206 | memcpy(s->s_uuid, str->sb_uuid, 16); | 206 | memcpy(&s->s_uuid, str->sb_uuid, 16); |
207 | } | 207 | } |
208 | 208 | ||
209 | /** | 209 | /** |
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 7a515345610c..e77bc52b468f 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c | |||
@@ -71,25 +71,14 @@ static ssize_t fsname_show(struct gfs2_sbd *sdp, char *buf) | |||
71 | return snprintf(buf, PAGE_SIZE, "%s\n", sdp->sd_fsname); | 71 | return snprintf(buf, PAGE_SIZE, "%s\n", sdp->sd_fsname); |
72 | } | 72 | } |
73 | 73 | ||
74 | static int gfs2_uuid_valid(const u8 *uuid) | ||
75 | { | ||
76 | int i; | ||
77 | |||
78 | for (i = 0; i < 16; i++) { | ||
79 | if (uuid[i]) | ||
80 | return 1; | ||
81 | } | ||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | static ssize_t uuid_show(struct gfs2_sbd *sdp, char *buf) | 74 | static ssize_t uuid_show(struct gfs2_sbd *sdp, char *buf) |
86 | { | 75 | { |
87 | struct super_block *s = sdp->sd_vfs; | 76 | struct super_block *s = sdp->sd_vfs; |
88 | const u8 *uuid = s->s_uuid; | 77 | |
89 | buf[0] = '\0'; | 78 | buf[0] = '\0'; |
90 | if (!gfs2_uuid_valid(uuid)) | 79 | if (uuid_is_null(&s->s_uuid)) |
91 | return 0; | 80 | return 0; |
92 | return snprintf(buf, PAGE_SIZE, "%pUB\n", uuid); | 81 | return snprintf(buf, PAGE_SIZE, "%pUB\n", &s->s_uuid); |
93 | } | 82 | } |
94 | 83 | ||
95 | static ssize_t freeze_show(struct gfs2_sbd *sdp, char *buf) | 84 | static ssize_t freeze_show(struct gfs2_sbd *sdp, char *buf) |
@@ -712,14 +701,13 @@ static int gfs2_uevent(struct kset *kset, struct kobject *kobj, | |||
712 | { | 701 | { |
713 | struct gfs2_sbd *sdp = container_of(kobj, struct gfs2_sbd, sd_kobj); | 702 | struct gfs2_sbd *sdp = container_of(kobj, struct gfs2_sbd, sd_kobj); |
714 | struct super_block *s = sdp->sd_vfs; | 703 | struct super_block *s = sdp->sd_vfs; |
715 | const u8 *uuid = s->s_uuid; | ||
716 | 704 | ||
717 | add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name); | 705 | add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name); |
718 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); | 706 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); |
719 | if (!test_bit(SDF_NOJOURNALID, &sdp->sd_flags)) | 707 | if (!test_bit(SDF_NOJOURNALID, &sdp->sd_flags)) |
720 | add_uevent_var(env, "JOURNALID=%d", sdp->sd_lockstruct.ls_jid); | 708 | add_uevent_var(env, "JOURNALID=%d", sdp->sd_lockstruct.ls_jid); |
721 | if (gfs2_uuid_valid(uuid)) | 709 | if (!uuid_is_null(&s->s_uuid)) |
722 | add_uevent_var(env, "UUID=%pUB", uuid); | 710 | add_uevent_var(env, "UUID=%pUB", &s->s_uuid); |
723 | return 0; | 711 | return 0; |
724 | } | 712 | } |
725 | 713 | ||
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index e71f11b1a180..3bc08c394a3f 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -486,7 +486,7 @@ secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { return 0; } | |||
486 | #endif | 486 | #endif |
487 | 487 | ||
488 | static inline int | 488 | static inline int |
489 | uuid_parse(char **mesg, char *buf, unsigned char **puuid) | 489 | nfsd_uuid_parse(char **mesg, char *buf, unsigned char **puuid) |
490 | { | 490 | { |
491 | int len; | 491 | int len; |
492 | 492 | ||
@@ -586,7 +586,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
586 | if (strcmp(buf, "fsloc") == 0) | 586 | if (strcmp(buf, "fsloc") == 0) |
587 | err = fsloc_parse(&mesg, buf, &exp.ex_fslocs); | 587 | err = fsloc_parse(&mesg, buf, &exp.ex_fslocs); |
588 | else if (strcmp(buf, "uuid") == 0) | 588 | else if (strcmp(buf, "uuid") == 0) |
589 | err = uuid_parse(&mesg, buf, &exp.ex_uuid); | 589 | err = nfsd_uuid_parse(&mesg, buf, &exp.ex_uuid); |
590 | else if (strcmp(buf, "secinfo") == 0) | 590 | else if (strcmp(buf, "secinfo") == 0) |
591 | err = secinfo_parse(&mesg, buf, &exp); | 591 | err = secinfo_parse(&mesg, buf, &exp); |
592 | else | 592 | else |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index ca1646fbcaef..83005f486451 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -2062,7 +2062,7 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
2062 | cbits = le32_to_cpu(di->id2.i_super.s_clustersize_bits); | 2062 | cbits = le32_to_cpu(di->id2.i_super.s_clustersize_bits); |
2063 | bbits = le32_to_cpu(di->id2.i_super.s_blocksize_bits); | 2063 | bbits = le32_to_cpu(di->id2.i_super.s_blocksize_bits); |
2064 | sb->s_maxbytes = ocfs2_max_file_offset(bbits, cbits); | 2064 | sb->s_maxbytes = ocfs2_max_file_offset(bbits, cbits); |
2065 | memcpy(sb->s_uuid, di->id2.i_super.s_uuid, | 2065 | memcpy(&sb->s_uuid, di->id2.i_super.s_uuid, |
2066 | sizeof(di->id2.i_super.s_uuid)); | 2066 | sizeof(di->id2.i_super.s_uuid)); |
2067 | 2067 | ||
2068 | osb->osb_dx_mask = (1 << (cbits - bbits)) - 1; | 2068 | osb->osb_dx_mask = (1 << (cbits - bbits)) - 1; |
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index a2a65120c9d0..e5869f91b3ab 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c | |||
@@ -233,7 +233,7 @@ int ovl_set_attr(struct dentry *upperdentry, struct kstat *stat) | |||
233 | return err; | 233 | return err; |
234 | } | 234 | } |
235 | 235 | ||
236 | static struct ovl_fh *ovl_encode_fh(struct dentry *lower, uuid_be *uuid) | 236 | static struct ovl_fh *ovl_encode_fh(struct dentry *lower, uuid_t *uuid) |
237 | { | 237 | { |
238 | struct ovl_fh *fh; | 238 | struct ovl_fh *fh; |
239 | int fh_type, fh_len, dwords; | 239 | int fh_type, fh_len, dwords; |
@@ -284,7 +284,6 @@ static int ovl_set_origin(struct dentry *dentry, struct dentry *lower, | |||
284 | struct dentry *upper) | 284 | struct dentry *upper) |
285 | { | 285 | { |
286 | struct super_block *sb = lower->d_sb; | 286 | struct super_block *sb = lower->d_sb; |
287 | uuid_be *uuid = (uuid_be *) &sb->s_uuid; | ||
288 | const struct ovl_fh *fh = NULL; | 287 | const struct ovl_fh *fh = NULL; |
289 | int err; | 288 | int err; |
290 | 289 | ||
@@ -294,8 +293,8 @@ static int ovl_set_origin(struct dentry *dentry, struct dentry *lower, | |||
294 | * up and a pure upper inode. | 293 | * up and a pure upper inode. |
295 | */ | 294 | */ |
296 | if (sb->s_export_op && sb->s_export_op->fh_to_dentry && | 295 | if (sb->s_export_op && sb->s_export_op->fh_to_dentry && |
297 | uuid_be_cmp(*uuid, NULL_UUID_BE)) { | 296 | !uuid_is_null(&sb->s_uuid)) { |
298 | fh = ovl_encode_fh(lower, uuid); | 297 | fh = ovl_encode_fh(lower, &sb->s_uuid); |
299 | if (IS_ERR(fh)) | 298 | if (IS_ERR(fh)) |
300 | return PTR_ERR(fh); | 299 | return PTR_ERR(fh); |
301 | } | 300 | } |
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index f3136c31e72a..de0d4f742f36 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c | |||
@@ -135,7 +135,7 @@ static struct dentry *ovl_get_origin(struct dentry *dentry, | |||
135 | * Make sure that the stored uuid matches the uuid of the lower | 135 | * Make sure that the stored uuid matches the uuid of the lower |
136 | * layer where file handle will be decoded. | 136 | * layer where file handle will be decoded. |
137 | */ | 137 | */ |
138 | if (uuid_be_cmp(fh->uuid, *(uuid_be *) &mnt->mnt_sb->s_uuid)) | 138 | if (!uuid_equal(&fh->uuid, &mnt->mnt_sb->s_uuid)) |
139 | goto out; | 139 | goto out; |
140 | 140 | ||
141 | origin = exportfs_decode_fh(mnt, (struct fid *)fh->fid, | 141 | origin = exportfs_decode_fh(mnt, (struct fid *)fh->fid, |
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index 0623cebeefff..10863b4105fa 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h | |||
@@ -56,7 +56,7 @@ struct ovl_fh { | |||
56 | u8 len; /* size of this header + size of fid */ | 56 | u8 len; /* size of this header + size of fid */ |
57 | u8 flags; /* OVL_FH_FLAG_* */ | 57 | u8 flags; /* OVL_FH_FLAG_* */ |
58 | u8 type; /* fid_type of fid */ | 58 | u8 type; /* fid_type of fid */ |
59 | uuid_be uuid; /* uuid of filesystem */ | 59 | uuid_t uuid; /* uuid of filesystem */ |
60 | u8 fid[0]; /* file identifier */ | 60 | u8 fid[0]; /* file identifier */ |
61 | } __packed; | 61 | } __packed; |
62 | 62 | ||
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 5c90f82b8f6b..a6e955bfead8 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile | |||
@@ -98,8 +98,7 @@ xfs-y += xfs_aops.o \ | |||
98 | xfs_sysfs.o \ | 98 | xfs_sysfs.o \ |
99 | xfs_trans.o \ | 99 | xfs_trans.o \ |
100 | xfs_xattr.o \ | 100 | xfs_xattr.o \ |
101 | kmem.o \ | 101 | kmem.o |
102 | uuid.o | ||
103 | 102 | ||
104 | # low-level transaction/log code | 103 | # low-level transaction/log code |
105 | xfs-y += xfs_log.o \ | 104 | xfs-y += xfs_log.o \ |
diff --git a/fs/xfs/uuid.c b/fs/xfs/uuid.c deleted file mode 100644 index b83f76b6d410..000000000000 --- a/fs/xfs/uuid.c +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. | ||
3 | * All Rights Reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it would be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write the Free Software Foundation, | ||
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | #include <xfs.h> | ||
19 | |||
20 | /* IRIX interpretation of an uuid_t */ | ||
21 | typedef struct { | ||
22 | __be32 uu_timelow; | ||
23 | __be16 uu_timemid; | ||
24 | __be16 uu_timehi; | ||
25 | __be16 uu_clockseq; | ||
26 | __be16 uu_node[3]; | ||
27 | } xfs_uu_t; | ||
28 | |||
29 | /* | ||
30 | * uuid_getnodeuniq - obtain the node unique fields of a UUID. | ||
31 | * | ||
32 | * This is not in any way a standard or condoned UUID function; | ||
33 | * it just something that's needed for user-level file handles. | ||
34 | */ | ||
35 | void | ||
36 | uuid_getnodeuniq(uuid_t *uuid, int fsid [2]) | ||
37 | { | ||
38 | xfs_uu_t *uup = (xfs_uu_t *)uuid; | ||
39 | |||
40 | fsid[0] = (be16_to_cpu(uup->uu_clockseq) << 16) | | ||
41 | be16_to_cpu(uup->uu_timemid); | ||
42 | fsid[1] = be32_to_cpu(uup->uu_timelow); | ||
43 | } | ||
44 | |||
45 | int | ||
46 | uuid_is_nil(uuid_t *uuid) | ||
47 | { | ||
48 | int i; | ||
49 | char *cp = (char *)uuid; | ||
50 | |||
51 | if (uuid == NULL) | ||
52 | return 0; | ||
53 | /* implied check of version number here... */ | ||
54 | for (i = 0; i < sizeof *uuid; i++) | ||
55 | if (*cp++) return 0; /* not nil */ | ||
56 | return 1; /* is nil */ | ||
57 | } | ||
58 | |||
59 | int | ||
60 | uuid_equal(uuid_t *uuid1, uuid_t *uuid2) | ||
61 | { | ||
62 | return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? 0 : 1; | ||
63 | } | ||
diff --git a/fs/xfs/uuid.h b/fs/xfs/uuid.h deleted file mode 100644 index 104db0f3bed6..000000000000 --- a/fs/xfs/uuid.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. | ||
3 | * All Rights Reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it would be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write the Free Software Foundation, | ||
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | #ifndef __XFS_SUPPORT_UUID_H__ | ||
19 | #define __XFS_SUPPORT_UUID_H__ | ||
20 | |||
21 | typedef struct { | ||
22 | unsigned char __u_bits[16]; | ||
23 | } uuid_t; | ||
24 | |||
25 | extern int uuid_is_nil(uuid_t *uuid); | ||
26 | extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2); | ||
27 | extern void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]); | ||
28 | |||
29 | static inline void | ||
30 | uuid_copy(uuid_t *dst, uuid_t *src) | ||
31 | { | ||
32 | memcpy(dst, src, sizeof(uuid_t)); | ||
33 | } | ||
34 | |||
35 | #endif /* __XFS_SUPPORT_UUID_H__ */ | ||
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 08cb7d1a4a3a..013cc78d7daf 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -834,9 +834,7 @@ xfs_inode_item_format_convert( | |||
834 | in_f->ilf_dsize = in_f32->ilf_dsize; | 834 | in_f->ilf_dsize = in_f32->ilf_dsize; |
835 | in_f->ilf_ino = in_f32->ilf_ino; | 835 | in_f->ilf_ino = in_f32->ilf_ino; |
836 | /* copy biggest field of ilf_u */ | 836 | /* copy biggest field of ilf_u */ |
837 | memcpy(in_f->ilf_u.ilfu_uuid.__u_bits, | 837 | uuid_copy(&in_f->ilf_u.ilfu_uuid, &in_f32->ilf_u.ilfu_uuid); |
838 | in_f32->ilf_u.ilfu_uuid.__u_bits, | ||
839 | sizeof(uuid_t)); | ||
840 | in_f->ilf_blkno = in_f32->ilf_blkno; | 838 | in_f->ilf_blkno = in_f32->ilf_blkno; |
841 | in_f->ilf_len = in_f32->ilf_len; | 839 | in_f->ilf_len = in_f32->ilf_len; |
842 | in_f->ilf_boffset = in_f32->ilf_boffset; | 840 | in_f->ilf_boffset = in_f32->ilf_boffset; |
@@ -851,9 +849,7 @@ xfs_inode_item_format_convert( | |||
851 | in_f->ilf_dsize = in_f64->ilf_dsize; | 849 | in_f->ilf_dsize = in_f64->ilf_dsize; |
852 | in_f->ilf_ino = in_f64->ilf_ino; | 850 | in_f->ilf_ino = in_f64->ilf_ino; |
853 | /* copy biggest field of ilf_u */ | 851 | /* copy biggest field of ilf_u */ |
854 | memcpy(in_f->ilf_u.ilfu_uuid.__u_bits, | 852 | uuid_copy(&in_f->ilf_u.ilfu_uuid, &in_f64->ilf_u.ilfu_uuid); |
855 | in_f64->ilf_u.ilfu_uuid.__u_bits, | ||
856 | sizeof(uuid_t)); | ||
857 | in_f->ilf_blkno = in_f64->ilf_blkno; | 853 | in_f->ilf_blkno = in_f64->ilf_blkno; |
858 | in_f->ilf_len = in_f64->ilf_len; | 854 | in_f->ilf_len = in_f64->ilf_len; |
859 | in_f->ilf_boffset = in_f64->ilf_boffset; | 855 | in_f->ilf_boffset = in_f64->ilf_boffset; |
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index 044fb0e15390..2d167fe643ec 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define __XFS_LINUX__ | 19 | #define __XFS_LINUX__ |
20 | 20 | ||
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <linux/uuid.h> | ||
22 | 23 | ||
23 | /* | 24 | /* |
24 | * Kernel specific type declarations for XFS | 25 | * Kernel specific type declarations for XFS |
@@ -42,7 +43,6 @@ typedef __u32 xfs_nlink_t; | |||
42 | 43 | ||
43 | #include "kmem.h" | 44 | #include "kmem.h" |
44 | #include "mrlock.h" | 45 | #include "mrlock.h" |
45 | #include "uuid.h" | ||
46 | 46 | ||
47 | #include <linux/semaphore.h> | 47 | #include <linux/semaphore.h> |
48 | #include <linux/mm.h> | 48 | #include <linux/mm.h> |
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index cd0b077deb35..8cec1e5505a4 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -352,13 +352,13 @@ xlog_header_check_mount( | |||
352 | { | 352 | { |
353 | ASSERT(head->h_magicno == cpu_to_be32(XLOG_HEADER_MAGIC_NUM)); | 353 | ASSERT(head->h_magicno == cpu_to_be32(XLOG_HEADER_MAGIC_NUM)); |
354 | 354 | ||
355 | if (uuid_is_nil(&head->h_fs_uuid)) { | 355 | if (uuid_is_null(&head->h_fs_uuid)) { |
356 | /* | 356 | /* |
357 | * IRIX doesn't write the h_fs_uuid or h_fmt fields. If | 357 | * IRIX doesn't write the h_fs_uuid or h_fmt fields. If |
358 | * h_fs_uuid is nil, we assume this log was last mounted | 358 | * h_fs_uuid is null, we assume this log was last mounted |
359 | * by IRIX and continue. | 359 | * by IRIX and continue. |
360 | */ | 360 | */ |
361 | xfs_warn(mp, "nil uuid in log - IRIX style log"); | 361 | xfs_warn(mp, "null uuid in log - IRIX style log"); |
362 | } else if (unlikely(!uuid_equal(&mp->m_sb.sb_uuid, &head->h_fs_uuid))) { | 362 | } else if (unlikely(!uuid_equal(&mp->m_sb.sb_uuid, &head->h_fs_uuid))) { |
363 | xfs_warn(mp, "log has mismatched uuid - can't recover"); | 363 | xfs_warn(mp, "log has mismatched uuid - can't recover"); |
364 | xlog_header_check_dump(mp, head); | 364 | xlog_header_check_dump(mp, head); |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 2eaf81859166..d249546da15e 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -74,20 +74,19 @@ xfs_uuid_mount( | |||
74 | int hole, i; | 74 | int hole, i; |
75 | 75 | ||
76 | /* Publish UUID in struct super_block */ | 76 | /* Publish UUID in struct super_block */ |
77 | BUILD_BUG_ON(sizeof(mp->m_super->s_uuid) != sizeof(uuid_t)); | 77 | uuid_copy(&mp->m_super->s_uuid, uuid); |
78 | memcpy(&mp->m_super->s_uuid, uuid, sizeof(uuid_t)); | ||
79 | 78 | ||
80 | if (mp->m_flags & XFS_MOUNT_NOUUID) | 79 | if (mp->m_flags & XFS_MOUNT_NOUUID) |
81 | return 0; | 80 | return 0; |
82 | 81 | ||
83 | if (uuid_is_nil(uuid)) { | 82 | if (uuid_is_null(uuid)) { |
84 | xfs_warn(mp, "Filesystem has nil UUID - can't mount"); | 83 | xfs_warn(mp, "Filesystem has null UUID - can't mount"); |
85 | return -EINVAL; | 84 | return -EINVAL; |
86 | } | 85 | } |
87 | 86 | ||
88 | mutex_lock(&xfs_uuid_table_mutex); | 87 | mutex_lock(&xfs_uuid_table_mutex); |
89 | for (i = 0, hole = -1; i < xfs_uuid_table_size; i++) { | 88 | for (i = 0, hole = -1; i < xfs_uuid_table_size; i++) { |
90 | if (uuid_is_nil(&xfs_uuid_table[i])) { | 89 | if (uuid_is_null(&xfs_uuid_table[i])) { |
91 | hole = i; | 90 | hole = i; |
92 | continue; | 91 | continue; |
93 | } | 92 | } |
@@ -124,7 +123,7 @@ xfs_uuid_unmount( | |||
124 | 123 | ||
125 | mutex_lock(&xfs_uuid_table_mutex); | 124 | mutex_lock(&xfs_uuid_table_mutex); |
126 | for (i = 0; i < xfs_uuid_table_size; i++) { | 125 | for (i = 0; i < xfs_uuid_table_size; i++) { |
127 | if (uuid_is_nil(&xfs_uuid_table[i])) | 126 | if (uuid_is_null(&xfs_uuid_table[i])) |
128 | continue; | 127 | continue; |
129 | if (!uuid_equal(uuid, &xfs_uuid_table[i])) | 128 | if (!uuid_equal(uuid, &xfs_uuid_table[i])) |
130 | continue; | 129 | continue; |
@@ -793,7 +792,10 @@ xfs_mountfs( | |||
793 | * Copies the low order bits of the timestamp and the randomly | 792 | * Copies the low order bits of the timestamp and the randomly |
794 | * set "sequence" number out of a UUID. | 793 | * set "sequence" number out of a UUID. |
795 | */ | 794 | */ |
796 | uuid_getnodeuniq(&sbp->sb_uuid, mp->m_fixedfsid); | 795 | mp->m_fixedfsid[0] = |
796 | (get_unaligned_be16(&sbp->sb_uuid.b[8]) << 16) | | ||
797 | get_unaligned_be16(&sbp->sb_uuid.b[4]); | ||
798 | mp->m_fixedfsid[1] = get_unaligned_be32(&sbp->sb_uuid.b[0]); | ||
797 | 799 | ||
798 | mp->m_dmevmask = 0; /* not persistent; set after each mount */ | 800 | mp->m_dmevmask = 0; /* not persistent; set after each mount */ |
799 | 801 | ||
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 408c7820e200..c1b163cb68b1 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -61,17 +61,18 @@ bool acpi_ata_match(acpi_handle handle); | |||
61 | bool acpi_bay_match(acpi_handle handle); | 61 | bool acpi_bay_match(acpi_handle handle); |
62 | bool acpi_dock_match(acpi_handle handle); | 62 | bool acpi_dock_match(acpi_handle handle); |
63 | 63 | ||
64 | bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs); | 64 | bool acpi_check_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 funcs); |
65 | union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, | 65 | union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const guid_t *guid, |
66 | u64 rev, u64 func, union acpi_object *argv4); | 66 | u64 rev, u64 func, union acpi_object *argv4); |
67 | 67 | ||
68 | static inline union acpi_object * | 68 | static inline union acpi_object * |
69 | acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, u64 rev, u64 func, | 69 | acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, |
70 | union acpi_object *argv4, acpi_object_type type) | 70 | u64 func, union acpi_object *argv4, |
71 | acpi_object_type type) | ||
71 | { | 72 | { |
72 | union acpi_object *obj; | 73 | union acpi_object *obj; |
73 | 74 | ||
74 | obj = acpi_evaluate_dsm(handle, uuid, rev, func, argv4); | 75 | obj = acpi_evaluate_dsm(handle, guid, rev, func, argv4); |
75 | if (obj && obj->type != type) { | 76 | if (obj && obj->type != type) { |
76 | ACPI_FREE(obj); | 77 | ACPI_FREE(obj); |
77 | obj = NULL; | 78 | obj = NULL; |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 137e4a3d89c5..cafdfb84ca28 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/resource_ext.h> | 26 | #include <linux/resource_ext.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/property.h> | 28 | #include <linux/property.h> |
29 | #include <linux/uuid.h> | ||
29 | 30 | ||
30 | #ifndef _LINUX | 31 | #ifndef _LINUX |
31 | #define _LINUX | 32 | #define _LINUX |
@@ -457,7 +458,6 @@ struct acpi_osc_context { | |||
457 | struct acpi_buffer ret; /* free by caller if success */ | 458 | struct acpi_buffer ret; /* free by caller if success */ |
458 | }; | 459 | }; |
459 | 460 | ||
460 | acpi_status acpi_str_to_uuid(char *str, u8 *uuid); | ||
461 | acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); | 461 | acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); |
462 | 462 | ||
463 | /* Indexes into _OSC Capabilities Buffer (DWORDs 2 & 3 are device-specific) */ | 463 | /* Indexes into _OSC Capabilities Buffer (DWORDs 2 & 3 are device-specific) */ |
@@ -741,7 +741,7 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
741 | } | 741 | } |
742 | 742 | ||
743 | static inline union acpi_object *acpi_evaluate_dsm(acpi_handle handle, | 743 | static inline union acpi_object *acpi_evaluate_dsm(acpi_handle handle, |
744 | const u8 *uuid, | 744 | const guid_t *guid, |
745 | int rev, int func, | 745 | int rev, int func, |
746 | union acpi_object *argv4) | 746 | union acpi_object *argv4) |
747 | { | 747 | { |
diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h index fccf7f44139d..bbb3712dd892 100644 --- a/include/linux/cleancache.h +++ b/include/linux/cleancache.h | |||
@@ -27,7 +27,7 @@ struct cleancache_filekey { | |||
27 | 27 | ||
28 | struct cleancache_ops { | 28 | struct cleancache_ops { |
29 | int (*init_fs)(size_t); | 29 | int (*init_fs)(size_t); |
30 | int (*init_shared_fs)(char *uuid, size_t); | 30 | int (*init_shared_fs)(uuid_t *uuid, size_t); |
31 | int (*get_page)(int, struct cleancache_filekey, | 31 | int (*get_page)(int, struct cleancache_filekey, |
32 | pgoff_t, struct page *); | 32 | pgoff_t, struct page *); |
33 | void (*put_page)(int, struct cleancache_filekey, | 33 | void (*put_page)(int, struct cleancache_filekey, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 803e5a9b2654..3e68cabb8457 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/percpu-rwsem.h> | 30 | #include <linux/percpu-rwsem.h> |
31 | #include <linux/workqueue.h> | 31 | #include <linux/workqueue.h> |
32 | #include <linux/delayed_call.h> | 32 | #include <linux/delayed_call.h> |
33 | #include <linux/uuid.h> | ||
33 | 34 | ||
34 | #include <asm/byteorder.h> | 35 | #include <asm/byteorder.h> |
35 | #include <uapi/linux/fs.h> | 36 | #include <uapi/linux/fs.h> |
@@ -1328,8 +1329,8 @@ struct super_block { | |||
1328 | 1329 | ||
1329 | struct sb_writers s_writers; | 1330 | struct sb_writers s_writers; |
1330 | 1331 | ||
1331 | char s_id[32]; /* Informational name */ | 1332 | char s_id[32]; /* Informational name */ |
1332 | u8 s_uuid[16]; /* UUID */ | 1333 | uuid_t s_uuid; /* UUID */ |
1333 | 1334 | ||
1334 | void *s_fs_info; /* Filesystem private info */ | 1335 | void *s_fs_info; /* Filesystem private info */ |
1335 | unsigned int s_max_links; | 1336 | unsigned int s_max_links; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index acff9437e5c3..e619fae2f037 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -219,12 +219,6 @@ static inline struct gendisk *part_to_disk(struct hd_struct *part) | |||
219 | return NULL; | 219 | return NULL; |
220 | } | 220 | } |
221 | 221 | ||
222 | static inline int blk_part_pack_uuid(const u8 *uuid_str, u8 *to) | ||
223 | { | ||
224 | uuid_be_to_bin(uuid_str, (uuid_be *)to); | ||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | static inline int disk_max_parts(struct gendisk *disk) | 222 | static inline int disk_max_parts(struct gendisk *disk) |
229 | { | 223 | { |
230 | if (disk->flags & GENHD_FL_EXT_DEVT) | 224 | if (disk->flags & GENHD_FL_EXT_DEVT) |
@@ -736,11 +730,6 @@ static inline dev_t blk_lookup_devt(const char *name, int partno) | |||
736 | dev_t devt = MKDEV(0, 0); | 730 | dev_t devt = MKDEV(0, 0); |
737 | return devt; | 731 | return devt; |
738 | } | 732 | } |
739 | |||
740 | static inline int blk_part_pack_uuid(const u8 *uuid_str, u8 *to) | ||
741 | { | ||
742 | return -EINVAL; | ||
743 | } | ||
744 | #endif /* CONFIG_BLOCK */ | 733 | #endif /* CONFIG_BLOCK */ |
745 | 734 | ||
746 | #endif /* _LINUX_GENHD_H */ | 735 | #endif /* _LINUX_GENHD_H */ |
diff --git a/include/linux/nvme-fc.h b/include/linux/nvme-fc.h index e997c4a49a88..bc711a10be05 100644 --- a/include/linux/nvme-fc.h +++ b/include/linux/nvme-fc.h | |||
@@ -177,7 +177,6 @@ struct fcnvme_lsdesc_rjt { | |||
177 | }; | 177 | }; |
178 | 178 | ||
179 | 179 | ||
180 | #define FCNVME_ASSOC_HOSTID_LEN 16 | ||
181 | #define FCNVME_ASSOC_HOSTNQN_LEN 256 | 180 | #define FCNVME_ASSOC_HOSTNQN_LEN 256 |
182 | #define FCNVME_ASSOC_SUBNQN_LEN 256 | 181 | #define FCNVME_ASSOC_SUBNQN_LEN 256 |
183 | 182 | ||
@@ -191,7 +190,7 @@ struct fcnvme_lsdesc_cr_assoc_cmd { | |||
191 | __be16 cntlid; | 190 | __be16 cntlid; |
192 | __be16 sqsize; | 191 | __be16 sqsize; |
193 | __be32 rsvd52; | 192 | __be32 rsvd52; |
194 | u8 hostid[FCNVME_ASSOC_HOSTID_LEN]; | 193 | uuid_t hostid; |
195 | u8 hostnqn[FCNVME_ASSOC_HOSTNQN_LEN]; | 194 | u8 hostnqn[FCNVME_ASSOC_HOSTNQN_LEN]; |
196 | u8 subnqn[FCNVME_ASSOC_SUBNQN_LEN]; | 195 | u8 subnqn[FCNVME_ASSOC_SUBNQN_LEN]; |
197 | u8 rsvd632[384]; | 196 | u8 rsvd632[384]; |
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index b625bacf37ef..e400a69fa1d3 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define _LINUX_NVME_H | 16 | #define _LINUX_NVME_H |
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/uuid.h> | ||
19 | 20 | ||
20 | /* NQN names in commands fields specified one size */ | 21 | /* NQN names in commands fields specified one size */ |
21 | #define NVMF_NQN_FIELD_LEN 256 | 22 | #define NVMF_NQN_FIELD_LEN 256 |
@@ -843,7 +844,7 @@ struct nvmf_connect_command { | |||
843 | }; | 844 | }; |
844 | 845 | ||
845 | struct nvmf_connect_data { | 846 | struct nvmf_connect_data { |
846 | __u8 hostid[16]; | 847 | uuid_t hostid; |
847 | __le16 cntlid; | 848 | __le16 cntlid; |
848 | char resv4[238]; | 849 | char resv4[238]; |
849 | char subsysnqn[NVMF_NQN_FIELD_LEN]; | 850 | char subsysnqn[NVMF_NQN_FIELD_LEN]; |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 7a4e83a8c89c..dd86c97f2454 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -105,7 +105,7 @@ static inline void acpiphp_remove_slots(struct pci_bus *bus) { } | |||
105 | static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { } | 105 | static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { } |
106 | #endif | 106 | #endif |
107 | 107 | ||
108 | extern const u8 pci_acpi_dsm_uuid[]; | 108 | extern const guid_t pci_acpi_dsm_guid; |
109 | #define DEVICE_LABEL_DSM 0x07 | 109 | #define DEVICE_LABEL_DSM 0x07 |
110 | #define RESET_DELAY_DSM 0x08 | 110 | #define RESET_DELAY_DSM 0x08 |
111 | #define FUNCTION_DELAY_DSM 0x09 | 111 | #define FUNCTION_DELAY_DSM 0x09 |
diff --git a/include/linux/uuid.h b/include/linux/uuid.h index 4dff73a89758..d1defe4ab167 100644 --- a/include/linux/uuid.h +++ b/include/linux/uuid.h | |||
@@ -18,29 +18,16 @@ | |||
18 | 18 | ||
19 | #include <uapi/linux/uuid.h> | 19 | #include <uapi/linux/uuid.h> |
20 | 20 | ||
21 | /* | 21 | typedef struct { |
22 | * V1 (time-based) UUID definition [RFC 4122]. | 22 | __u8 b[16]; |
23 | * - the timestamp is a 60-bit value, split 32/16/12, and goes in 100ns | 23 | } uuid_t; |
24 | * increments since midnight 15th October 1582 | 24 | |
25 | * - add AFS_UUID_TO_UNIX_TIME to convert unix time in 100ns units to UUID | 25 | #define UUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ |
26 | * time | 26 | ((uuid_t) \ |
27 | * - the clock sequence is a 14-bit counter to avoid duplicate times | 27 | {{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \ |
28 | */ | 28 | ((b) >> 8) & 0xff, (b) & 0xff, \ |
29 | struct uuid_v1 { | 29 | ((c) >> 8) & 0xff, (c) & 0xff, \ |
30 | __be32 time_low; /* low part of timestamp */ | 30 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) |
31 | __be16 time_mid; /* mid part of timestamp */ | ||
32 | __be16 time_hi_and_version; /* high part of timestamp and version */ | ||
33 | #define UUID_TO_UNIX_TIME 0x01b21dd213814000ULL | ||
34 | #define UUID_TIMEHI_MASK 0x0fff | ||
35 | #define UUID_VERSION_TIME 0x1000 /* time-based UUID */ | ||
36 | #define UUID_VERSION_NAME 0x3000 /* name-based UUID */ | ||
37 | #define UUID_VERSION_RANDOM 0x4000 /* (pseudo-)random generated UUID */ | ||
38 | u8 clock_seq_hi_and_reserved; /* clock seq hi and variant */ | ||
39 | #define UUID_CLOCKHI_MASK 0x3f | ||
40 | #define UUID_VARIANT_STD 0x80 | ||
41 | u8 clock_seq_low; /* clock seq low */ | ||
42 | u8 node[6]; /* spatially unique node ID (MAC addr) */ | ||
43 | }; | ||
44 | 31 | ||
45 | /* | 32 | /* |
46 | * The length of a UUID string ("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") | 33 | * The length of a UUID string ("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") |
@@ -48,27 +35,73 @@ struct uuid_v1 { | |||
48 | */ | 35 | */ |
49 | #define UUID_STRING_LEN 36 | 36 | #define UUID_STRING_LEN 36 |
50 | 37 | ||
51 | static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2) | 38 | extern const guid_t guid_null; |
39 | extern const uuid_t uuid_null; | ||
40 | |||
41 | static inline bool guid_equal(const guid_t *u1, const guid_t *u2) | ||
42 | { | ||
43 | return memcmp(u1, u2, sizeof(guid_t)) == 0; | ||
44 | } | ||
45 | |||
46 | static inline void guid_copy(guid_t *dst, const guid_t *src) | ||
47 | { | ||
48 | memcpy(dst, src, sizeof(guid_t)); | ||
49 | } | ||
50 | |||
51 | static inline bool guid_is_null(const guid_t *guid) | ||
52 | { | ||
53 | return guid_equal(guid, &guid_null); | ||
54 | } | ||
55 | |||
56 | static inline bool uuid_equal(const uuid_t *u1, const uuid_t *u2) | ||
57 | { | ||
58 | return memcmp(u1, u2, sizeof(uuid_t)) == 0; | ||
59 | } | ||
60 | |||
61 | static inline void uuid_copy(uuid_t *dst, const uuid_t *src) | ||
52 | { | 62 | { |
53 | return memcmp(&u1, &u2, sizeof(uuid_le)); | 63 | memcpy(dst, src, sizeof(uuid_t)); |
54 | } | 64 | } |
55 | 65 | ||
56 | static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2) | 66 | static inline bool uuid_is_null(const uuid_t *uuid) |
57 | { | 67 | { |
58 | return memcmp(&u1, &u2, sizeof(uuid_be)); | 68 | return uuid_equal(uuid, &uuid_null); |
59 | } | 69 | } |
60 | 70 | ||
61 | void generate_random_uuid(unsigned char uuid[16]); | 71 | void generate_random_uuid(unsigned char uuid[16]); |
62 | 72 | ||
63 | extern void uuid_le_gen(uuid_le *u); | 73 | extern void guid_gen(guid_t *u); |
64 | extern void uuid_be_gen(uuid_be *u); | 74 | extern void uuid_gen(uuid_t *u); |
65 | 75 | ||
66 | bool __must_check uuid_is_valid(const char *uuid); | 76 | bool __must_check uuid_is_valid(const char *uuid); |
67 | 77 | ||
68 | extern const u8 uuid_le_index[16]; | 78 | extern const u8 guid_index[16]; |
69 | extern const u8 uuid_be_index[16]; | 79 | extern const u8 uuid_index[16]; |
80 | |||
81 | int guid_parse(const char *uuid, guid_t *u); | ||
82 | int uuid_parse(const char *uuid, uuid_t *u); | ||
83 | |||
84 | /* backwards compatibility, don't use in new code */ | ||
85 | typedef uuid_t uuid_be; | ||
86 | #define UUID_BE(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ | ||
87 | UUID_INIT(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7) | ||
88 | #define NULL_UUID_BE \ | ||
89 | UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \ | ||
90 | 0x00, 0x00, 0x00, 0x00) | ||
70 | 91 | ||
71 | int uuid_le_to_bin(const char *uuid, uuid_le *u); | 92 | #define uuid_le_gen(u) guid_gen(u) |
72 | int uuid_be_to_bin(const char *uuid, uuid_be *u); | 93 | #define uuid_be_gen(u) uuid_gen(u) |
94 | #define uuid_le_to_bin(guid, u) guid_parse(guid, u) | ||
95 | #define uuid_be_to_bin(uuid, u) uuid_parse(uuid, u) | ||
96 | |||
97 | static inline int uuid_le_cmp(const guid_t u1, const guid_t u2) | ||
98 | { | ||
99 | return memcmp(&u1, &u2, sizeof(guid_t)); | ||
100 | } | ||
101 | |||
102 | static inline int uuid_be_cmp(const uuid_t u1, const uuid_t u2) | ||
103 | { | ||
104 | return memcmp(&u1, &u2, sizeof(uuid_t)); | ||
105 | } | ||
73 | 106 | ||
74 | #endif | 107 | #endif |
diff --git a/include/uapi/linux/uuid.h b/include/uapi/linux/uuid.h index 3738e5fb6a4d..8ef82f433877 100644 --- a/include/uapi/linux/uuid.h +++ b/include/uapi/linux/uuid.h | |||
@@ -22,33 +22,21 @@ | |||
22 | 22 | ||
23 | typedef struct { | 23 | typedef struct { |
24 | __u8 b[16]; | 24 | __u8 b[16]; |
25 | } uuid_le; | 25 | } guid_t; |
26 | 26 | ||
27 | typedef struct { | 27 | #define GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ |
28 | __u8 b[16]; | 28 | ((guid_t) \ |
29 | } uuid_be; | ||
30 | |||
31 | #define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ | ||
32 | ((uuid_le) \ | ||
33 | {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ | 29 | {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ |
34 | (b) & 0xff, ((b) >> 8) & 0xff, \ | 30 | (b) & 0xff, ((b) >> 8) & 0xff, \ |
35 | (c) & 0xff, ((c) >> 8) & 0xff, \ | 31 | (c) & 0xff, ((c) >> 8) & 0xff, \ |
36 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) | 32 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) |
37 | 33 | ||
38 | #define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ | 34 | /* backwards compatibility, don't use in new code */ |
39 | ((uuid_be) \ | 35 | typedef guid_t uuid_le; |
40 | {{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \ | 36 | #define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ |
41 | ((b) >> 8) & 0xff, (b) & 0xff, \ | 37 | GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) |
42 | ((c) >> 8) & 0xff, (c) & 0xff, \ | ||
43 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) | ||
44 | |||
45 | #define NULL_UUID_LE \ | 38 | #define NULL_UUID_LE \ |
46 | UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \ | 39 | UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \ |
47 | 0x00, 0x00, 0x00, 0x00) | 40 | 0x00, 0x00, 0x00, 0x00) |
48 | |||
49 | #define NULL_UUID_BE \ | ||
50 | UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \ | ||
51 | 0x00, 0x00, 0x00, 0x00) | ||
52 | |||
53 | 41 | ||
54 | #endif /* _UAPI_LINUX_UUID_H_ */ | 42 | #endif /* _UAPI_LINUX_UUID_H_ */ |
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c index ece4b177052b..939a158eab11 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c | |||
@@ -1119,7 +1119,7 @@ static ssize_t bin_uuid(struct file *file, | |||
1119 | /* Only supports reads */ | 1119 | /* Only supports reads */ |
1120 | if (oldval && oldlen) { | 1120 | if (oldval && oldlen) { |
1121 | char buf[UUID_STRING_LEN + 1]; | 1121 | char buf[UUID_STRING_LEN + 1]; |
1122 | uuid_be uuid; | 1122 | uuid_t uuid; |
1123 | 1123 | ||
1124 | result = kernel_read(file, 0, buf, sizeof(buf) - 1); | 1124 | result = kernel_read(file, 0, buf, sizeof(buf) - 1); |
1125 | if (result < 0) | 1125 | if (result < 0) |
@@ -1128,7 +1128,7 @@ static ssize_t bin_uuid(struct file *file, | |||
1128 | buf[result] = '\0'; | 1128 | buf[result] = '\0'; |
1129 | 1129 | ||
1130 | result = -EIO; | 1130 | result = -EIO; |
1131 | if (uuid_be_to_bin(buf, &uuid)) | 1131 | if (uuid_parse(buf, &uuid)) |
1132 | goto out; | 1132 | goto out; |
1133 | 1133 | ||
1134 | if (oldlen > 16) | 1134 | if (oldlen > 16) |
diff --git a/lib/test_uuid.c b/lib/test_uuid.c index 547d3127a3cf..478c049630b5 100644 --- a/lib/test_uuid.c +++ b/lib/test_uuid.c | |||
@@ -11,25 +11,25 @@ | |||
11 | 11 | ||
12 | struct test_uuid_data { | 12 | struct test_uuid_data { |
13 | const char *uuid; | 13 | const char *uuid; |
14 | uuid_le le; | 14 | guid_t le; |
15 | uuid_be be; | 15 | uuid_t be; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | static const struct test_uuid_data test_uuid_test_data[] = { | 18 | static const struct test_uuid_data test_uuid_test_data[] = { |
19 | { | 19 | { |
20 | .uuid = "c33f4995-3701-450e-9fbf-206a2e98e576", | 20 | .uuid = "c33f4995-3701-450e-9fbf-206a2e98e576", |
21 | .le = UUID_LE(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76), | 21 | .le = GUID_INIT(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76), |
22 | .be = UUID_BE(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76), | 22 | .be = UUID_INIT(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76), |
23 | }, | 23 | }, |
24 | { | 24 | { |
25 | .uuid = "64b4371c-77c1-48f9-8221-29f054fc023b", | 25 | .uuid = "64b4371c-77c1-48f9-8221-29f054fc023b", |
26 | .le = UUID_LE(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b), | 26 | .le = GUID_INIT(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b), |
27 | .be = UUID_BE(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b), | 27 | .be = UUID_INIT(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b), |
28 | }, | 28 | }, |
29 | { | 29 | { |
30 | .uuid = "0cb4ddff-a545-4401-9d06-688af53e7f84", | 30 | .uuid = "0cb4ddff-a545-4401-9d06-688af53e7f84", |
31 | .le = UUID_LE(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84), | 31 | .le = GUID_INIT(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84), |
32 | .be = UUID_BE(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84), | 32 | .be = UUID_INIT(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84), |
33 | }, | 33 | }, |
34 | }; | 34 | }; |
35 | 35 | ||
@@ -61,28 +61,28 @@ static void __init test_uuid_failed(const char *prefix, bool wrong, bool be, | |||
61 | 61 | ||
62 | static void __init test_uuid_test(const struct test_uuid_data *data) | 62 | static void __init test_uuid_test(const struct test_uuid_data *data) |
63 | { | 63 | { |
64 | uuid_le le; | 64 | guid_t le; |
65 | uuid_be be; | 65 | uuid_t be; |
66 | char buf[48]; | 66 | char buf[48]; |
67 | 67 | ||
68 | /* LE */ | 68 | /* LE */ |
69 | total_tests++; | 69 | total_tests++; |
70 | if (uuid_le_to_bin(data->uuid, &le)) | 70 | if (guid_parse(data->uuid, &le)) |
71 | test_uuid_failed("conversion", false, false, data->uuid, NULL); | 71 | test_uuid_failed("conversion", false, false, data->uuid, NULL); |
72 | 72 | ||
73 | total_tests++; | 73 | total_tests++; |
74 | if (uuid_le_cmp(data->le, le)) { | 74 | if (!guid_equal(&data->le, &le)) { |
75 | sprintf(buf, "%pUl", &le); | 75 | sprintf(buf, "%pUl", &le); |
76 | test_uuid_failed("cmp", false, false, data->uuid, buf); | 76 | test_uuid_failed("cmp", false, false, data->uuid, buf); |
77 | } | 77 | } |
78 | 78 | ||
79 | /* BE */ | 79 | /* BE */ |
80 | total_tests++; | 80 | total_tests++; |
81 | if (uuid_be_to_bin(data->uuid, &be)) | 81 | if (uuid_parse(data->uuid, &be)) |
82 | test_uuid_failed("conversion", false, true, data->uuid, NULL); | 82 | test_uuid_failed("conversion", false, true, data->uuid, NULL); |
83 | 83 | ||
84 | total_tests++; | 84 | total_tests++; |
85 | if (uuid_be_cmp(data->be, be)) { | 85 | if (uuid_equal(&data->be, &be)) { |
86 | sprintf(buf, "%pUb", &be); | 86 | sprintf(buf, "%pUb", &be); |
87 | test_uuid_failed("cmp", false, true, data->uuid, buf); | 87 | test_uuid_failed("cmp", false, true, data->uuid, buf); |
88 | } | 88 | } |
@@ -90,17 +90,17 @@ static void __init test_uuid_test(const struct test_uuid_data *data) | |||
90 | 90 | ||
91 | static void __init test_uuid_wrong(const char *data) | 91 | static void __init test_uuid_wrong(const char *data) |
92 | { | 92 | { |
93 | uuid_le le; | 93 | guid_t le; |
94 | uuid_be be; | 94 | uuid_t be; |
95 | 95 | ||
96 | /* LE */ | 96 | /* LE */ |
97 | total_tests++; | 97 | total_tests++; |
98 | if (!uuid_le_to_bin(data, &le)) | 98 | if (!guid_parse(data, &le)) |
99 | test_uuid_failed("negative", true, false, data, NULL); | 99 | test_uuid_failed("negative", true, false, data, NULL); |
100 | 100 | ||
101 | /* BE */ | 101 | /* BE */ |
102 | total_tests++; | 102 | total_tests++; |
103 | if (!uuid_be_to_bin(data, &be)) | 103 | if (!uuid_parse(data, &be)) |
104 | test_uuid_failed("negative", true, true, data, NULL); | 104 | test_uuid_failed("negative", true, true, data, NULL); |
105 | } | 105 | } |
106 | 106 | ||
diff --git a/lib/uuid.c b/lib/uuid.c index 37687af77ff8..680b9fb9ba09 100644 --- a/lib/uuid.c +++ b/lib/uuid.c | |||
@@ -21,10 +21,13 @@ | |||
21 | #include <linux/uuid.h> | 21 | #include <linux/uuid.h> |
22 | #include <linux/random.h> | 22 | #include <linux/random.h> |
23 | 23 | ||
24 | const u8 uuid_le_index[16] = {3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15}; | 24 | const guid_t guid_null; |
25 | EXPORT_SYMBOL(uuid_le_index); | 25 | EXPORT_SYMBOL(guid_null); |
26 | const u8 uuid_be_index[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; | 26 | const uuid_t uuid_null; |
27 | EXPORT_SYMBOL(uuid_be_index); | 27 | EXPORT_SYMBOL(uuid_null); |
28 | |||
29 | const u8 guid_index[16] = {3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15}; | ||
30 | const u8 uuid_index[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; | ||
28 | 31 | ||
29 | /*************************************************************** | 32 | /*************************************************************** |
30 | * Random UUID interface | 33 | * Random UUID interface |
@@ -53,21 +56,21 @@ static void __uuid_gen_common(__u8 b[16]) | |||
53 | b[8] = (b[8] & 0x3F) | 0x80; | 56 | b[8] = (b[8] & 0x3F) | 0x80; |
54 | } | 57 | } |
55 | 58 | ||
56 | void uuid_le_gen(uuid_le *lu) | 59 | void guid_gen(guid_t *lu) |
57 | { | 60 | { |
58 | __uuid_gen_common(lu->b); | 61 | __uuid_gen_common(lu->b); |
59 | /* version 4 : random generation */ | 62 | /* version 4 : random generation */ |
60 | lu->b[7] = (lu->b[7] & 0x0F) | 0x40; | 63 | lu->b[7] = (lu->b[7] & 0x0F) | 0x40; |
61 | } | 64 | } |
62 | EXPORT_SYMBOL_GPL(uuid_le_gen); | 65 | EXPORT_SYMBOL_GPL(guid_gen); |
63 | 66 | ||
64 | void uuid_be_gen(uuid_be *bu) | 67 | void uuid_gen(uuid_t *bu) |
65 | { | 68 | { |
66 | __uuid_gen_common(bu->b); | 69 | __uuid_gen_common(bu->b); |
67 | /* version 4 : random generation */ | 70 | /* version 4 : random generation */ |
68 | bu->b[6] = (bu->b[6] & 0x0F) | 0x40; | 71 | bu->b[6] = (bu->b[6] & 0x0F) | 0x40; |
69 | } | 72 | } |
70 | EXPORT_SYMBOL_GPL(uuid_be_gen); | 73 | EXPORT_SYMBOL_GPL(uuid_gen); |
71 | 74 | ||
72 | /** | 75 | /** |
73 | * uuid_is_valid - checks if UUID string valid | 76 | * uuid_is_valid - checks if UUID string valid |
@@ -97,7 +100,7 @@ bool uuid_is_valid(const char *uuid) | |||
97 | } | 100 | } |
98 | EXPORT_SYMBOL(uuid_is_valid); | 101 | EXPORT_SYMBOL(uuid_is_valid); |
99 | 102 | ||
100 | static int __uuid_to_bin(const char *uuid, __u8 b[16], const u8 ei[16]) | 103 | static int __uuid_parse(const char *uuid, __u8 b[16], const u8 ei[16]) |
101 | { | 104 | { |
102 | static const u8 si[16] = {0,2,4,6,9,11,14,16,19,21,24,26,28,30,32,34}; | 105 | static const u8 si[16] = {0,2,4,6,9,11,14,16,19,21,24,26,28,30,32,34}; |
103 | unsigned int i; | 106 | unsigned int i; |
@@ -115,14 +118,14 @@ static int __uuid_to_bin(const char *uuid, __u8 b[16], const u8 ei[16]) | |||
115 | return 0; | 118 | return 0; |
116 | } | 119 | } |
117 | 120 | ||
118 | int uuid_le_to_bin(const char *uuid, uuid_le *u) | 121 | int guid_parse(const char *uuid, guid_t *u) |
119 | { | 122 | { |
120 | return __uuid_to_bin(uuid, u->b, uuid_le_index); | 123 | return __uuid_parse(uuid, u->b, guid_index); |
121 | } | 124 | } |
122 | EXPORT_SYMBOL(uuid_le_to_bin); | 125 | EXPORT_SYMBOL(guid_parse); |
123 | 126 | ||
124 | int uuid_be_to_bin(const char *uuid, uuid_be *u) | 127 | int uuid_parse(const char *uuid, uuid_t *u) |
125 | { | 128 | { |
126 | return __uuid_to_bin(uuid, u->b, uuid_be_index); | 129 | return __uuid_parse(uuid, u->b, uuid_index); |
127 | } | 130 | } |
128 | EXPORT_SYMBOL(uuid_be_to_bin); | 131 | EXPORT_SYMBOL(uuid_parse); |
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 2d41de3f98a1..9f37d6208e99 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -1308,14 +1308,14 @@ char *uuid_string(char *buf, char *end, const u8 *addr, | |||
1308 | char uuid[UUID_STRING_LEN + 1]; | 1308 | char uuid[UUID_STRING_LEN + 1]; |
1309 | char *p = uuid; | 1309 | char *p = uuid; |
1310 | int i; | 1310 | int i; |
1311 | const u8 *index = uuid_be_index; | 1311 | const u8 *index = uuid_index; |
1312 | bool uc = false; | 1312 | bool uc = false; |
1313 | 1313 | ||
1314 | switch (*(++fmt)) { | 1314 | switch (*(++fmt)) { |
1315 | case 'L': | 1315 | case 'L': |
1316 | uc = true; /* fall-through */ | 1316 | uc = true; /* fall-through */ |
1317 | case 'l': | 1317 | case 'l': |
1318 | index = uuid_le_index; | 1318 | index = guid_index; |
1319 | break; | 1319 | break; |
1320 | case 'B': | 1320 | case 'B': |
1321 | uc = true; | 1321 | uc = true; |
diff --git a/mm/cleancache.c b/mm/cleancache.c index ba5d8f3e6d68..f7b9fdc79d97 100644 --- a/mm/cleancache.c +++ b/mm/cleancache.c | |||
@@ -130,7 +130,7 @@ void __cleancache_init_shared_fs(struct super_block *sb) | |||
130 | int pool_id = CLEANCACHE_NO_BACKEND_SHARED; | 130 | int pool_id = CLEANCACHE_NO_BACKEND_SHARED; |
131 | 131 | ||
132 | if (cleancache_ops) { | 132 | if (cleancache_ops) { |
133 | pool_id = cleancache_ops->init_shared_fs(sb->s_uuid, PAGE_SIZE); | 133 | pool_id = cleancache_ops->init_shared_fs(&sb->s_uuid, PAGE_SIZE); |
134 | if (pool_id < 0) | 134 | if (pool_id < 0) |
135 | pool_id = CLEANCACHE_NO_POOL; | 135 | pool_id = CLEANCACHE_NO_POOL; |
136 | } | 136 | } |
diff --git a/mm/shmem.c b/mm/shmem.c index e67d6ba4e98e..391f2dcca727 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -75,6 +75,7 @@ static struct vfsmount *shm_mnt; | |||
75 | #include <uapi/linux/memfd.h> | 75 | #include <uapi/linux/memfd.h> |
76 | #include <linux/userfaultfd_k.h> | 76 | #include <linux/userfaultfd_k.h> |
77 | #include <linux/rmap.h> | 77 | #include <linux/rmap.h> |
78 | #include <linux/uuid.h> | ||
78 | 79 | ||
79 | #include <linux/uaccess.h> | 80 | #include <linux/uaccess.h> |
80 | #include <asm/pgtable.h> | 81 | #include <asm/pgtable.h> |
@@ -3761,6 +3762,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent) | |||
3761 | #ifdef CONFIG_TMPFS_POSIX_ACL | 3762 | #ifdef CONFIG_TMPFS_POSIX_ACL |
3762 | sb->s_flags |= MS_POSIXACL; | 3763 | sb->s_flags |= MS_POSIXACL; |
3763 | #endif | 3764 | #endif |
3765 | uuid_gen(&sb->s_uuid); | ||
3764 | 3766 | ||
3765 | inode = shmem_get_inode(sb, NULL, S_IFDIR | sbinfo->mode, 0, VM_NORESERVE); | 3767 | inode = shmem_get_inode(sb, NULL, S_IFDIR | sbinfo->mode, 0, VM_NORESERVE); |
3766 | if (!inode) | 3768 | if (!inode) |
diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c index d7f282d75cc1..1d32cd20009a 100644 --- a/security/integrity/evm/evm_crypto.c +++ b/security/integrity/evm/evm_crypto.c | |||
@@ -164,7 +164,7 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode, | |||
164 | hmac_misc.mode = inode->i_mode; | 164 | hmac_misc.mode = inode->i_mode; |
165 | crypto_shash_update(desc, (const u8 *)&hmac_misc, sizeof(hmac_misc)); | 165 | crypto_shash_update(desc, (const u8 *)&hmac_misc, sizeof(hmac_misc)); |
166 | if (evm_hmac_attrs & EVM_ATTR_FSUUID) | 166 | if (evm_hmac_attrs & EVM_ATTR_FSUUID) |
167 | crypto_shash_update(desc, inode->i_sb->s_uuid, | 167 | crypto_shash_update(desc, &inode->i_sb->s_uuid.b[0], |
168 | sizeof(inode->i_sb->s_uuid)); | 168 | sizeof(inode->i_sb->s_uuid)); |
169 | crypto_shash_final(desc, digest); | 169 | crypto_shash_final(desc, digest); |
170 | } | 170 | } |
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 3ab1067db624..6f885fab9d84 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c | |||
@@ -61,7 +61,7 @@ struct ima_rule_entry { | |||
61 | enum ima_hooks func; | 61 | enum ima_hooks func; |
62 | int mask; | 62 | int mask; |
63 | unsigned long fsmagic; | 63 | unsigned long fsmagic; |
64 | u8 fsuuid[16]; | 64 | uuid_t fsuuid; |
65 | kuid_t uid; | 65 | kuid_t uid; |
66 | kuid_t fowner; | 66 | kuid_t fowner; |
67 | bool (*uid_op)(kuid_t, kuid_t); /* Handlers for operators */ | 67 | bool (*uid_op)(kuid_t, kuid_t); /* Handlers for operators */ |
@@ -244,7 +244,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, | |||
244 | && rule->fsmagic != inode->i_sb->s_magic) | 244 | && rule->fsmagic != inode->i_sb->s_magic) |
245 | return false; | 245 | return false; |
246 | if ((rule->flags & IMA_FSUUID) && | 246 | if ((rule->flags & IMA_FSUUID) && |
247 | memcmp(rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) | 247 | !uuid_equal(&rule->fsuuid, &inode->i_sb->s_uuid)) |
248 | return false; | 248 | return false; |
249 | if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid)) | 249 | if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid)) |
250 | return false; | 250 | return false; |
@@ -711,14 +711,12 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) | |||
711 | case Opt_fsuuid: | 711 | case Opt_fsuuid: |
712 | ima_log_string(ab, "fsuuid", args[0].from); | 712 | ima_log_string(ab, "fsuuid", args[0].from); |
713 | 713 | ||
714 | if (memchr_inv(entry->fsuuid, 0x00, | 714 | if (uuid_is_null(&entry->fsuuid)) { |
715 | sizeof(entry->fsuuid))) { | ||
716 | result = -EINVAL; | 715 | result = -EINVAL; |
717 | break; | 716 | break; |
718 | } | 717 | } |
719 | 718 | ||
720 | result = blk_part_pack_uuid(args[0].from, | 719 | result = uuid_parse(args[0].from, &entry->fsuuid); |
721 | entry->fsuuid); | ||
722 | if (!result) | 720 | if (!result) |
723 | entry->flags |= IMA_FSUUID; | 721 | entry->flags |= IMA_FSUUID; |
724 | break; | 722 | break; |
@@ -1087,7 +1085,7 @@ int ima_policy_show(struct seq_file *m, void *v) | |||
1087 | } | 1085 | } |
1088 | 1086 | ||
1089 | if (entry->flags & IMA_FSUUID) { | 1087 | if (entry->flags & IMA_FSUUID) { |
1090 | seq_printf(m, "fsuuid=%pU", entry->fsuuid); | 1088 | seq_printf(m, "fsuuid=%pU", &entry->fsuuid); |
1091 | seq_puts(m, " "); | 1089 | seq_puts(m, " "); |
1092 | } | 1090 | } |
1093 | 1091 | ||
diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c index e3f06672fd6d..e7d766d56c8e 100644 --- a/sound/soc/intel/skylake/skl-nhlt.c +++ b/sound/soc/intel/skylake/skl-nhlt.c | |||
@@ -21,8 +21,9 @@ | |||
21 | #include "skl.h" | 21 | #include "skl.h" |
22 | 22 | ||
23 | /* Unique identification for getting NHLT blobs */ | 23 | /* Unique identification for getting NHLT blobs */ |
24 | static u8 OSC_UUID[16] = {0x6E, 0x88, 0x9F, 0xA6, 0xEB, 0x6C, 0x94, 0x45, | 24 | static guid_t osc_guid = |
25 | 0xA4, 0x1F, 0x7B, 0x5D, 0xCE, 0x24, 0xC5, 0x53}; | 25 | GUID_INIT(0xA69F886E, 0x6CEB, 0x4594, |
26 | 0xA4, 0x1F, 0x7B, 0x5D, 0xCE, 0x24, 0xC5, 0x53); | ||
26 | 27 | ||
27 | struct nhlt_acpi_table *skl_nhlt_init(struct device *dev) | 28 | struct nhlt_acpi_table *skl_nhlt_init(struct device *dev) |
28 | { | 29 | { |
@@ -37,7 +38,7 @@ struct nhlt_acpi_table *skl_nhlt_init(struct device *dev) | |||
37 | return NULL; | 38 | return NULL; |
38 | } | 39 | } |
39 | 40 | ||
40 | obj = acpi_evaluate_dsm(handle, OSC_UUID, 1, 1, NULL); | 41 | obj = acpi_evaluate_dsm(handle, &osc_guid, 1, 1, NULL); |
41 | if (obj && obj->type == ACPI_TYPE_BUFFER) { | 42 | if (obj && obj->type == ACPI_TYPE_BUFFER) { |
42 | nhlt_ptr = (struct nhlt_resource_desc *)obj->buffer.pointer; | 43 | nhlt_ptr = (struct nhlt_resource_desc *)obj->buffer.pointer; |
43 | nhlt_table = (struct nhlt_acpi_table *) | 44 | nhlt_table = (struct nhlt_acpi_table *) |
diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c index 64cae1a5deff..e1f75a1914a1 100644 --- a/tools/testing/nvdimm/test/iomap.c +++ b/tools/testing/nvdimm/test/iomap.c | |||
@@ -370,7 +370,7 @@ acpi_status __wrap_acpi_evaluate_object(acpi_handle handle, acpi_string path, | |||
370 | } | 370 | } |
371 | EXPORT_SYMBOL(__wrap_acpi_evaluate_object); | 371 | EXPORT_SYMBOL(__wrap_acpi_evaluate_object); |
372 | 372 | ||
373 | union acpi_object * __wrap_acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, | 373 | union acpi_object * __wrap_acpi_evaluate_dsm(acpi_handle handle, const guid_t *guid, |
374 | u64 rev, u64 func, union acpi_object *argv4) | 374 | u64 rev, u64 func, union acpi_object *argv4) |
375 | { | 375 | { |
376 | union acpi_object *obj = ERR_PTR(-ENXIO); | 376 | union acpi_object *obj = ERR_PTR(-ENXIO); |
@@ -379,11 +379,11 @@ union acpi_object * __wrap_acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, | |||
379 | rcu_read_lock(); | 379 | rcu_read_lock(); |
380 | ops = list_first_or_null_rcu(&iomap_head, typeof(*ops), list); | 380 | ops = list_first_or_null_rcu(&iomap_head, typeof(*ops), list); |
381 | if (ops) | 381 | if (ops) |
382 | obj = ops->evaluate_dsm(handle, uuid, rev, func, argv4); | 382 | obj = ops->evaluate_dsm(handle, guid, rev, func, argv4); |
383 | rcu_read_unlock(); | 383 | rcu_read_unlock(); |
384 | 384 | ||
385 | if (IS_ERR(obj)) | 385 | if (IS_ERR(obj)) |
386 | return acpi_evaluate_dsm(handle, uuid, rev, func, argv4); | 386 | return acpi_evaluate_dsm(handle, guid, rev, func, argv4); |
387 | return obj; | 387 | return obj; |
388 | } | 388 | } |
389 | EXPORT_SYMBOL(__wrap_acpi_evaluate_dsm); | 389 | EXPORT_SYMBOL(__wrap_acpi_evaluate_dsm); |
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index c2187178fb13..28859da78edf 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c | |||
@@ -1559,7 +1559,7 @@ static unsigned long nfit_ctl_handle; | |||
1559 | union acpi_object *result; | 1559 | union acpi_object *result; |
1560 | 1560 | ||
1561 | static union acpi_object *nfit_test_evaluate_dsm(acpi_handle handle, | 1561 | static union acpi_object *nfit_test_evaluate_dsm(acpi_handle handle, |
1562 | const u8 *uuid, u64 rev, u64 func, union acpi_object *argv4) | 1562 | const guid_t *guid, u64 rev, u64 func, union acpi_object *argv4) |
1563 | { | 1563 | { |
1564 | if (handle != &nfit_ctl_handle) | 1564 | if (handle != &nfit_ctl_handle) |
1565 | return ERR_PTR(-ENXIO); | 1565 | return ERR_PTR(-ENXIO); |
diff --git a/tools/testing/nvdimm/test/nfit_test.h b/tools/testing/nvdimm/test/nfit_test.h index f54c0032c6ff..d3d63dd5ed38 100644 --- a/tools/testing/nvdimm/test/nfit_test.h +++ b/tools/testing/nvdimm/test/nfit_test.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifndef __NFIT_TEST_H__ | 13 | #ifndef __NFIT_TEST_H__ |
14 | #define __NFIT_TEST_H__ | 14 | #define __NFIT_TEST_H__ |
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/uuid.h> | ||
16 | #include <linux/ioport.h> | 17 | #include <linux/ioport.h> |
17 | #include <linux/spinlock_types.h> | 18 | #include <linux/spinlock_types.h> |
18 | 19 | ||
@@ -36,7 +37,8 @@ typedef void *acpi_handle; | |||
36 | 37 | ||
37 | typedef struct nfit_test_resource *(*nfit_test_lookup_fn)(resource_size_t); | 38 | typedef struct nfit_test_resource *(*nfit_test_lookup_fn)(resource_size_t); |
38 | typedef union acpi_object *(*nfit_test_evaluate_dsm_fn)(acpi_handle handle, | 39 | typedef union acpi_object *(*nfit_test_evaluate_dsm_fn)(acpi_handle handle, |
39 | const u8 *uuid, u64 rev, u64 func, union acpi_object *argv4); | 40 | const guid_t *guid, u64 rev, u64 func, |
41 | union acpi_object *argv4); | ||
40 | void __iomem *__wrap_ioremap_nocache(resource_size_t offset, | 42 | void __iomem *__wrap_ioremap_nocache(resource_size_t offset, |
41 | unsigned long size); | 43 | unsigned long size); |
42 | void __wrap_iounmap(volatile void __iomem *addr); | 44 | void __wrap_iounmap(volatile void __iomem *addr); |