Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1039700rdb; Fri, 20 Oct 2023 06:59:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyYK8X3gTnRfBk42+vFjdjrUI/iD5a52XfP/d3yHzCrPFz8nEPU11os0Hf7h68hhKhFwi4 X-Received: by 2002:a17:90a:1e:b0:27d:3c3b:ced4 with SMTP id 30-20020a17090a001e00b0027d3c3bced4mr1772244pja.43.1697810398599; Fri, 20 Oct 2023 06:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697810398; cv=none; d=google.com; s=arc-20160816; b=XgYIQDF60XVVV37y0p1EJti0sd8Hh2yATGXVA5iiehM8IqP7pt9WVnsdikZ10EQ579 hBFO21cNA+8IGqFDwCvQfyHMx5/mmtTcTjr9erJQNX2H/TtFD9uh/VzSp0Z/TdCjZ3iH rf1nZpmXRTdXQfDsAv0e02DPDj//yrktDq/VSayvWAbdIawbw5KGUoYYnJ7yrl3QUgIb NDz/H0X2BtDimOiMsPvIBG0K0C9eXvRrnTBK7+XYf20x/cJbn8jSydD42/BBmKBtPkz9 6OtraGSMqxi2xdVetsCO2cZ/NBgdEYvnIB8ymm9aPlid4chMvzvv7AGJ3fbqxoHul3HD 9LKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:dkim-signature; bh=7LtfXe/DEMD/lHzUFvMa+OWRluqZ+xc9nu0Cirekhm8=; fh=fsyAuNB/DSg1U7UX7eNCxiktnX6hL44TY4TypijRa+A=; b=qGCnF+ZJMxHc1Gx6zuaaQJHC9QgvBe0+wk89h6XXY9VOo4lFbe9QMoQ6VPfrPFpuAo Rh1xz067aDfWt27H/EJmz1/ZzBxkDPKmDgvK6A45eMd9zfwqAXg+ayrCX7KMrk06g5AL AHrM5nPmSRQZq6xGppGvvSSzX0JQJVkdpXJ/KjNiEqAztB+SoBB2/uJjnfW5iowI5K4A SD5p42t3yZGxdppk5nrJwc9WRlC+4l7ycRbLGPKE0iSxGU89zm1BMnedBhGE9zPvvxUo wjJ3a8yphWRMEAiaqNNMxdA62VX+EqGnaJC665gsfcJJ+THaXDmosSFm+X2sstxC4NIa K83Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=K8ajnGCN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x21-20020a17090a8a9500b00277507e8085si4285009pjn.55.2023.10.20.06.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 06:59:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=K8ajnGCN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A530C82F34BD; Fri, 20 Oct 2023 06:59:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377495AbjJTN7y (ORCPT + 99 others); Fri, 20 Oct 2023 09:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377376AbjJTN7x (ORCPT ); Fri, 20 Oct 2023 09:59:53 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9910291; Fri, 20 Oct 2023 06:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7LtfXe/DEMD/lHzUFvMa+OWRluqZ+xc9nu0Cirekhm8=; b=K8ajnGCN3VL45r0nzCQRkKqgwa uaygU4jSLCNphjhbsSYH8Mw9uxK5T31L7XeD8pTVWCGk8CcAh92YnB/TfUR7mKBwJS80swJozBKlr eXnE7NkUH2skU9CMUPuNlc9uT+khCy+DZMe8tMiuhfaky/jhewxrmnVNLFl4PLGi3Ts+qGGViLz63 RHZ2qOf2UeyCHJH5jmS4hdF1X4lUg8k9JphXTk/Ri3v4uOjEAQbWq7MmvzWNDzpYZwW6Oi1Dkh12g O64D98spVaGRJRVcmlWvEiofQPLj/uLdDB7UiqT7+uWqgU0iJlxN7OV57bjSvVAH/KLob5pF8ud/G uKT/B9gA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55754 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qtq2V-0000UO-0z; Fri, 20 Oct 2023 14:59:47 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qtq2W-00AJ8T-Mm; Fri, 20 Oct 2023 14:59:48 +0100 From: Russell King (Oracle) To: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev Cc: x86@kernel.org, James Morse , Salil Mehta , Jonathan Cameron , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org Subject: [PATCH] ACPI: Use the acpi_device_is_present() helper in more places MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Fri, 20 Oct 2023 14:59:48 +0100 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 20 Oct 2023 06:59:57 -0700 (PDT) From: James Morse acpi_device_is_present() checks the present or functional bits from the cached copy of _STA. A few places open-code this check. Use the helper instead to improve readability. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) --- Jonathan Cameron suggests "Pull this one out and send it upstream in advance of the rest" so let's do that. See https://lore.kernel.org/r/20230914130455.00004434@Huawei.com/ So, let's get this upstream to reduce the number of outstanding patches for aarch64 vcpu hotplug. drivers/acpi/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 691d4b7686ee..ed01e19514ef 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -304,7 +304,7 @@ static int acpi_scan_device_check(struct acpi_device *adev) int error; acpi_bus_get_status(adev); - if (adev->status.present || adev->status.functional) { + if (acpi_device_is_present(adev)) { /* * This function is only called for device objects for which * matching scan handlers exist. The only situation in which @@ -338,7 +338,7 @@ static int acpi_scan_bus_check(struct acpi_device *adev, void *not_used) int error; acpi_bus_get_status(adev); - if (!(adev->status.present || adev->status.functional)) { + if (!acpi_device_is_present(adev)) { acpi_scan_device_not_present(adev); return 0; } -- 2.30.2