Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1692094 > unrolled thread

[PATCH v1 6/6] device property: Switch to use new generic UUID API

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2017-07-19 20:30 +0200
Last post2017-07-26 21:10 +0200
Articles 8 — 5 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v1 6/6] device property: Switch to use new generic UUID API Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-07-19 20:30 +0200
    Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API "Rafael J. Wysocki" <rafael@kernel.org> - 2017-07-19 21:30 +0200
    Re: [PATCH v1 6/6] device property: Switch to use new generic UUID  API Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-07-25 16:20 +0200
      Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-26 02:30 +0200
        Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-07-26 02:40 +0200
          Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-26 02:40 +0200
            Re: [PATCH v1 6/6] device property: Switch to use new generic UUID  API Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-07-26 12:10 +0200
              Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-26 21:10 +0200

#1692094 — [PATCH v1 6/6] device property: Switch to use new generic UUID API

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-07-19 20:30 +0200
Subject[PATCH v1 6/6] device property: Switch to use new generic UUID API
Message-ID<u51Tt-3Yc-43@gated-at.bofh.it>
There are new types and helpers that are supposed to be used in new code.

As a preparation to get rid of legacy types and API functions do
the conversion here.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/property.c | 50 ++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 917c789f953d..a7fdbe083a7e 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -24,16 +24,14 @@ static int acpi_data_get_property_array(struct acpi_device_data *data,
 					acpi_object_type type,
 					const union acpi_object **obj);
 
