Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3526589rwb; Tue, 16 Aug 2022 04:49:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR4TLiJLXUg2P1s3+pA0/5WZ8SiVPAu9Z57Kpn603YgpUkpda+fsM/QoqPVTsBbb/6XuF1DY X-Received: by 2002:a05:6a00:b44:b0:52e:d959:c05b with SMTP id p4-20020a056a000b4400b0052ed959c05bmr20224930pfo.22.1660650586990; Tue, 16 Aug 2022 04:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660650586; cv=none; d=google.com; s=arc-20160816; b=C88s+HJ1E68yrBjDp6PZODwKP57kJ3YpjDGfGV2MZa1bm8Jk76HKAB3UZigZjEfjOV U1K9ko4UqHRO0ppPHbjNTZ0ZtVQv/9WUgKkhguJzbSqcvjSqmudeNni/lQV8PyMQ6e+C M0lgifcvqGaCxF6vi2iu52HwM/Xi5RvpeTWokOERmmvPDCHTzJwNlx7dxaVHjFwJZFP1 7cGXp1+f9jEfW3pbOkFkB0H5kEXlT5LB5Uo0qvxgXInGrGJSMf4c8DDeIraz2XKr3SX/ 0jgep3YIP0Hfqu4KBY989+4Htfzk5qHJ6yVdr7+iX/Y6iWVAe89pI9iqZKWLBZasDZTY vHNQ== 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 :dkim-signature; bh=zNgdwEjH+UYj5saAIUf65mwKeLJhQhcejGmGhCyYLLw=; b=B+GJ1Om8NMt1OueVUrrz4mhqgz7BScTbqWQJau9wEyI825mewX8s1q7CDDJynKES+W yFFGVn6tnZutG+JwJxrikKHwuFUulZa/UPTz9SkZgS/QWrQZu/oF0Q/ffx6w218m5jNt mFusCnq4eu34Lb1puyVnlkKA/QQQYaL/BBsWWW38RFTJo3POay0CqPBw8qGE5jQPd1h9 kBQvhsQjs6zdEpyqreaYIsFje5CakvVPsIxvPdu2G4DYToIOxW6CcRBJgC4FDYTfCyDh 4T3hrV7A9wnykLmT87P3VUm/dqEpSz/sB2FjQsFZE4+lws/C/k9k+vZoGonY/T4dpNQd 09/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WzO1vPJi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh4-20020a17090b4ac400b001f3a43f2460si13739647pjb.166.2022.08.16.04.49.34; Tue, 16 Aug 2022 04:49:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WzO1vPJi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235094AbiHPLEX (ORCPT + 99 others); Tue, 16 Aug 2022 07:04:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233171AbiHPLD5 (ORCPT ); Tue, 16 Aug 2022 07:03:57 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B35F996E; Tue, 16 Aug 2022 03:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660644986; x=1692180986; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nJljPCZZ6aUR0hItDYXXREgJNCgutz8/X/G4rnfyXUs=; b=WzO1vPJikVc74zTxKwcWq0LUW8LuKjm4bxjnw3Yb5LIpfBx+fZa6sNby liWneasXsbSQwWoT3+oXm0vbZfFnzPZeUiljJ/0SZQeaM5jM2MQz37Fm0 jZGvc0xIZC8FADUgYIn+KemuyM3PI3m1H2Y+lDWxSJVHSXxsBZsM6wLEm EvZ6LeolSOEn//eJg7fcMvYw6jJj6Ad4Jcr/U7oJsjAWcyhQfybsB3ySq rqNj5UiGe2LEUmnkgfZrW4XfrOV+SOUEX2BNffBapmTwTZ9sAyVI54OSY 0WYlQOGwmK+cJINKiBglbDBmeybjoMicaq18JiJwYc5sywu2m0++W7Mmp w==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="279141266" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="279141266" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 03:16:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="749260762" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 16 Aug 2022 03:16:21 -0700 From: Heikki Krogerus To: "Rafael J. Wysocki" , Greg Kroah-Hartman Cc: Utkarsh Patel , rajmohan.mani@intel.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 2/6] ACPI: resource: Filter out the non memory resources in is_memory() Date: Tue, 16 Aug 2022 13:16:25 +0300 Message-Id: <20220816101629.69054-3-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220816101629.69054-1-heikki.krogerus@linux.intel.com> References: <20220816101629.69054-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 This will generalise the function so it should become useful in more places. Signed-off-by: Heikki Krogerus --- drivers/acpi/resource.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 510cdec375c4d..e644e90d18847 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -690,6 +690,9 @@ static int is_memory(struct acpi_resource *ares, void *not_used) memset(&win, 0, sizeof(win)); + if (acpi_dev_filter_resource_type(ares, IORESOURCE_MEM)) + return 1; + return !(acpi_dev_resource_memory(ares, res) || acpi_dev_resource_address_space(ares, &win) || acpi_dev_resource_ext_address_space(ares, &win)); -- 2.35.1