Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp888909pxb; Wed, 27 Oct 2021 14:31:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyONELOmtQHMxCtGRdsbEyXr8A0AL/NtTc6SCitZ6AcTIczY4+1Sd4FSuXWroWCvCMbO83o X-Received: by 2002:a17:906:a3c4:: with SMTP id ca4mr57890ejb.529.1635370291002; Wed, 27 Oct 2021 14:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370290; cv=none; d=google.com; s=arc-20160816; b=An8VSD4xhn+jLDdDEaMfJONynYJiMHo0f89qPZVnWiSw90EDE/bd9WKNnDJyQTtrX4 zfNBMP2rKxyv6x4tcwKJmdIo0D8e16f5xG4gUbCcmi3WjmYd6IMYod/XjSjSYgpQ1DR2 CAYjoIBpBRlfrBFzyGpxoAtbLVVNQwKJyNyOKlv/H4c7v/h8LMgeRAUD092HlacxGAuU pdOJ5RrpYcTFUbM0dztbS7JftL1tnMw/HFfD5hG8809WxuQE/3QHrUVeVZe5BCfLrk4S Mr7Vem2QW7SAMhXfD5OmjpU51RNqq+5wl8x/AcDEg6S4D77jZx2jxmNHfLtuA3gxRIyi oc8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=FBS2Rd3LDSWBf7l5iKcsfavLnUHdkoN/YzOxjjMjYYU=; b=kWRShIDJ8Bgw3vLSHtsbuTnP8wPapq1QejQqXzKHWoJaXj5vz/Yi9/28P++PNoL8Yi MG6tPkFil6EC4W5vI69D6NNG97BRwVLep72uW/I6Z+p6YB2S0g3mww9KaqMNzLGYDPl5 DMbdAqxGfi+9sOUU2pJBn6lm5QwUNwlA35hFOCK36cVc5nM51Dd79U2H2Ed/SKhUBcit dwCfpP4+NsNG6mrCcefga6Twblp4NM2KcglyOww3fsO/6Nmhhv0On81onJVE/PkTEbvN 2sfBwElwkkoLJYtXL9qTTYqfUJLjWK3vaThgBjP+DQykIQ12RZfk+B61sKV3GyDb+vti 75Mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cr20si1503109ejc.762.2021.10.27.14.31.06; Wed, 27 Oct 2021 14:31:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243102AbhJ0RBz (ORCPT + 97 others); Wed, 27 Oct 2021 13:01:55 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:42428 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243151AbhJ0RBf (ORCPT ); Wed, 27 Oct 2021 13:01:35 -0400 Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 3.0.0) id f0d748fbbe410f5a; Wed, 27 Oct 2021 18:59:08 +0200 Received: from kreacher.localnet (unknown [213.134.161.235]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 34D7366AA20; Wed, 27 Oct 2021 18:59:07 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Andy Shevchenko , Hans de Goede , Mika Westerberg Subject: [PATCH] ACPI: glue: Use acpi_device_adr() in acpi_find_child_device() Date: Wed, 27 Oct 2021 18:59:06 +0200 Message-ID: <11862679.O9o76ZdvQC@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.161.235 X-CLIENT-HOSTNAME: 213.134.161.235 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvdegtddguddtgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdevgfetueetheekudeuvdduteelvefftdfftdejjeeukeffteeikefgiefghedunecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepvddufedrudefgedrudeiuddrvdefheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduiedurddvfeehpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnughrihihrdhshhgvvhgthhgvnhhkoheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehhuggvghhovgguvgesrhgv ughhrghtrdgtohhmpdhrtghpthhtohepmhhikhgrrdifvghsthgvrhgsvghrgheslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Instead of evaluating _ADR in acpi_find_child_device(), use the observation that it has already been evaluated and the value returned by it has been stored in the pnp.type.bus_address field of the ACPI device object at hand. Signed-off-by: Rafael J. Wysocki --- Note that the patch at https://patchwork.kernel.org/project/linux-acpi/patch/2223516.ElGaqSPkdT@kreacher/ will have an effect of this, so I'm going to prioritize the current patch over the one above. --- drivers/acpi/glue.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) Index: linux-pm/drivers/acpi/glue.c =================================================================== --- linux-pm.orig/drivers/acpi/glue.c +++ linux-pm/drivers/acpi/glue.c @@ -113,13 +113,10 @@ struct acpi_device *acpi_find_child_devi return NULL; list_for_each_entry(adev, &parent->children, node) { - unsigned long long addr; - acpi_status status; + acpi_bus_address addr = acpi_device_adr(adev); int score; - status = acpi_evaluate_integer(adev->handle, METHOD_NAME__ADR, - NULL, &addr); - if (ACPI_FAILURE(status) || addr != address) + if (!adev->pnp.type.bus_address || addr != address) continue; if (!ret) {