Skip to contentSkip to conversation

cpufreq: exynos: Remove unused variable & IS_ERR

PATCH Superseded Jonghwan Choi 2 participants 2 messages Dec 7, 2012 – Dec 10, 2012

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

PATCH 1/5 cpufreq: exynos: Remove unused variable & IS_ERR

The variable 'max_support_idx, min_support_idx, pm_lock_idx" are never used, so remove the unused variable.

---
 arch/arm/mach-exynos/include/mach/cpufreq.h |    3 ---
 drivers/cpufreq/exynos-cpufreq.c            |    3 +--
 drivers/cpufreq/exynos4210-cpufreq.c        |   15 +++------------
 drivers/cpufreq/exynos4x12-cpufreq.c        |    8 --------
 drivers/cpufreq/exynos5250-cpufreq.c        |    8 --------
 5 files changed, 4 insertions(+), 33 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-exynos/include/mach/cpufreq.h
index 7517c3f..39f0dc6 100644

arch/arm/mach-exynos/include/mach/cpufreq.h +0 -3
@@ -21,9 +21,6 @@ enum cpufreq_level_index {
 struct exynos_dvfs_info {
        unsigned long   mpll_freq_khz;
        unsigned int    pll_safe_idx;
-       unsigned int    pm_lock_idx;
-       unsigned int    max_support_idx;
-       unsigned int    min_support_idx;
        struct clk      *cpu_clk;
        unsigned int    *volt_table;
        struct cpufreq_frequency_table  *freq_table;
(quoted diff) +0 -0

b/drivers/cpufreq/exynos-cpufreq.c
index af2d81e..5888aee 100644

drivers/cpufreq/exynos-cpufreq.c +1 -2
@@ -296,8 +296,7 @@ static int __init exynos_cpufreq_init(void)
 err_cpufreq:
        unregister_pm_notifier(&exynos_cpufreq_nb);
 
-       if (!IS_ERR(arm_regulator))
-               regulator_put(arm_regulator);
+       regulator_put(arm_regulator);
 err_vdd_arm:
        kfree(exynos_info);
        pr_debug("%s: failed initialization\n", __func__);
(quoted diff) +0 -0

b/drivers/cpufreq/exynos4210-cpufreq.c
index fb148fa..5ae5c52 100644

drivers/cpufreq/exynos4210-cpufreq.c +0 -3
@@ -22,9 +22,6 @@
 
 #define CPUFREQ_LEVEL_END      L5
 
-static int max_support_idx = L0;
-static int min_support_idx = (CPUFREQ_LEVEL_END - 1);
-
 static struct clk *cpu_clk;
 static struct clk *moutcore;
 static struct clk *mout_mpll;
@@ -276,10 +273,7 @@ int exynos4210_cpufreq_init(struct exynos_dvfs_info

*info)

        }

        info->mpll_freq_khz = rate;
-       info->pm_lock_idx = L2;
        info->pll_safe_idx = L2;
-       info->max_support_idx = max_support_idx;
-       info->min_support_idx = min_support_idx;
        info->cpu_clk = cpu_clk;
        info->volt_table = exynos4210_volt_table;
        info->freq_table = exynos4210_freq_table;
@@ -289,14 +283,11 @@ int exynos4210_cpufreq_init(struct exynos_dvfs_info
*info)
        return 0;

err_mout_apll:
- if (!IS_ERR(mout_mpll))
- clk_put(mout_mpll);
+ clk_put(mout_mpll);
"0001-cpufreq-exynos-Remove-unused-variable-IS_ERR.patch" 160L, 5092C
1,1 Top
- clk_put(mout_mpll);
+ clk_put(mout_mpll);
err_mout_mpll:
- if (!IS_ERR(moutcore))
- clk_put(moutcore);
+ clk_put(moutcore);
err_moutcore:
- if (!IS_ERR(cpu_clk))
- clk_put(cpu_clk);
+ clk_put(cpu_clk);

        pr_debug("%s: failed initialization\n", __func__);
        return -EINVAL;
(quoted diff) +0 -0

b/drivers/cpufreq/exynos4x12-cpufreq.c
index 8c5a7af..29b41ab 100644

drivers/cpufreq/exynos4x12-cpufreq.c +0 -5
@@ -22,9 +22,6 @@
 
 #define CPUFREQ_LEVEL_END      (L13 + 1)
 
-static int max_support_idx;
-static int min_support_idx = (CPUFREQ_LEVEL_END - 1);
-
 static struct clk *cpu_clk;
 static struct clk *moutcore;
 static struct clk *mout_mpll;
@@ -420,8 +417,6 @@ static void __init set_volt_table(void)
 {
        unsigned int i;
 
-       max_support_idx = L1;
-
        /* Not supported */
        exynos4x12_freq_table[L0].frequency = CPUFREQ_ENTRY_INVALID;
 
@@ -511,10 +506,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info

*info)

        }

        info->mpll_freq_khz = rate;
-       info->pm_lock_idx = L5;
        info->pll_safe_idx = L7;
-       info->max_support_idx = max_support_idx;
-       info->min_support_idx = min_support_idx;
        info->cpu_clk = cpu_clk;
        info->volt_table = exynos4x12_volt_table;
        info->freq_table = exynos4x12_freq_table;