-/* ACPI _DSD device properties UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */
-static const u8 prp_uuid[16] = {
-	0x14, 0xd8, 0xff, 0xda, 0xba, 0x6e, 0x8c, 0x4d,
-	0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01
-};
-/* ACPI _DSD data subnodes UUID: dbb8e3e6-5886-4ba6-8795-1319f52a966b */
-static const u8 ads_uuid[16] = {
-	0xe6, 0xe3, 0xb8, 0xdb, 0x86, 0x58, 0xa6, 0x4b,
-	0x87, 0x95, 0x13, 0x19, 0xf5, 0x2a, 0x96, 0x6b
-};
+/* ACPI _DSD device properties GUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */
+static const guid_t prp_guid =
+	GUID_INIT(0xdaffd814, 0x6eba, 0x4d8c,
+		  0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01);
+/* ACPI _DSD data subnodes GUID: dbb8e3e6-5886-4ba6-8795-1319f52a966b */
+static const guid_t ads_guid =
+	GUID_INIT(0xdbb8e3e6, 0x5886, 0x4ba6,
+		  0x87, 0x95, 0x13, 0x19, 0xf5, 0x2a, 0x96, 0x6b);
 
 static bool acpi_enumerate_nondev_subnodes(acpi_handle scope,
 					   const union acpi_object *desc,
@@ -190,22 +188,23 @@ static bool acpi_enumerate_nondev_subnodes(acpi_handle scope,
 {
 	int i;
 
-	/* Look for the ACPI data subnodes UUID. */
+	/* Look for the ACPI data subnodes GUID. */
 	for (i = 0; i < desc->package.count; i += 2) {
-		const union acpi_object *uuid, *links;
+		const union acpi_object *guid, *links;
 
-		uuid = &desc->package.elements[i];
+		guid = &desc->package.elements[i];
 		links = &desc->package.elements[i + 1];
 
 		/*
-		 * The first element must be a UUID and the second one must be
+		 * The first element must be a GUID and the second one must be
 		 * a package.
 		 */
-		if (uuid->type != ACPI_TYPE_BUFFER || uuid->buffer.length != 16
-		    || links->type != ACPI_TYPE_PACKAGE)
+		if (guid->type != ACPI_TYPE_BUFFER ||
+		    guid->buffer.length != 16 ||
+		    links->type != ACPI_TYPE_PACKAGE)
 			break;
 
-		if (memcmp(uuid->buffer.pointer, ads_uuid, sizeof(ads_uuid)))
+		if (!guid_equal((guid_t *)guid->buffer.pointer, &ads_guid))
 			continue;
 
 		return acpi_add_nondev_subnodes(scope, links, &data->subnodes,
@@ -298,26 +297,27 @@ static bool acpi_extract_properties(const union acpi_object *desc,
 	if (desc->package.count % 2)
 		return false;
 
-	/* Look for the device properties UUID. */
+	/* Look for the device properties GUID. */
 	for (i = 0; i < desc->package.count; i += 2) {
-		const union acpi_object *uuid, *properties;
+		const union acpi_object *guid, *properties;
 
-		uuid = &desc->package.elements[i];
+		guid = &desc->package.elements[i];
 		properties = &desc->package.elements[i + 1];
 
 		/*
-		 * The first element must be a UUID and the second one must be
+		 * The first element must be a GUID and the second one must be
 		 * a package.
 		 */
-		if (uuid->type != ACPI_TYPE_BUFFER || uuid->buffer.length != 16
-		    || properties->type != ACPI_TYPE_PACKAGE)
+		if (guid->type != ACPI_TYPE_BUFFER ||
+		    guid->buffer.length != 16 ||
+		    properties->type != ACPI_TYPE_PACKAGE)
 			break;
 
-		if (memcmp(uuid->buffer.pointer, prp_uuid, sizeof(prp_uuid)))
+		if (!guid_equal((guid_t *)guid->buffer.pointer, &prp_guid))
 			continue;
 
 		/*
-		 * We found the matching UUID. Now validate the format of the
+		 * We found the matching GUID. Now validate the format of the
 		 * package immediately following it.
 		 */
 		if (!acpi_properties_format_valid(properties))
-- 
2.11.0

[toc] | [next] | [standalone]


#1692135

From"Rafael J. Wysocki" <rafael@kernel.org>
Date2017-07-19 21:30 +0200
Message-ID<u52Pv-4BQ-5@gated-at.bofh.it>
In reply to#1692094
On Wed, Jul 19, 2017 at 8:28 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> There are new types and helpers that are supposed to be used in new code.
>
> As a preparation to get rid of legacy types and API functions do
> the conversion here.

Please talk to Mika about this one.

Thanks,
Rafael

[toc] | [prev] | [next] | [standalone]


#1695769 — Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-07-25 16:20 +0200
SubjectRe: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Message-ID<u78QN-3RN-1@gated-at.bofh.it>
In reply to#1692094
On Wed, Jul 19, 2017 at 09:28:57PM +0300, Andy Shevchenko wrote:
> There are new types and helpers that are supposed to be used in new code.
> 
> As a preparation to get rid of legacy types and API functions do
> the conversion here.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

[toc] | [prev] | [next] | [standalone]


#1696686

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-07-26 02:30 +0200
Message-ID<u7in8-1wt-19@gated-at.bofh.it>
In reply to#1695769
On Tuesday, July 25, 2017 05:12:35 PM Mika Westerberg wrote:
> On Wed, Jul 19, 2017 at 09:28:57PM +0300, Andy Shevchenko wrote:
> > There are new types and helpers that are supposed to be used in new code.
> > 
> > As a preparation to get rid of legacy types and API functions do
> > the conversion here.
> > 
> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

OK

Andy, do you want me to apply this?

Thanks,
Rafael

[toc] | [prev] | [next] | [standalone]


#1696693

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-07-26 02:40 +0200
Message-ID<u7iwO-1zY-21@gated-at.bofh.it>
In reply to#1696686
On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Tuesday, July 25, 2017 05:12:35 PM Mika Westerberg wrote:
>> On Wed, Jul 19, 2017 at 09:28:57PM +0300, Andy Shevchenko wrote:
>> > There are new types and helpers that are supposed to be used in new code.
>> >
>> > As a preparation to get rid of legacy types and API functions do
>> > the conversion here.
>> >
>> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
>>
>> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> OK
>
> Andy, do you want me to apply this?

If you would like to.

The patch is now pretty independent since necessary stuff made v4.13-rc1.

-- 
With Best Regards,
Andy Shevchenko

[toc] | [prev] | [next] | [standalone]


#1696701

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-07-26 02:40 +0200
Message-ID<u7iwP-1zY-45@gated-at.bofh.it>
In reply to#1696693
On Wednesday, July 26, 2017 03:35:01 AM Andy Shevchenko wrote:
> On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Tuesday, July 25, 2017 05:12:35 PM Mika Westerberg wrote:
> >> On Wed, Jul 19, 2017 at 09:28:57PM +0300, Andy Shevchenko wrote:
> >> > There are new types and helpers that are supposed to be used in new code.
> >> >
> >> > As a preparation to get rid of legacy types and API functions do
> >> > the conversion here.
> >> >
> >> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> >> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> >>
> >> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> >
> > OK
> >
> > Andy, do you want me to apply this?
> 
> If you would like to.
> 
> The patch is now pretty independent since necessary stuff made v4.13-rc1.

OK

[toc] | [prev] | [next] | [standalone]


#1696952 — Re: [PATCH v1 6/6] device property: Switch to use new generic UUID API

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-07-26 12:10 +0200
SubjectRe: [PATCH v1 6/6] device property: Switch to use new generic UUID API
Message-ID<u7rqq-7pw-15@gated-at.bofh.it>
In reply to#1696701
On Wed, 2017-07-26 at 02:27 +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 26, 2017 03:35:01 AM Andy Shevchenko wrote:
> > On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <rjw@rjwysocki.ne
> > t> wrote:

> > > Andy, do you want me to apply this?
> > 
> > If you would like to.
> > 
> > The patch is now pretty independent since necessary stuff made
> > v4.13-rc1.
> 
> OK

Thanks!

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

[toc] | [prev] | [next] | [standalone]


#1697488

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-07-26 21:10 +0200
Message-ID<u7zR0-4iw-9@gated-at.bofh.it>
In reply to#1696952
On Wednesday, July 26, 2017 01:03:03 PM Andy Shevchenko wrote:
> On Wed, 2017-07-26 at 02:27 +0200, Rafael J. Wysocki wrote:
> > On Wednesday, July 26, 2017 03:35:01 AM Andy Shevchenko wrote:
> > > On Wed, Jul 26, 2017 at 3:21 AM, Rafael J. Wysocki <rjw@rjwysocki.ne
> > > t> wrote:
> 
> > > > Andy, do you want me to apply this?
> > > 
> > > If you would like to.
> > > 
> > > The patch is now pretty independent since necessary stuff made
> > > v4.13-rc1.
> > 
> > OK
> 
> Thanks!

Applied now, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web