Skip to content

Commit 43855ac

Browse files
vireshkrafaeljw
authored andcommitted
cpufreq: s3c64xx: Fix compilation warning
The driver generates following warning when regulator support isn't enabled in the kernel. Fix it. drivers/cpufreq/s3c64xx-cpufreq.c: In function 's3c64xx_cpufreq_set_target': >> drivers/cpufreq/s3c64xx-cpufreq.c:55:22: warning: variable 'old_freq' set but not used [-Wunused-but-set-variable] 55 | unsigned int old_freq, new_freq; | ^~~~~~~~ >> drivers/cpufreq/s3c64xx-cpufreq.c:54:30: warning: variable 'dvfs' set but not used [-Wunused-but-set-variable] 54 | struct s3c64xx_dvfs *dvfs; | ^~~~ Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Cc: 5.4+ <[email protected]> # v5.4+ Signed-off-by: Viresh Kumar <[email protected]> Link: https://patch.msgid.link/236b227e929e5adc04d1e9e7af6845a46c8e9432.1737525916.git.viresh.kumar@linaro.org Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f4b9d3b commit 43855ac

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/cpufreq/s3c64xx-cpufreq.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ struct s3c64xx_dvfs {
2424
unsigned int vddarm_max;
2525
};
2626

27+
#ifdef CONFIG_REGULATOR
2728
static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = {
2829
[0] = { 1000000, 1150000 },
2930
[1] = { 1050000, 1150000 },
3031
[2] = { 1100000, 1150000 },
3132
[3] = { 1200000, 1350000 },
3233
[4] = { 1300000, 1350000 },
3334
};
35+
#endif
3436

3537
static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
3638
{ 0, 0, 66000 },
@@ -51,15 +53,16 @@ static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
5153
static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
5254
unsigned int index)
5355
{
54-
struct s3c64xx_dvfs *dvfs;
55-
unsigned int old_freq, new_freq;
56+
unsigned int new_freq = s3c64xx_freq_table[index].frequency;
5657
int ret;
5758

59+
#ifdef CONFIG_REGULATOR
60+
struct s3c64xx_dvfs *dvfs;
61+
unsigned int old_freq;
62+
5863
old_freq = clk_get_rate(policy->clk) / 1000;
59-
new_freq = s3c64xx_freq_table[index].frequency;
6064
dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[index].driver_data];
6165

62-
#ifdef CONFIG_REGULATOR
6366
if (vddarm && new_freq > old_freq) {
6467
ret = regulator_set_voltage(vddarm,
6568
dvfs->vddarm_min,

0 commit comments

Comments
 (0)