(quoted diff) +0 -0

b/drivers/cpufreq/exynos5250-cpufreq.c
index e64c253..8a5d733 100644

drivers/cpufreq/exynos5250-cpufreq.c +0 -4
@@ -23,8 +23,6 @@
 
 #define CPUFREQ_LEVEL_END      (L15 + 1)
 
-static int max_support_idx;
-static int min_support_idx = (CPUFREQ_LEVEL_END - 1);
 static struct clk *cpu_clk;
 static struct clk *moutcore;
 static struct clk *mout_mpll;
@@ -249,8 +247,6 @@ static void __init set_volt_table(void)
 {
        unsigned int i;
 
-       max_support_idx = L0;
-
        for (i = 0 ; i < CPUFREQ_LEVEL_END ; i++)
                exynos5250_volt_table[i] = asv_voltage_5250[i];
 }
@@ -313,12 +309,8 @@ int exynos5250_cpufreq_init(struct exynos_dvfs_info

*info)

        }

        info->mpll_freq_khz = rate;
-       /* 1000Mhz */
-       info->pm_lock_idx = L7;
        /* 800Mhz */
        info->pll_safe_idx = L9;

76,1 90%

        /* 800Mhz */
        info->pll_safe_idx = L9;
-       info->max_support_idx = max_support_idx;
-       info->min_support_idx = min_support_idx;
        info->cpu_clk = cpu_clk;
        info->volt_table = exynos5250_volt_table;
        info->freq_table = exynos5250_freq_table;

--
1.7.4.1

#1 lore raw
Quoted 19 lines · Jonghwan Choi

The variable 'max_support_idx, min_support_idx, pm_lock_idx" are never used, so remove the unused variable.

---
 arch/arm/mach-exynos/include/mach/cpufreq.h |    3 ---
 drivers/cpufreq/exynos-cpufreq.c            |    3 +--
 drivers/cpufreq/exynos4210-cpufreq.c        |   15 +++------------
 drivers/cpufreq/exynos4x12-cpufreq.c        |    8 --------
 drivers/cpufreq/exynos5250-cpufreq.c        |    8 --------
 5 files changed, 4 insertions(+), 33 deletions(-)
arch/arm/mach-exynos/include/mach/cpufreq.h +0 -0
index 7517c3f..39f0dc6 100644

arch/arm/mach-exynos/include/mach/cpufreq.h enum cpufreq_level_index { · line 22

Quoted 2 lines
arch/arm/mach-exynos/include/mach/cpufreq.h +0 -0
@@ -21,9 +21,6 @@ enum cpufreq_level_index {
 struct exynos_dvfs_info {
        unsigned long   mpll_freq_khz;

^^^^^^^^ ???

Should be tab.

arch/arm/mach-exynos/include/mach/cpufreq.h enum cpufreq_level_index { · line 23

Quoted 1 line
arch/arm/mach-exynos/include/mach/cpufreq.h +0 -0
        unsigned int    pll_safe_idx;

^^^^^^^^ ???

Same.

arch/arm/mach-exynos/include/mach/cpufreq.h enum cpufreq_level_index { · line 24

Quoted 1 line
arch/arm/mach-exynos/include/mach/cpufreq.h +0 -1
-       unsigned int    pm_lock_idx;

Same.

arch/arm/mach-exynos/include/mach/cpufreq.h enum cpufreq_level_index { · line 25

Quoted 1 line
arch/arm/mach-exynos/include/mach/cpufreq.h +0 -1
-       unsigned int    max_support_idx;

Same.

arch/arm/mach-exynos/include/mach/cpufreq.h enum cpufreq_level_index { · line 26

Quoted 1 line
arch/arm/mach-exynos/include/mach/cpufreq.h +0 -1
-       unsigned int    min_support_idx;

Same.

Hmm...many white spaces are used at places that tab should be used...it seems that e-mail client had some problems when you're sending...

Note, you can see following with checkpatch.

WARNING: please, no spaces at the start of a line

[...]

Quoted 10 lines
arch/arm/mach-exynos/include/mach/cpufreq.h +1 -2
@@ -289,14 +283,11 @@ int exynos4210_cpufreq_init(struct exynos_dvfs_info
 *info)
        return 0;
 
 err_mout_apll:
-       if (!IS_ERR(mout_mpll))
-               clk_put(mout_mpll);
+       clk_put(mout_mpll);

"0001-cpufreq-exynos-Remove-unused-variable-IS_ERR.patch" 160L, 5092C
1,1 Top

What's this?

arch/arm/mach-exynos/include/mach/cpufreq.h

Quoted 13 lines
arch/arm/mach-exynos/include/mach/cpufreq.h +3 -5
-               clk_put(mout_mpll);
+       clk_put(mout_mpll);
 err_mout_mpll:
-       if (!IS_ERR(moutcore))
-               clk_put(moutcore);
+       clk_put(moutcore);
 err_moutcore:
-       if (!IS_ERR(cpu_clk))
-               clk_put(cpu_clk);
+       clk_put(cpu_clk);
 
        pr_debug("%s: failed initialization\n", __func__);
        return -EINVAL;

[...]

Basically, this whole series' contents look good to me, but need to re-send :-)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.