cpufreq: platform: sprd: Remove build warnings 47/159447/3
authorWook Song <wook16.song@samsung.com>
Thu, 9 Nov 2017 03:14:47 +0000 (12:14 +0900)
committerWook Song <wook16.song@samsung.com>
Thu, 9 Nov 2017 05:07:43 +0000 (14:07 +0900)
This patch removes build warnings caused by unused variables/functions,
making pointer from integer without cast, and unexpected type of a
function argument.

Change-Id: I33486abad8bd8760b1cffc96a06bc0baa20fafb6
Signed-off-by: Wook Song <wook16.song@samsung.com>
drivers/platform/sprd/cpufreq-scx35.c

index 7983dc4..b1e3ac8 100644 (file)
@@ -235,7 +235,8 @@ static struct cpufreq_table_data sc8830t_cpufreq_table_data_es = {
         },
 };
 
-static struct cpufreq_table_data sc8830t_cpufreq_table_data_es_1300 = {
+static __maybe_unused
+struct cpufreq_table_data sc8830t_cpufreq_table_data_es_1300 = {
         .freq_tbl = {
                 {0, 1300000},
                 {1, 1200000},
@@ -359,7 +360,7 @@ static unsigned int sprd_raw_get_cpufreq(void)
 }
 
 unsigned int last_freq = 0;
-static void dump_axi_cpu(unsigned int freq)
+static __maybe_unused void dump_axi_cpu(unsigned int freq)
 {
        u32 div, axi_freq;
 
@@ -650,8 +651,6 @@ static int sprd_cpufreq_target(struct cpufreq_policy *policy,
        struct cpufreq_frequency_table *table;
        int max_freq = cpufreq_max_limit;
        int min_freq = cpufreq_min_limit;
-       int cur_freq = 0;
-       unsigned long irq_flags;
 
        /* delay 30s to enable dvfs&dynamic-hotplug,
          * except requirment from termal-cooling device
@@ -666,7 +665,7 @@ static int sprd_cpufreq_target(struct cpufreq_policy *policy,
                return -EINVAL;
        }
 
-       target_freq = max(1000000, target_freq);
+       target_freq = max(1000000U, target_freq);
        target_freq = max((unsigned int)pm_qos_request(PM_QOS_CPU_FREQ_MIN), target_freq);
        target_freq = min((unsigned int)pm_qos_request(PM_QOS_CPU_FREQ_MAX), target_freq);
 
@@ -768,7 +767,8 @@ static int sprd_freq_table_init(void)
                  sprd_cpufreq_conf->vddarm_mv =
                                        sc9631l64_cpufreq_table_data_es.vddarm_mv;
 #else
-       } else if (__raw_readl(AON_APB_CHIP_ID) == 0x96310000) {
+       } else if (__raw_readl((void __iomem __force *)AON_APB_CHIP_ID)
+                       == 0x96310000) {
                sprd_cpufreq_conf->freq_tbl =
                        sc9631l64_cpufreq_table_data_es.freq_tbl;
                sprd_cpufreq_conf->vddarm_mv =
@@ -954,7 +954,6 @@ static ssize_t dvfs_score_store(struct device *dev, struct device_attribute *att
 {
        int ret;
        int value;
-       unsigned long irq_flags;
 
        ret = strict_strtoul(buf,16,(long unsigned int *)&value);
 
@@ -997,7 +996,6 @@ static ssize_t dvfs_unplug_store(struct device *dev, struct device_attribute *at
 {
        int ret;
        int value;
-       unsigned long irq_flags;
 
        ret = strict_strtoul(buf,16,(long unsigned int *)&value);
 
@@ -1032,7 +1030,6 @@ static ssize_t dvfs_plug_store(struct device *dev, struct device_attribute *attr
 {
        int ret;
        int value;
-       unsigned long irq_flags;
 
        ret = strict_strtoul(buf,16,(long unsigned int *)&value);
 
@@ -1063,7 +1060,6 @@ static ssize_t dvfs_prop_store(struct device *dev, struct device_attribute *attr
 {
        int ret;
        int value;
-       unsigned long irq_flags;
 
        printk(KERN_ERR"dvfs_status %s\n",buf);
        ret = strict_strtoul(buf,16,(long unsigned int *)&value);
@@ -1146,7 +1142,7 @@ static struct attribute *g[] = {
        NULL,
 };
 
-static struct attribute_group attr_group = {
+static __maybe_unused struct attribute_group attr_group = {
        .attrs = g,
 };