From patchwork Wed Jul 19 18:28:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 9852975 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DCE70602C8 for ; Wed, 19 Jul 2017 18:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9ECB1FFAE for ; Wed, 19 Jul 2017 18:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE71B205FD; Wed, 19 Jul 2017 18:31:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 640731FFB9 for ; Wed, 19 Jul 2017 18:31:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933388AbdGSS33 (ORCPT ); Wed, 19 Jul 2017 14:29:29 -0400 Received: from mga03.intel.com ([134.134.136.65]:53208 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933151AbdGSS3I (ORCPT ); Wed, 19 Jul 2017 14:29:08 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2017 11:29:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,381,1496127600"; d="scan'208";a="994832571" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 19 Jul 2017 11:29:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 374B0185; Wed, 19 Jul 2017 21:28:58 +0300 (EEST) From: Andy Shevchenko To: linux-acpi@vger.kernel.org, devel@linuxdriverproject.org, sparmaintainer@unisys.com, devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-efi@vger.kernel.org, Christoph Hellwig , linux-kernel@vger.kernel.org, Lukas Wunner Cc: Andy Shevchenko , "Rafael J. Wysocki" , Mika Westerberg Subject: [PATCH v1 6/6] device property: Switch to use new generic UUID API Date: Wed, 19 Jul 2017 21:28:57 +0300 Message-Id: <20170719182857.73693-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170719182857.73693-1-andriy.shevchenko@linux.intel.com> References: <20170719182857.73693-1-andriy.shevchenko@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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" Cc: Mika Westerberg Cc: linux-acpi@vger.kernel.org Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg --- 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))