Skip to contentSkip to conversation

cpufreq: s3c64xx: hide unused variable

PATCH In review Arnd Bergmann 2 participants 2 messages Jan 22, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: s3c64xx: hide unused variable

From: Arnd Bergmann <[email protected]>

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")

---
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(+)
drivers/cpufreq/s3c64xx-cpufreq.c +2 -0
index 8fc43a74cefb..9cef71528076 100644
@@ -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 },
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

Quoted 8 lines

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")

---

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

Quoted 2 lines

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 <[email protected]>
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.

Signature · 1 line
viresh