From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhang Rui Subject: Re: [PATCH v1] ACPI: Switch to use generic UUID API Date: Wed, 10 May 2017 09:20:51 +0800 Message-ID: <1494379251.2129.15.camel@intel.com> References: <20170504092151.88646-1-andriy.shevchenko@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20170504092151.88646-1-andriy.shevchenko@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org To: Andy Shevchenko , linux-acpi@vger.kernel.org, tpmdd-devel@lists.sourceforge.net, intel-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-input@vger.kernel.org, iommu@lists.linux-foundation.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: "Rafael J . Wysocki" , Mika Westerberg , Borislav Petkov , Dan Williams , Amir Goldstein , Jarkko Sakkinen , Jani Nikula , Ben Skeggs , Benjamin Tissoires , Joerg Roedel , Adrian Hunter , Yisen Zhuang , Bjorn Helgaas , Felipe Balbi , Mathias Nyman , Heikki Krogerus , Liam Girdwood , Mark Brown List-Id: tpmdd-devel@lists.sourceforge.net On Thu, 2017-05-04 at 12:21 +0300, Andy Shevchenko 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 > Cc: Mika Westerberg > Cc: Borislav Petkov > Cc: Dan Williams > Cc: Amir Goldstein > Cc: Jarkko Sakkinen > Cc: Jani Nikula > Cc: Ben Skeggs > Cc: Benjamin Tissoires > Cc: Joerg Roedel > Cc: Adrian Hunter > Cc: Yisen Zhuang > Cc: Bjorn Helgaas > Cc: Zhang Rui > Cc: Felipe Balbi > Cc: Mathias Nyman > Cc: Heikki Krogerus > Cc: Liam Girdwood > Cc: Mark Brown > Signed-off-by: Andy Shevchenko > --- > > diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c > b/drivers/thermal/int340x_thermal/int3400_thermal.c > index 9413c4abf0b9..c0eb3bb19b23 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 { >   INT3400_THERMAL_MAXIMUM_UUID, >  }; >   > -static u8 *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = { > +static const char > *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = { >   "42A441D6-AE6A-462b-A84B-4A8CE79027D3", >   "3A95C389-E4B8-4629-A526-C52C88626BAE", >   "97C68AE7-15FA-499c-B8C9-5DA81D606E0A", > @@ -141,10 +141,10 @@ static int int3400_thermal_get_uuids(struct > int3400_thermal_priv *priv) >   } >   >   for (j = 0; j < INT3400_THERMAL_MAXIMUM_UUID; j++) { > - u8 uuid[16]; > + uuid_le u; >   > - acpi_str_to_uuid(int3400_thermal_uuids[j], > uuid); > - if (!strncmp(uuid, objb->buffer.pointer, > 16)) { > + uuid_le_to_bin(int3400_thermal_uuids[j], > &u); > + if (!uuid_le_cmp(*(uuid_le *)objb- > >buffer.pointer), u) { >   priv->uuid_bitmap |= (1 << j); >   break; >   } thanks for the fix. Acked-by: Zhang Rui -rui