Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3368596rdb; Wed, 13 Sep 2023 09:53:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJBbso403NxGaI3Ai1t8cbStnhGyqyhfm/G/ZYHB+fIKLOdxQ0M+DtTaaAyeU34VJimxMU X-Received: by 2002:a05:6a20:244f:b0:12f:c0c1:d70 with SMTP id t15-20020a056a20244f00b0012fc0c10d70mr3192474pzc.40.1694623989432; Wed, 13 Sep 2023 09:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694623989; cv=none; d=google.com; s=arc-20160816; b=kQPKAsaqcT+NQ5ciMRFOUKxk8WCzu5MCaVdtBbVcRT6kDuzHPh2BXECYkU4K3Juaxv d4yjo44KOKVlVzCD4PMZPKLHa+W4OVdxKHQpqwsgpoNlyslBO+IHHNvQIAIbE9N2M3XP YG889Lj9kgCWdkI7iNNZ+0GJVbDEJCghmqklocLAU7F3bd24xrCTLYxRkDoauce0G86D xR7rW97Jca2P075tztnTcR4NlkdofJ1QsOIpKPbTuL7m56o0UDWIPli1kLpirIayQzvp Qya/rMJTihjOz5juOx/BjVNjApk8ss7qlzTQSSHuPRpJgEDvNJFzwBS2VDuAwRs1+4Be OI7w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BcwuLlderQ1LBVmv8wRHIf7sf+opacJvUuxjf4oVs2g=; fh=2nhVWB0fZ+8YH0lLFpnF/Mo8eq+n1VMLe+b+IpvS0g0=; b=ROeHZAb0/Bc4fJvjcBt7iouc7P8+xEJUMe4QCgF41i3qenz9I3R6mrWu/um7pWyhfr 3NBYSVWjfUYxBg1KtO2IOD4QG4lXKjyZF1wcHYNIxzR5YsMAqpTNHGq4/1zYR4mtLAuH Z3OWLxSDcU/3Kxzm6uH3ZksXXIc0cfV2/idaCW6wr/72A52/Jz/7Gx7rL2kPMPgppRfL 7oD+5T+ac2kOnsTplsdedZmNkTXPFLtLTzeEKOctBA34Hi/GVf8icHn7Vsz02hf2pa1v wxPeWnSqJSnLGO6E2UjlF6PZALSgQZvXKwTeYNLlP28dr272lbKKM3UpmnKAzYm6vU3u DRmQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i3-20020a17090a64c300b0027198088485si1830121pjm.45.2023.09.13.09.53.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 09:53:09 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 07244848315F; Wed, 13 Sep 2023 09:40:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230400AbjIMQkA (ORCPT + 99 others); Wed, 13 Sep 2023 12:40:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230523AbjIMQjj (ORCPT ); Wed, 13 Sep 2023 12:39:39 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3A0671FF5; Wed, 13 Sep 2023 09:39:17 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3A730FEC; Wed, 13 Sep 2023 09:39:54 -0700 (PDT) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3F94B3F5A1; Wed, 13 Sep 2023 09:39:15 -0700 (PDT) From: James Morse 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, Salil Mehta , Russell King , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com Subject: [RFC PATCH v2 12/35] ACPI: Use the acpi_device_is_present() helper in more places Date: Wed, 13 Sep 2023 16:38:00 +0000 Message-Id: <20230913163823.7880-13-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913163823.7880-1-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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]); Wed, 13 Sep 2023 09:40:03 -0700 (PDT) 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 --- 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.39.2