Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp303026yba; Wed, 15 May 2019 01:25:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTZAxz2lO9iWD6NM83Ecl+iDPrYi2COa+agyp6Jy6eph51lXn2kSMrzOj5/ERCePps76jM X-Received: by 2002:a17:902:aa97:: with SMTP id d23mr42669125plr.313.1557908748808; Wed, 15 May 2019 01:25:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557908748; cv=none; d=google.com; s=arc-20160816; b=TqfMvPrat2wCOA1ijXF/e+rz8l5/q3CfSYykG3avJ9auYMApDFxK/Os+vf9RqDBSBv jGhwcPtpN4QFr6MdCmXwTb6TNqM1Wy+T6llcngFcf+0lXvNHPPZhrbGoCcCKABG11tv5 rrmyButRO6XwWWwgzS0XRYmXKuDwwX+QZ6dH+mZROR1+mljlcVeiUoFLeQoLBUOWK89c QYI4j7gD0MwmDRBIcIxo/gbBsNUlr9LditgenHmkJBjm1bDbMZVdPUEVy++krJ6TH9Py bR1G95c8OH3+SkUfzQEbTPzjr5nmpNQRrFX38wR2WoQZkLJkEw0w611sYr3sVf43ZFtP mFHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VRcYuWBpoY3hvcfsHbd5RJ5yAdhlZIsffuOAQY/s2dA=; b=kMGHOdc6a4e/LXThFnduYaVNwqL1k9jKfvGyxVgiP3/Q4I+JJ3atzFsaze2UmZezIT bxEGRKIkyTlHavcTIyAkDYAID7yiu5H/nr9j0XFR4hB7UklixiLUHuSK+nME5/RyaoQO QMMAgyXmDQ51ZrjYjyKngYL4OlM/cS2QgTWIb/6yOJlxYNoFMSY1FIxD0Tsiqx4PxPZw +XyvUPKAlJjUPKC3dwUG19RO8QKbC0/RIun6Kr5wxW0S6XscVN7NeeNZyRWzdwycgWfi 0TTOeWJgs6KbEtVXuGbimjgUdRAtOTk+U15cq87SyQofvdUPyVsRVIEwoJ5ouXQnSCUO oWxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r185si1283891pgr.10.2019.05.15.01.25.33; Wed, 15 May 2019 01:25:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbfEOIXo (ORCPT + 99 others); Wed, 15 May 2019 04:23:44 -0400 Received: from foss.arm.com ([217.140.101.70]:37984 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726590AbfEOIXe (ORCPT ); Wed, 15 May 2019 04:23:34 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 39E1015AD; Wed, 15 May 2019 01:23:34 -0700 (PDT) Received: from queper01-lin.cambridge.arm.com (queper01-lin.cambridge.arm.com [10.1.195.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8702B3F703; Wed, 15 May 2019 01:23:31 -0700 (PDT) From: Quentin Perret To: edubezval@gmail.com, rui.zhang@intel.com, javi.merino@kernel.org, viresh.kumar@linaro.org, amit.kachhap@gmail.com, rjw@rjwysocki.net, will.deacon@arm.com, catalin.marinas@arm.com Cc: daniel.lezcano@linaro.org, dietmar.eggemann@arm.com, ionela.voinescu@arm.com, mka@chromium.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, quentin.perret@arm.com Subject: [PATCH v4 2/3] PM / EM: Expose perf domain struct Date: Wed, 15 May 2019 09:23:17 +0100 Message-Id: <20190515082318.7993-3-quentin.perret@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515082318.7993-1-quentin.perret@arm.com> References: <20190515082318.7993-1-quentin.perret@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the current state, the perf_domain struct is fully defined only when CONFIG_ENERGY_MODEL=y. Since we need to write code that compiles both with or without that option in the thermal framework, make sure to actually define the struct regardless of the config option. That allows to avoid using stubbed accessor functions all the time in code paths that use the EM. Acked-by: Viresh Kumar Signed-off-by: Quentin Perret --- include/linux/energy_model.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h index aa027f7bcb3e..fb32b86a467d 100644 --- a/include/linux/energy_model.h +++ b/include/linux/energy_model.h @@ -9,7 +9,6 @@ #include #include -#ifdef CONFIG_ENERGY_MODEL /** * em_cap_state - Capacity state of a performance domain * @frequency: The CPU frequency in KHz, for consistency with CPUFreq @@ -40,6 +39,7 @@ struct em_perf_domain { unsigned long cpus[0]; }; +#ifdef CONFIG_ENERGY_MODEL #define EM_CPU_MAX_POWER 0xFFFF struct em_data_callback { @@ -160,7 +160,6 @@ static inline int em_pd_nr_cap_states(struct em_perf_domain *pd) } #else -struct em_perf_domain {}; struct em_data_callback {}; #define EM_DATA_CB(_active_power_cb) { } -- 2.21.0