Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3856783rdb; Thu, 14 Sep 2023 05:05:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkwiKaV2gB+ZiWi/u9tY7BnJEcK60Cy7xslg3DHltImcjd38L/qKmU+d0tnaWNF3oPUmdS X-Received: by 2002:a05:6a00:1583:b0:68e:2ef2:3379 with SMTP id u3-20020a056a00158300b0068e2ef23379mr5318358pfk.15.1694693122017; Thu, 14 Sep 2023 05:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694693122; cv=none; d=google.com; s=arc-20160816; b=De2DVfMsdQPibb9wQxXrWT6NtwUbRP75zDcXAqkfKachiPjK8vW17NGgImHafXBrGZ DuILhOnCodDFt1EpBe9oebJuNTyVid69mm0wNKp3S68OS6U3NcUWYOjGkQPbo6NmOTlJ 1/VVBUptPTXkPEymeYZcHPylQ8xtPBoaIZRmHqsb3/mQvAiFG8VMwzon4wHB+6CL08/I tUJJTJeRSIQvgJynawe5I14Y2VDknQIUEr3W5rvKJlolxHfeCeXDztlrmx8P/XlrORlN aGbnUcdIN4H4LnIowO0JNOVIVJSShCUjdGCqWH1tDcDunfnebRDlUa9w1td2N2sRE6Ts GF7g== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=CungtR8CQI29bFiEKBDB1w7Ndecr91t5bfSRvxpHw6k=; fh=oO43h3w0Gnh1/uzgjBLTRg+oe1Gv6aFHPIod5z8aS5s=; b=AL5pVuaa1+SPef4+XsAsCJ/ecIMYT4nuRKBJdEUbkk2zxjLLgaztqRxaamFv0Ib6Mv bfbREDWb56VLNY3ieuHnh/yzzPTj6PUrVqDERwTOVUUs4PW+Vt0zI7IA2myOU8xmFsAx xKpYknxt5LkEhjMJm5FdM4WlMo2t/RwqWiEp+Vpr+lAh2nNRQbNZt1FL6/quIdu8Sows nyJ6ybdyyu9ZBWVfDFDEeNc8ByygyNTggeJMCRpZbwtISZaOyew+HpJ3ayqUFxgrdRSz lgwi2Q9Hbf0VgmXYGYedYTitigF7UHnIoY9YmjI3PXz+knE2tVeYFMfWCdphlerAkBNM iIFA== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id d11-20020a056a00198b00b0068fb3451deesi1497750pfl.290.2023.09.14.05.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 05:05:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 630BA83154A6; Thu, 14 Sep 2023 05:05:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238331AbjINMFF (ORCPT + 99 others); Thu, 14 Sep 2023 08:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236843AbjINMFD (ORCPT ); Thu, 14 Sep 2023 08:05:03 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45E801BF4; Thu, 14 Sep 2023 05:04:59 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Rmbb90TM0z6K6W4; Thu, 14 Sep 2023 20:04:21 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 14 Sep 2023 13:04:56 +0100 Date: Thu, 14 Sep 2023 13:04:55 +0100 From: Jonathan Cameron To: James Morse CC: , , , , , , , , , Salil Mehta , Russell King , Jean-Philippe Brucker , , Subject: Re: [RFC PATCH v2 12/35] ACPI: Use the acpi_device_is_present() helper in more places Message-ID: <20230914130455.00004434@Huawei.com> In-Reply-To: <20230913163823.7880-13-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-13-james.morse@arm.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected 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 (groat.vger.email [0.0.0.0]); Thu, 14 Sep 2023 05:05:11 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On Wed, 13 Sep 2023 16:38:00 +0000 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 Reviewed-by: Jonathan Cameron Pull this one out and send it upstream in advance of the rest. Jonathan > --- > 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; > }