From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A041CD37B0 for ; Mon, 18 Sep 2023 04:08:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236993AbjIREID (ORCPT ); Mon, 18 Sep 2023 00:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232944AbjIREHc (ORCPT ); Mon, 18 Sep 2023 00:07:32 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B03B0FF for ; Sun, 17 Sep 2023 21:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695010001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RyEnCFT5C38bhUURLkGzvUajSXRR1/fSXXPcrqWJ/i0=; b=LwdVkMPnlBKCXg4FMg9VrDqBR7wr6kSj7A0SE+1eY0cXvztUB6b9f+OE8r6g8e361zID8n PBXxJQda3vx9zcUxcXCgi46i6OLdNfT1qT6YlZi8ROXipesbPD4MR+O9BgRdMk9j+mp8Cx j5fNGvB2I7lar2hUhu/kfh2fRiQ53ss= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-SB7WRoaNPRiVbhMbeMYiiw-1; Mon, 18 Sep 2023 00:06:38 -0400 X-MC-Unique: SB7WRoaNPRiVbhMbeMYiiw-1 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-1c4588f622aso8448125ad.2 for ; Sun, 17 Sep 2023 21:06:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695009997; x=1695614797; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RyEnCFT5C38bhUURLkGzvUajSXRR1/fSXXPcrqWJ/i0=; b=AvMd5e1kL3+/H1ip9lFGbPFImsz8cOfTj16eDHQLTEHbsIJonSE3ak/e0FHj8lzbIF aap2wWtItJCiozJZotFGrWGCroCMxuciX8RrtBfXBLfLI7C1jbb6+BUj6gN81QyG//Wi 3XtbA9PLH2aGdQ9zhwxuY2x1tAY8Zuyqbbf73Z5c+yRsxnFVEKslzt5u8cE6qeum+wAg +9uDOYoxDtUuOyMrQQgqbm0BIUoZVSszD49ea4SAzRoFwGMfzFcotRMsRyUC2S0+9baW Odvk4B1o3/CB/9KvLgCGNcxdJnbh9IOSZVspp7eHQgRDC9MvPfOtlJx92fhe2Z7D0w2H 03EA== X-Gm-Message-State: AOJu0YzsHYgRDCrgacePmvpVl2GcHpbhGzqcKM8Fey5akylTCzl5FYo6 5UCMdtl9BwFYPyroGiNh82MFW70lExLM3eDusTYj+devs7gELPyNPKZBhgzT6yPMBX6+16uZqxQ BQBtkKjNsMkQ1Kv4l+78= X-Received: by 2002:a17:902:ed13:b0:1c4:2639:fcac with SMTP id b19-20020a170902ed1300b001c42639fcacmr6826558pld.44.1695009997184; Sun, 17 Sep 2023 21:06:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEF065/Z94SfXDjWgy8eNRhRV8ONjtcc1kg9eJW1xxYmQI4hKUxuHGFuBMDdEioAhl0IB04WA== X-Received: by 2002:a17:902:ed13:b0:1c4:2639:fcac with SMTP id b19-20020a170902ed1300b001c42639fcacmr6826541pld.44.1695009996903; Sun, 17 Sep 2023 21:06:36 -0700 (PDT) Received: from ?IPV6:2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5? ([2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5]) by smtp.gmail.com with ESMTPSA id ju3-20020a170903428300b001bdb8c0b578sm5892366plb.192.2023.09.17.21.06.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Sep 2023 21:06:36 -0700 (PDT) Message-ID: <4e5aaed1-bf7d-18a8-0f77-8f29bb2e43bc@redhat.com> Date: Mon, 18 Sep 2023 14:06:28 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [RFC PATCH v2 12/35] ACPI: Use the acpi_device_is_present() helper in more places Content-Language: en-US To: James Morse , 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 References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-13-james.morse@arm.com> From: Gavin Shan In-Reply-To: <20230913163823.7880-13-james.morse@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On 9/14/23 02:38, James Morse wrote: > 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(-) > Reviewed-by: Gavin Shan > 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; > }