Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4446809pxf; Tue, 16 Mar 2021 13:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3e+ldnuZ9+CDAcu/4Y4vNySmNXoeDCBRA50iqeoH9rvAxeb43Ac/xqQgQV0hRYERQHegl X-Received: by 2002:a17:906:1e4f:: with SMTP id i15mr31189015ejj.349.1615927672634; Tue, 16 Mar 2021 13:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615927672; cv=none; d=google.com; s=arc-20160816; b=g2RC/2EN9j+m7uyrGF9JAcnhyfykayePv58jyrTBITSy+KIWISFlUcxKILknGCzEE/ KufZac+Q5l38JMfv44wRHYDTOkv1F04Ll+KX2bU3JcLTK313h1IVbSVZbphGe5n+calY eOgt7jWmuOE09c7t9K5lIe6U6GN7RBM6PkzWtkX5ZRm50BvzMBCK9gk6IY1gP8iDNa90 lBVVfEV2uQ1mzT9DWAwsI4PdxHhp7i+q3Z+rNQMhzE0DRBZJ5pJ6hhrpPXXImVXXyO5l CtFq+E/+prNhrEzIbrKldiTC69ohXpeWjqzyIa5PtD06i3GDxgUczSA2N4PzCBjpsx3z Hp+Q== 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 :message-id:date:subject:cc:to:from; bh=qyiEQeSMSNCBDe897osuFHVPQlfVgeY2GIb/AKGwQko=; b=Qg3WhRRiPDZL/F0UZM7ZTMPWZbo+e32yqQZFLGWmhW0bViUpF3dV4csIQshiM8bLLl j1HGJltbXPeRmQfTcc8DibsxnPJph0OMReFXNACkeRhsgCC+UB2M+cjRPt+ZDtZzb/uE FDXYVErt6aJ1lvNIG/jUA0eGf6/l2Qf4Z62OW6zrSNT8ecX08S9iE2pYrozRCUiz4c5/ 4kzMWT+5/UBfnyq519nqkwfWrFgz8mx4+x3RvPnyjFk7wCM025697533eBcrRp3wXrPb FLRT/uzOPX7lXNvi73ScedrwK/O2R+S3T0vnc89jhe+gGezUp695cN7Kyh23eMS20BFy GcDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si9231312ejy.63.2021.03.16.13.47.28; Tue, 16 Mar 2021 13:47:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238182AbhCPPyZ (ORCPT + 99 others); Tue, 16 Mar 2021 11:54:25 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:46946 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238225AbhCPPyG (ORCPT ); Tue, 16 Mar 2021 11:54:06 -0400 Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 2.0.3) id e5d6e2e5c90b9b90; Tue, 16 Mar 2021 16:54:04 +0100 Received: from kreacher.localnet (89-64-82-37.dynamic.chello.pl [89.64.82.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 9861F668CF6; Tue, 16 Mar 2021 16:54:03 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Srinivas Pandruvada , Chen Yu , Viresh Kumar , Ionela Voinescu Subject: [PATCH] ACPI: CPPC: Add emtpy stubs of functions for CONFIG_ACPI_CPPC_LIB unset Date: Tue, 16 Mar 2021 16:54:03 +0100 Message-ID: <538668936.KFQZekuijD@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrudefvddgkeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkggfgtgesthfuredttddtvdenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeevudefgfeguedtjedvhfetveegleduveeuvedvjeekleefhfduhfefheekffefveenucfkphepkeelrdeigedrkedvrdefjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeekledrieegrdekvddrfeejpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopeihuhdrtgdr tghhvghnsehinhhtvghlrdgtohhmpdhrtghpthhtohepvhhirhgvshhhrdhkuhhmrghrsehlihhnrghrohdrohhrghdprhgtphhtthhopehiohhnvghlrgdrvhhoihhnvghstghusegrrhhmrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki For convenience, add empty stubs of library functions defined in cppc_acpi.c for the CONFIG_ACPI_CPPC_LIB unset case. Because one of them needs to return CPUFREQ_ETERNAL, include linux/cpufreq.h into the CPPC library header file and drop the direct inclusion of it from cppc_acpi.c. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/cppc_acpi.c | 1 - include/acpi/cppc_acpi.h | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) Index: linux-pm/include/acpi/cppc_acpi.h =================================================================== --- linux-pm.orig/include/acpi/cppc_acpi.h +++ linux-pm/include/acpi/cppc_acpi.h @@ -11,6 +11,7 @@ #define _CPPC_ACPI_H #include +#include #include #include @@ -132,6 +133,7 @@ struct cppc_cpudata { cpumask_var_t shared_cpu_map; }; +#ifdef CONFIG_ACPI_CPPC_LIB extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf); extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs); extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls); @@ -142,5 +144,43 @@ extern unsigned int cppc_get_transition_ extern bool cpc_ffh_supported(void); extern int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val); extern int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val); +#else /* !CONFIG_ACPI_CPPC_LIB */ +static inline int cppc_get_desired_perf(int cpunum, u64 *desired_perf) +{ + return -ENOTSUPP; +} +static inline int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs) +{ + return -ENOTSUPP; +} +static inline int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls) +{ + return -ENOTSUPP; +} +static inline int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps) +{ + return -ENOTSUPP; +} +static inline bool acpi_cpc_valid(void) +{ + return false; +} +static inline unsigned int cppc_get_transition_latency(int cpu) +{ + return CPUFREQ_ETERNAL; +} +static inline bool cpc_ffh_supported(void) +{ + return false; +} +static inline int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val) +{ + return -ENOTSUPP; +} +static inline int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val) +{ + return -ENOTSUPP; +} +#endif /* !CONFIG_ACPI_CPPC_LIB */ #endif /* _CPPC_ACPI_H*/ Index: linux-pm/drivers/acpi/cppc_acpi.c =================================================================== --- linux-pm.orig/drivers/acpi/cppc_acpi.c +++ linux-pm/drivers/acpi/cppc_acpi.c @@ -33,7 +33,6 @@ #define pr_fmt(fmt) "ACPI CPPC: " fmt -#include #include #include #include