From patchwork Thu Nov 23 10:06:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 168848 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp338445vqx; Thu, 23 Nov 2023 02:08:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoUlSi4by0ugpfQ0hskjiFIJ5Gwqcylg/2RuD6nU0uQZdKpt0qAWMOBtMGfe2UtEIf38vW X-Received: by 2002:a17:903:1108:b0:1cc:2575:db14 with SMTP id n8-20020a170903110800b001cc2575db14mr6095440plh.60.1700734111586; Thu, 23 Nov 2023 02:08:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700734111; cv=none; d=google.com; s=arc-20160816; b=B63NkElqZsQflb7ENEo5OSx8Vhm19ImRrv/T2TScTGO7Hdveul8AYsSFlTXR7WO232 fiSWiglSKJINU2BcP94j00hI3z44kPUqkVX7Mw5NNwPI8E0uXUIY6qyZ2gc4D/yAZWo+ HfQG7OLWnDRxecR0VvZ6M4/XGrrwxj668S804bsXHS3QfvdWx5Qmb/T8lHp2j1DAud4S B0kBQd0/b+aUjEGPm7Ygsp6w4xuk+n99DGtCIu9EQLNvsNCk2TaX/BwQ5a5VRtpkhFAk pGyIEjcLbHYhrgDd3IDe0XNcAqMkDOt4FP01bX8BCEDzTAY6ZcWJA/B9ZWQ5uuh5Vvh7 zJ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=NQJ42DI1/kJ2EhQYP9IbkQly2pwdytZxZ2jV9J8mazM=; fh=LrjGCQr9k+7CYyd6XEdJgJkCFIUW/cPwqK3zW8PbdHI=; b=h9DAIEGTnrttva2trxMAmhEGaGEcj9xKGWJRIW5vj+drMAhfHkrlGoOIgTDDXNd/l4 Mo578Su7HxvfofAES9V9fQlVQDQW1DreVJpKUU0bdHXW4BV0/fXMNAJ+ztLOEp7/fyJD xQK+0fSuF++aU7lXNzu+2KJmndm59iiBqFqtIZxCi3DoF4c0/2vVqf5/Ym8K0SOQVLoW LpcKBtkESzv1wU1Ew4kEpqExlQeSTP3hJTZgwd6vqc4cEOYYz6pe3adIj0kluqDWBwwG dVf4po+oArs9h10pj9OjomayUq7NVcslB+JFsnJYYPsptxH48qDLPFaURNeBn/MI9cV4 Aeug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TaQG2Lew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id iw17-20020a170903045100b001cf56ff28a4si813827plb.522.2023.11.23.02.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 02:08:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TaQG2Lew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1B6D380732A9; Thu, 23 Nov 2023 02:08:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344779AbjKWKH4 (ORCPT + 99 others); Thu, 23 Nov 2023 05:07:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235349AbjKWKHW (ORCPT ); Thu, 23 Nov 2023 05:07:22 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9969010E0; Thu, 23 Nov 2023 02:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700734048; x=1732270048; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ibYMWWRd/P2AQAHicSo9ziPs651CklYQuIen4L+deis=; b=TaQG2LewxNxeUWqKuhpYuwb3nBje1pKnwXSRrxiXt4JtjzvoEjvHkmTb sIp8GVsY/jwKyW0gzIplwMOSEvwKqa0gRQIFTyWBWtzJPwodg7GNPmmSi gSKDOPsLUOinHAj830KcdSW3960ljlHw6noYPybpoUS9h/eqyNRoKJzVR pddlpu6tmhYYmlAnGcXZI+FkE4FqEp3f7kPfF8BVMheksBUe/gHzOCcbA e1Yb3YpUDJn2g9LAl9eSGpfWFiMZesMoNTqog4NdD0B2utdAKkpDfKrS0 8i+fnI02nqJlZxHf5+rmzSxWqLnLporMO1OAwd/TfcVtLUcZyHWRmJXOI Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="456576426" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="456576426" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 02:07:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="767160521" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="767160521" Received: from inlubt0316.iind.intel.com ([10.191.20.213]) by orsmga002.jf.intel.com with ESMTP; 23 Nov 2023 02:07:21 -0800 From: Raag Jadav To: mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, rafael@kernel.org, lenb@kernel.org, robert.moore@intel.com, ardb@kernel.org, will@kernel.org, mark.rutland@arm.com Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mallikarjunappa.sangannavar@intel.com, bala.senthil@intel.com, Raag Jadav Subject: [PATCH v3 4/5] efi: dev-path-parser: use acpi_dev_uid_match() for matching _UID Date: Thu, 23 Nov 2023 15:36:16 +0530 Message-Id: <20231123100617.28020-5-raag.jadav@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231123100617.28020-1-raag.jadav@intel.com> References: <20231123100617.28020-1-raag.jadav@intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 23 Nov 2023 02:08:29 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783348971616189226 X-GMAIL-MSGID: 1783348971616189226 Now that we have _UID matching support for integer types, we can use acpi_dev_uid_match() for it. Signed-off-by: Raag Jadav Reviewed-by: Ard Biesheuvel --- drivers/firmware/efi/dev-path-parser.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/dev-path-parser.c b/drivers/firmware/efi/dev-path-parser.c index f80d87c199c3..937be269fee8 100644 --- a/drivers/firmware/efi/dev-path-parser.c +++ b/drivers/firmware/efi/dev-path-parser.c @@ -18,8 +18,6 @@ static long __init parse_acpi_path(const struct efi_dev_path *node, struct acpi_device *adev; struct device *phys_dev; char hid[ACPI_ID_LEN]; - u64 uid; - int ret; if (node->header.length != 12) return -EINVAL; @@ -31,10 +29,9 @@ static long __init parse_acpi_path(const struct efi_dev_path *node, node->acpi.hid >> 16); for_each_acpi_dev_match(adev, hid, NULL, -1) { - ret = acpi_dev_uid_to_integer(adev, &uid); - if (ret == 0 && node->acpi.uid == uid) + if (acpi_dev_uid_match(adev, node->acpi.uid)) break; - if (ret == -ENODATA && node->acpi.uid == 0) + if (!acpi_device_uid(adev) && node->acpi.uid == 0) break; } if (!adev)