Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp332874yba; Fri, 3 May 2019 02:45:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVP7Ogqiz90qumTW6zQ8asdcGpg+ehQzzCOwAIyMwcy/iFfOwt5NfF0ID2n8LrI7VIV8PM X-Received: by 2002:a62:5ec4:: with SMTP id s187mr5579452pfb.185.1556876757078; Fri, 03 May 2019 02:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556876757; cv=none; d=google.com; s=arc-20160816; b=oN+BZXdKRnKJTxGOWaAVqwxuLCJmTo1srubbqLq3xIqno4ABKqs4v3J3DxZlnJauU2 Jo9yl9j9AhckNoQr4NDgyWQ4bLapc6slzVat+oDpGb2rficmJMrHHAuBeBQwV6lSxNpU rVCwpUqy6vaS1PKXJ++Qo0hrhsjE7iDkG1/LPM63Te7rU02dc5M6fw+EgkeDoxGyYJwX LpHa2W6lh9saRUg5a5nVhcEIr83VniGQT3vCMqhNib0/xDXDm9loMMD7L/ZvH5IKfwqv J8wKwtAJiG2vhBIh6EV5ekAuqwXhNYrTaHeUp2djZ7sMMbWdOGeBQXkaqForXDH9vBfV pkIA== 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=1FH/Clw+gizJfO6TC3lTK77lilZ8Rl0HDR/ocW4p1no=; b=ER9KzG3xqnCJspcxsVJpyxK1LVl0sX+8rYHOIoCFoyha9lWnDjxsWXz6lkFz2eJ7mG TdhZEiSI9k4X8X83EZSeBHx16VaJ+8nSS1wjqkJmpMNfnikc84OkhOsktY1WiYjDLifU uz9NEtkfnepXB3ApDlNlE4122lhmm4AtyyCd0sThQRB4EJDU2wBgSOQRcRqp/rI7bzsC gbjph28rbdSWfD2732fCkdn7ize3cnnAHU4cV+lEkKF/veNcGfCKPsDw/uYsbNPR1pV5 50uzoof/qEkOrwGHxNkGiYWu3pBogeZx/oHKgL/r2T4USodptX6Ha0HeG5ophtk4fRfb MX7w== 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 u1si1602769pgr.347.2019.05.03.02.45.42; Fri, 03 May 2019 02:45:57 -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 S1727256AbfECJop (ORCPT + 99 others); Fri, 3 May 2019 05:44:45 -0400 Received: from foss.arm.com ([217.140.101.70]:57390 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbfECJon (ORCPT ); Fri, 3 May 2019 05:44:43 -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 2FA2415AD; Fri, 3 May 2019 02:44:43 -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 654F03F557; Fri, 3 May 2019 02:44:40 -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, quentin.perret@arm.com, mka@chromium.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/3] PM / EM: Expose perf domain struct Date: Fri, 3 May 2019 10:44:08 +0100 Message-Id: <20190503094409.3499-3-quentin.perret@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503094409.3499-1-quentin.perret@arm.com> References: <20190503094409.3499-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. 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