diff mbox series

cpufreq: s3c64xx: hide unused variable

Message ID 20250122065216.1371158-1-arnd@kernel.org (mailing list archive)
State New
Headers show
Series cpufreq: s3c64xx: hide unused variable | expand

Commit Message

Arnd Bergmann Jan. 22, 2025, 6:52 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

A previous compiler warning fix extended an #ifdef block, but that
led to another warning in some builds:

drivers/cpufreq/s3c64xx-cpufreq.c:27:28: error: 's3c64xx_dvfs_table' defined but not used [-Werror=unused-variable]
   27 | static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = {

Add yet another #ifdef check around that variable.

Fixes: 76b218721e5f ("cpufreq: s3c64xx: Fix compilation warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I wonder if the driver should instead depend on CONFIG_REGULATOR
and drop the #ifdef checks.
---
 drivers/cpufreq/s3c64xx-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Viresh Kumar Jan. 22, 2025, 6:58 a.m. UTC | #1
On 22-01-25, 07:52, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> A previous compiler warning fix extended an #ifdef block, but that
> led to another warning in some builds:
> 
> drivers/cpufreq/s3c64xx-cpufreq.c:27:28: error: 's3c64xx_dvfs_table' defined but not used [-Werror=unused-variable]
>    27 | static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = {
> 
> Add yet another #ifdef check around that variable.
> 
> Fixes: 76b218721e5f ("cpufreq: s3c64xx: Fix compilation warning")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

I too have sent a fix this morning:
236b227e929e5adc04d1e9e7af6845a46c8e9432.1737525916.git.viresh.kumar@linaro.org

> I wonder if the driver should instead depend on CONFIG_REGULATOR
> and drop the #ifdef checks.

The way CONFIG_REGULATOR is used in the driver, it seems like it can
be used without regulators too. The initial commit also confirms this.

commit b3748ddd80569ec753f62e709629b8c639143222
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Mon Jun 15 11:23:20 2009 +0100

    [ARM] S3C64XX: Initial support for DVFS

    This patch provides initial support for CPU frequency scaling on the
    Samsung S3C ARM processors. Currently only S3C6410 processors are
    supported, though addition of another data table with supported clock
    rates should be sufficient to enable support for further CPUs.

    Use the regulator framework to provide optional support for DVFS in
    the S3C cpufreq driver. When a software controllable regulator is
    configured the driver will use it to lower the supply voltage when
    running at a lower frequency, giving improved power savings.

    When regulator support is disabled or no regulator can be obtained
    for VDDARM the driver will fall back to scaling only the frequency.

    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Signed-off-by: Ben Dooks <ben-linux@fluff.org>
diff mbox series

Patch

diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c
index 8fc43a74cefb..9cef71528076 100644
--- a/drivers/cpufreq/s3c64xx-cpufreq.c
+++ b/drivers/cpufreq/s3c64xx-cpufreq.c
@@ -24,6 +24,7 @@  struct s3c64xx_dvfs {
 	unsigned int vddarm_max;
 };
 
+#ifdef CONFIG_REGULATOR
 static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = {
 	[0] = { 1000000, 1150000 },
 	[1] = { 1050000, 1150000 },
@@ -31,6 +32,7 @@  static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = {
 	[3] = { 1200000, 1350000 },
 	[4] = { 1300000, 1350000 },
 };
+#endif
 
 static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
 	{ 0, 0,  66000 },