All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Theodore Ts'o <tytso@mit.edu>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	David Airlie <airlied@linux.ie>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Lv Zheng <lv.zheng@intel.com>, Mark Brown <broonie@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
	linux-efi@vger.kernel.org, linux-api@vger.kernel.org,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH v1 05/10] ACPI: switch to use generic UUID API
Date: Wed, 17 Feb 2016 09:49:35 -0800	[thread overview]
Message-ID: <CAPcyv4inMjmt8eH_=bNE_=NMeYGmS75B5LxB=f7Cd762=3UKyQ@mail.gmail.com> (raw)
In-Reply-To: <1455711448-124103-6-git-send-email-andriy.shevchenko@linux.intel.com>

On Wed, Feb 17, 2016 at 4:17 AM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> Instead of opencoding the existing library functions let's use them directly.
>
> The conversion fixes a potential bug in int340x_thermal as well since we have
> to use memcmp() on binary data.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/acpi/acpi_extlog.c                        |  8 +++---
>  drivers/acpi/bus.c                                | 29 ++-----------------
>  drivers/acpi/nfit.c                               | 34 +++++++++++------------
>  drivers/acpi/nfit.h                               |  3 +-
>  drivers/acpi/utils.c                              |  4 +--
>  drivers/char/tpm/tpm_crb.c                        |  9 +++---
>  drivers/char/tpm/tpm_ppi.c                        | 20 ++++++-------
>  drivers/gpu/drm/i915/intel_acpi.c                 | 14 ++++------
>  drivers/gpu/drm/nouveau/nouveau_acpi.c            | 20 ++++++-------
>  drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c    |  9 +++---
>  drivers/hid/i2c-hid/i2c-hid.c                     |  9 +++---
>  drivers/iommu/dmar.c                              | 11 ++++----
>  drivers/pci/pci-acpi.c                            | 11 ++++----
>  drivers/pci/pci-label.c                           |  4 +--
>  drivers/thermal/int340x_thermal/int3400_thermal.c |  6 ++--
>  drivers/usb/host/xhci-pci.c                       |  9 +++---
>  include/acpi/acpi_bus.h                           | 10 ++++---
>  include/linux/acpi.h                              |  2 +-
>  include/linux/pci-acpi.h                          |  2 +-
>  sound/soc/intel/skylake/skl-nhlt.c                |  7 +++--
>  20 files changed, 92 insertions(+), 129 deletions(-)
>
[..]
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index ad6d8c6..3beb99b 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -43,11 +43,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);
>
> @@ -83,7 +83,7 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
>         const char *cmd_name, * dimm_name;
>         unsigned long dsm_mask;
>         acpi_handle handle;
> -       const u8 *uuid;
> +       const uuid_le *uuid;
>         u32 offset;
>         int rc, i;
>
> @@ -225,7 +225,7 @@ static 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(*to_nfit_uuid(i), *(uuid_le *)spa->range_guid))
>                         return i;
>         return -1;
>  }
> @@ -829,7 +829,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>  {
>         struct acpi_device *adev, *adev_dimm;
>         struct device *dev = acpi_desc->dev;
> -       const u8 *uuid = to_nfit_uuid(NFIT_DEV_DIMM);
> +       const uuid_le *uuid = to_nfit_uuid(NFIT_DEV_DIMM);
>         int i;
>
>         nfit_mem->dsm_mask = acpi_desc->dimm_dsm_force_en;
> @@ -909,7 +909,7 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
>  static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
>  {
>         struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc;
> -       const u8 *uuid = to_nfit_uuid(NFIT_DEV_BUS);
> +       const uuid_le *uuid = to_nfit_uuid(NFIT_DEV_BUS);
>         struct acpi_device *adev;
>         int i;
>
> @@ -2079,16 +2079,16 @@ static __init int nfit_init(void)
>         BUILD_BUG_ON(sizeof(struct acpi_nfit_control_region) != 80);
>         BUILD_BUG_ON(sizeof(struct acpi_nfit_data_region) != 40);
>
> -       acpi_str_to_uuid(UUID_VOLATILE_MEMORY, nfit_uuid[NFIT_SPA_VOLATILE]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_MEMORY, nfit_uuid[NFIT_SPA_PM]);
> -       acpi_str_to_uuid(UUID_CONTROL_REGION, nfit_uuid[NFIT_SPA_DCR]);
> -       acpi_str_to_uuid(UUID_DATA_REGION, nfit_uuid[NFIT_SPA_BDW]);
> -       acpi_str_to_uuid(UUID_VOLATILE_VIRTUAL_DISK, nfit_uuid[NFIT_SPA_VDISK]);
> -       acpi_str_to_uuid(UUID_VOLATILE_VIRTUAL_CD, nfit_uuid[NFIT_SPA_VCD]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_VIRTUAL_DISK, nfit_uuid[NFIT_SPA_PDISK]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_VIRTUAL_CD, nfit_uuid[NFIT_SPA_PCD]);
> -       acpi_str_to_uuid(UUID_NFIT_BUS, nfit_uuid[NFIT_DEV_BUS]);
> -       acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
> +       uuid_le_to_bin(UUID_VOLATILE_MEMORY, &nfit_uuid[NFIT_SPA_VOLATILE]);
> +       uuid_le_to_bin(UUID_PERSISTENT_MEMORY, &nfit_uuid[NFIT_SPA_PM]);
> +       uuid_le_to_bin(UUID_CONTROL_REGION, &nfit_uuid[NFIT_SPA_DCR]);
> +       uuid_le_to_bin(UUID_DATA_REGION, &nfit_uuid[NFIT_SPA_BDW]);
> +       uuid_le_to_bin(UUID_VOLATILE_VIRTUAL_DISK, &nfit_uuid[NFIT_SPA_VDISK]);
> +       uuid_le_to_bin(UUID_VOLATILE_VIRTUAL_CD, &nfit_uuid[NFIT_SPA_VCD]);
> +       uuid_le_to_bin(UUID_PERSISTENT_VIRTUAL_DISK, &nfit_uuid[NFIT_SPA_PDISK]);
> +       uuid_le_to_bin(UUID_PERSISTENT_VIRTUAL_CD, &nfit_uuid[NFIT_SPA_PCD]);
> +       uuid_le_to_bin(UUID_NFIT_BUS, &nfit_uuid[NFIT_DEV_BUS]);
> +       uuid_le_to_bin(UUID_NFIT_DIMM, &nfit_uuid[NFIT_DEV_DIMM]);

I don't see the benefit of this change.  For the NFIT driver we went
through a fire drill trying to make sure the ACPI spec format of a
UUID matched the Linux interpretation, and this change makes that
harder to determine.  ACPI drivers should use ACPICA uuid helper
routines in my opinion.

WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-efi@vger.kernel.org,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Lv Zheng <lv.zheng@intel.com>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Mark Brown <broonie@kernel.org>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Theodore Ts'o <tytso@mit.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-api@vger.kernel.org, Andrew Morton <akpm@linux-foundation>
Subject: Re: [PATCH v1 05/10] ACPI: switch to use generic UUID API
Date: Wed, 17 Feb 2016 09:49:35 -0800	[thread overview]
Message-ID: <CAPcyv4inMjmt8eH_=bNE_=NMeYGmS75B5LxB=f7Cd762=3UKyQ@mail.gmail.com> (raw)
In-Reply-To: <1455711448-124103-6-git-send-email-andriy.shevchenko@linux.intel.com>

On Wed, Feb 17, 2016 at 4:17 AM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> Instead of opencoding the existing library functions let's use them directly.
>
> The conversion fixes a potential bug in int340x_thermal as well since we have
> to use memcmp() on binary data.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/acpi/acpi_extlog.c                        |  8 +++---
>  drivers/acpi/bus.c                                | 29 ++-----------------
>  drivers/acpi/nfit.c                               | 34 +++++++++++------------
>  drivers/acpi/nfit.h                               |  3 +-
>  drivers/acpi/utils.c                              |  4 +--
>  drivers/char/tpm/tpm_crb.c                        |  9 +++---
>  drivers/char/tpm/tpm_ppi.c                        | 20 ++++++-------
>  drivers/gpu/drm/i915/intel_acpi.c                 | 14 ++++------
>  drivers/gpu/drm/nouveau/nouveau_acpi.c            | 20 ++++++-------
>  drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c    |  9 +++---
>  drivers/hid/i2c-hid/i2c-hid.c                     |  9 +++---
>  drivers/iommu/dmar.c                              | 11 ++++----
>  drivers/pci/pci-acpi.c                            | 11 ++++----
>  drivers/pci/pci-label.c                           |  4 +--
>  drivers/thermal/int340x_thermal/int3400_thermal.c |  6 ++--
>  drivers/usb/host/xhci-pci.c                       |  9 +++---
>  include/acpi/acpi_bus.h                           | 10 ++++---
>  include/linux/acpi.h                              |  2 +-
>  include/linux/pci-acpi.h                          |  2 +-
>  sound/soc/intel/skylake/skl-nhlt.c                |  7 +++--
>  20 files changed, 92 insertions(+), 129 deletions(-)
>
[..]
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index ad6d8c6..3beb99b 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -43,11 +43,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);
>
> @@ -83,7 +83,7 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
>         const char *cmd_name, * dimm_name;
>         unsigned long dsm_mask;
>         acpi_handle handle;
> -       const u8 *uuid;
> +       const uuid_le *uuid;
>         u32 offset;
>         int rc, i;
>
> @@ -225,7 +225,7 @@ static 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(*to_nfit_uuid(i), *(uuid_le *)spa->range_guid))
>                         return i;
>         return -1;
>  }
> @@ -829,7 +829,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>  {
>         struct acpi_device *adev, *adev_dimm;
>         struct device *dev = acpi_desc->dev;
> -       const u8 *uuid = to_nfit_uuid(NFIT_DEV_DIMM);
> +       const uuid_le *uuid = to_nfit_uuid(NFIT_DEV_DIMM);
>         int i;
>
>         nfit_mem->dsm_mask = acpi_desc->dimm_dsm_force_en;
> @@ -909,7 +909,7 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
>  static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
>  {
>         struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc;
> -       const u8 *uuid = to_nfit_uuid(NFIT_DEV_BUS);
> +       const uuid_le *uuid = to_nfit_uuid(NFIT_DEV_BUS);
>         struct acpi_device *adev;
>         int i;
>
> @@ -2079,16 +2079,16 @@ static __init int nfit_init(void)
>         BUILD_BUG_ON(sizeof(struct acpi_nfit_control_region) != 80);
>         BUILD_BUG_ON(sizeof(struct acpi_nfit_data_region) != 40);
>
> -       acpi_str_to_uuid(UUID_VOLATILE_MEMORY, nfit_uuid[NFIT_SPA_VOLATILE]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_MEMORY, nfit_uuid[NFIT_SPA_PM]);
> -       acpi_str_to_uuid(UUID_CONTROL_REGION, nfit_uuid[NFIT_SPA_DCR]);
> -       acpi_str_to_uuid(UUID_DATA_REGION, nfit_uuid[NFIT_SPA_BDW]);
> -       acpi_str_to_uuid(UUID_VOLATILE_VIRTUAL_DISK, nfit_uuid[NFIT_SPA_VDISK]);
> -       acpi_str_to_uuid(UUID_VOLATILE_VIRTUAL_CD, nfit_uuid[NFIT_SPA_VCD]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_VIRTUAL_DISK, nfit_uuid[NFIT_SPA_PDISK]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_VIRTUAL_CD, nfit_uuid[NFIT_SPA_PCD]);
> -       acpi_str_to_uuid(UUID_NFIT_BUS, nfit_uuid[NFIT_DEV_BUS]);
> -       acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
> +       uuid_le_to_bin(UUID_VOLATILE_MEMORY, &nfit_uuid[NFIT_SPA_VOLATILE]);
> +       uuid_le_to_bin(UUID_PERSISTENT_MEMORY, &nfit_uuid[NFIT_SPA_PM]);
> +       uuid_le_to_bin(UUID_CONTROL_REGION, &nfit_uuid[NFIT_SPA_DCR]);
> +       uuid_le_to_bin(UUID_DATA_REGION, &nfit_uuid[NFIT_SPA_BDW]);
> +       uuid_le_to_bin(UUID_VOLATILE_VIRTUAL_DISK, &nfit_uuid[NFIT_SPA_VDISK]);
> +       uuid_le_to_bin(UUID_VOLATILE_VIRTUAL_CD, &nfit_uuid[NFIT_SPA_VCD]);
> +       uuid_le_to_bin(UUID_PERSISTENT_VIRTUAL_DISK, &nfit_uuid[NFIT_SPA_PDISK]);
> +       uuid_le_to_bin(UUID_PERSISTENT_VIRTUAL_CD, &nfit_uuid[NFIT_SPA_PCD]);
> +       uuid_le_to_bin(UUID_NFIT_BUS, &nfit_uuid[NFIT_DEV_BUS]);
> +       uuid_le_to_bin(UUID_NFIT_DIMM, &nfit_uuid[NFIT_DEV_DIMM]);

I don't see the benefit of this change.  For the NFIT driver we went
through a fire drill trying to make sure the ACPI spec format of a
UUID matched the Linux interpretation, and this change makes that
harder to determine.  ACPI drivers should use ACPICA uuid helper
routines in my opinion.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Theodore Ts'o" <tytso@mit.edu>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	David Airlie <airlied@linux.ie>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Lv Zheng <lv.zheng@intel.com>, Mark Brown <broonie@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Maling list - DRI developers  <dri-devel@lists.freedesktop.org>,
	linux-efi@vger.kernel.org, linux-api@vger.kernel.org,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>
Subject: Re: [PATCH v1 05/10] ACPI: switch to use generic UUID API
Date: Wed, 17 Feb 2016 09:49:35 -0800	[thread overview]
Message-ID: <CAPcyv4inMjmt8eH_=bNE_=NMeYGmS75B5LxB=f7Cd762=3UKyQ@mail.gmail.com> (raw)
In-Reply-To: <1455711448-124103-6-git-send-email-andriy.shevchenko@linux.intel.com>

On Wed, Feb 17, 2016 at 4:17 AM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> Instead of opencoding the existing library functions let's use them directly.
>
> The conversion fixes a potential bug in int340x_thermal as well since we have
> to use memcmp() on binary data.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/acpi/acpi_extlog.c                        |  8 +++---
>  drivers/acpi/bus.c                                | 29 ++-----------------
>  drivers/acpi/nfit.c                               | 34 +++++++++++------------
>  drivers/acpi/nfit.h                               |  3 +-
>  drivers/acpi/utils.c                              |  4 +--
>  drivers/char/tpm/tpm_crb.c                        |  9 +++---
>  drivers/char/tpm/tpm_ppi.c                        | 20 ++++++-------
>  drivers/gpu/drm/i915/intel_acpi.c                 | 14 ++++------
>  drivers/gpu/drm/nouveau/nouveau_acpi.c            | 20 ++++++-------
>  drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c    |  9 +++---
>  drivers/hid/i2c-hid/i2c-hid.c                     |  9 +++---
>  drivers/iommu/dmar.c                              | 11 ++++----
>  drivers/pci/pci-acpi.c                            | 11 ++++----
>  drivers/pci/pci-label.c                           |  4 +--
>  drivers/thermal/int340x_thermal/int3400_thermal.c |  6 ++--
>  drivers/usb/host/xhci-pci.c                       |  9 +++---
>  include/acpi/acpi_bus.h                           | 10 ++++---
>  include/linux/acpi.h                              |  2 +-
>  include/linux/pci-acpi.h                          |  2 +-
>  sound/soc/intel/skylake/skl-nhlt.c                |  7 +++--
>  20 files changed, 92 insertions(+), 129 deletions(-)
>
[..]
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index ad6d8c6..3beb99b 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -43,11 +43,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);
>
> @@ -83,7 +83,7 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
>         const char *cmd_name, * dimm_name;
>         unsigned long dsm_mask;
>         acpi_handle handle;
> -       const u8 *uuid;
> +       const uuid_le *uuid;
>         u32 offset;
>         int rc, i;
>
> @@ -225,7 +225,7 @@ static 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(*to_nfit_uuid(i), *(uuid_le *)spa->range_guid))
>                         return i;
>         return -1;
>  }
> @@ -829,7 +829,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>  {
>         struct acpi_device *adev, *adev_dimm;
>         struct device *dev = acpi_desc->dev;
> -       const u8 *uuid = to_nfit_uuid(NFIT_DEV_DIMM);
> +       const uuid_le *uuid = to_nfit_uuid(NFIT_DEV_DIMM);
>         int i;
>
>         nfit_mem->dsm_mask = acpi_desc->dimm_dsm_force_en;
> @@ -909,7 +909,7 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
>  static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
>  {
>         struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc;
> -       const u8 *uuid = to_nfit_uuid(NFIT_DEV_BUS);
> +       const uuid_le *uuid = to_nfit_uuid(NFIT_DEV_BUS);
>         struct acpi_device *adev;
>         int i;
>
> @@ -2079,16 +2079,16 @@ static __init int nfit_init(void)
>         BUILD_BUG_ON(sizeof(struct acpi_nfit_control_region) != 80);
>         BUILD_BUG_ON(sizeof(struct acpi_nfit_data_region) != 40);
>
> -       acpi_str_to_uuid(UUID_VOLATILE_MEMORY, nfit_uuid[NFIT_SPA_VOLATILE]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_MEMORY, nfit_uuid[NFIT_SPA_PM]);
> -       acpi_str_to_uuid(UUID_CONTROL_REGION, nfit_uuid[NFIT_SPA_DCR]);
> -       acpi_str_to_uuid(UUID_DATA_REGION, nfit_uuid[NFIT_SPA_BDW]);
> -       acpi_str_to_uuid(UUID_VOLATILE_VIRTUAL_DISK, nfit_uuid[NFIT_SPA_VDISK]);
> -       acpi_str_to_uuid(UUID_VOLATILE_VIRTUAL_CD, nfit_uuid[NFIT_SPA_VCD]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_VIRTUAL_DISK, nfit_uuid[NFIT_SPA_PDISK]);
> -       acpi_str_to_uuid(UUID_PERSISTENT_VIRTUAL_CD, nfit_uuid[NFIT_SPA_PCD]);
> -       acpi_str_to_uuid(UUID_NFIT_BUS, nfit_uuid[NFIT_DEV_BUS]);
> -       acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
> +       uuid_le_to_bin(UUID_VOLATILE_MEMORY, &nfit_uuid[NFIT_SPA_VOLATILE]);
> +       uuid_le_to_bin(UUID_PERSISTENT_MEMORY, &nfit_uuid[NFIT_SPA_PM]);
> +       uuid_le_to_bin(UUID_CONTROL_REGION, &nfit_uuid[NFIT_SPA_DCR]);
> +       uuid_le_to_bin(UUID_DATA_REGION, &nfit_uuid[NFIT_SPA_BDW]);
> +       uuid_le_to_bin(UUID_VOLATILE_VIRTUAL_DISK, &nfit_uuid[NFIT_SPA_VDISK]);
> +       uuid_le_to_bin(UUID_VOLATILE_VIRTUAL_CD, &nfit_uuid[NFIT_SPA_VCD]);
> +       uuid_le_to_bin(UUID_PERSISTENT_VIRTUAL_DISK, &nfit_uuid[NFIT_SPA_PDISK]);
> +       uuid_le_to_bin(UUID_PERSISTENT_VIRTUAL_CD, &nfit_uuid[NFIT_SPA_PCD]);
> +       uuid_le_to_bin(UUID_NFIT_BUS, &nfit_uuid[NFIT_DEV_BUS]);
> +       uuid_le_to_bin(UUID_NFIT_DIMM, &nfit_uuid[NFIT_DEV_DIMM]);

I don't see the benefit of this change.  For the NFIT driver we went
through a fire drill trying to make sure the ACPI spec format of a
UUID matched the Linux interpretation, and this change makes that
harder to determine.  ACPI drivers should use ACPICA uuid helper
routines in my opinion.

  reply	other threads:[~2016-02-17 17:49 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 12:17 [PATCH v1 00/10] uuid: convert users to generic UUID API Andy Shevchenko
2016-02-17 12:17 ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 01/10] lib/vsprintf: simplify UUID printing Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 02/10] lib/uuid: move generate_random_uuid() to uuid.c Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 03/10] lib/uuid: introduce few more generic helpers for UUID Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 04/10] lib/uuid: remove FSF address Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 05/10] ACPI: switch to use generic UUID API Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 17:49   ` Dan Williams [this message]
2016-02-17 17:49     ` Dan Williams
2016-02-17 17:49     ` Dan Williams
2016-02-26 13:46     ` Andy Shevchenko
2016-02-26 13:46       ` Andy Shevchenko
2016-02-26 13:46       ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 06/10] device property: switch to use " Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-18  0:03   ` Rafael J. Wysocki
2016-02-18  0:03     ` Rafael J. Wysocki
2016-02-18  0:03     ` Rafael J. Wysocki
2016-02-26 14:11     ` Andy Shevchenko
2016-02-26 14:11       ` Andy Shevchenko
2016-02-26 14:11       ` Andy Shevchenko
2016-04-07 16:41       ` Andy Shevchenko
2016-04-07 16:41         ` Andy Shevchenko
2016-04-07 16:41         ` Andy Shevchenko
2016-04-08  1:27         ` Huang, Ying
2016-04-08  1:27           ` Huang, Ying
2016-04-08  1:27           ` Huang, Ying
2016-04-08 10:00           ` Andy Shevchenko
2016-04-08 10:00             ` Andy Shevchenko
2016-04-08 10:00             ` Andy Shevchenko
2016-04-08 23:46             ` huang ying
2016-04-08 23:46               ` huang ying
2016-04-08 23:46               ` huang ying
2016-02-18 11:07   ` Mika Westerberg
2016-02-18 11:07     ` Mika Westerberg
2016-02-26 14:28     ` Andy Shevchenko
2016-02-26 14:28       ` Andy Shevchenko
2016-02-26 14:28       ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 07/10] sysctl: drop away useless label Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 08/10] sysctl: use generic UUID library Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 09/10] efi: redefine type, constant, macro from generic code Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17 ` [PATCH v1 10/10] efivars: use generic UUID library Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-17 12:17   ` Andy Shevchenko
2016-02-18 15:07   ` Matt Fleming
2016-02-18 15:07     ` Matt Fleming
2016-02-26 14:29     ` Andy Shevchenko
2016-02-26 14:29       ` Andy Shevchenko
2016-02-26 14:29       ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPcyv4inMjmt8eH_=bNE_=NMeYGmS75B5LxB=f7Cd762=3UKyQ@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=benjamin.tissoires@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=broonie@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lv.zheng@intel.com \
    --cc=mathias.nyman@intel.com \
    --cc=matt@codeblueprint.co.uk \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.