Thread (18 messages) 18 messages, 13 authors, 2017-05-22

Re: [PATCH v1] ACPI: Switch to use generic UUID API

flat view

From: Dan Williams <hidden>
Date: 2017-05-05 06:20:13
Also in: alsa-devel, intel-gfx, linux-acpi, linux-iommu, linux-mmc, linux-pci, lkml, netdev, nouveau

On Thu, May 4, 2017 at 2:21 AM, Andy Shevchenko
[off-list ref] wrote:
acpi_evaluate_dsm() and friends take a pointer to a raw buffer of 16
bytes. Instead we convert them to use uuid_le type. At the same time we
convert current users.

acpi_str_to_uuid() becomes useless after the conversion and it's safe to
get rid of it.

The conversion fixes a potential bug in int340x_thermal as well since
we have to use memcmp() on binary data.

Cc: Rafael J. Wysocki <redacted>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Borislav Petkov <redacted>
Cc: Dan Williams <redacted>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Jarkko Sakkinen <redacted>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ben Skeggs <redacted>
Cc: Benjamin Tissoires <redacted>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Yisen Zhuang <redacted>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Mathias Nyman <mathias.nyman@intel.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[..]
quoted hunk ↗ jump to hunk
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 0f7982a1caaf..bd3e45ede056 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -74,11 +74,11 @@ struct nfit_table_prev {
        struct list_head flushes;
 };

-static u8 nfit_uuid[NFIT_UUID_MAX][16];
+static uuid_le nfit_uuid[NFIT_UUID_MAX];

-const u8 *to_nfit_uuid(enum nfit_uuids id)
+const uuid_le *to_nfit_uuid(enum nfit_uuids id)
 {
-       return nfit_uuid[id];
+       return &nfit_uuid[id];
 }
 EXPORT_SYMBOL(to_nfit_uuid);
@@ -207,7 +207,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
        u32 offset, fw_status = 0;
        acpi_handle handle;
        unsigned int func;
-       const u8 *uuid;
+       const uuid_le *uuid;
        int rc, i;

        func = cmd;
@@ -394,7 +394,7 @@ int nfit_spa_type(struct acpi_nfit_system_address *spa)
        int i;

        for (i = 0; i < NFIT_UUID_MAX; i++)
-               if (memcmp(to_nfit_uuid(i), spa->range_guid, 16) == 0)
+               if (!uuid_le_cmp_pp(to_nfit_uuid(i), (uuid_le *)spa->range_guid))
What is _cmp_pp? Why not _compare?

Other than that, looks ok to me.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help