aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBhumika Goyal <bhumirks@gmail.com>2017-10-19 06:59:14 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-11-08 17:22:19 -0500
commitcd6ce860eb1920568361cf270fe4f89674cf411b (patch)
tree6f4808e545060ad762803204b7e1cc96733f0fda
parentd9278077385fd9207c00104fe6797283a099b061 (diff)
cpufreq: arm_big_little: make function arguments and structure pointer const
Make the arguments of functions bL_cpufreq_{register/unregister} as const as the ops pointer does not modify the fields of the cpufreq_arm_bL_ops structure it points to. The pointer arm_bL_ops is also getting initialized with ops but the pointer does not modify the fields. So, make the function argument and the structure pointer const. Add const to function prototypes too. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/arm_big_little.c6
-rw-r--r--drivers/cpufreq/arm_big_little.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 0c41ab3b16eb..65ec5f01aa8d 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -57,7 +57,7 @@ static bool bL_switching_enabled;
57#define VIRT_FREQ(cluster, freq) ((cluster == A7_CLUSTER) ? freq >> 1 : freq) 57#define VIRT_FREQ(cluster, freq) ((cluster == A7_CLUSTER) ? freq >> 1 : freq)
58 58
59static struct thermal_cooling_device *cdev[MAX_CLUSTERS]; 59static struct thermal_cooling_device *cdev[MAX_CLUSTERS];
60static struct cpufreq_arm_bL_ops *arm_bL_ops; 60static const struct cpufreq_arm_bL_ops *arm_bL_ops;
61static struct clk *clk[MAX_CLUSTERS]; 61static struct clk *clk[MAX_CLUSTERS];
62static struct cpufreq_frequency_table *freq_table[MAX_CLUSTERS + 1]; 62static struct cpufreq_frequency_table *freq_table[MAX_CLUSTERS + 1];
63static atomic_t cluster_usage[MAX_CLUSTERS + 1]; 63static atomic_t cluster_usage[MAX_CLUSTERS + 1];
@@ -617,7 +617,7 @@ static int __bLs_register_notifier(void) { return 0; }
617static int __bLs_unregister_notifier(void) { return 0; } 617static int __bLs_unregister_notifier(void) { return 0; }
618#endif 618#endif
619 619
620int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops) 620int bL_cpufreq_register(const struct cpufreq_arm_bL_ops *ops)
621{ 621{
622 int ret, i; 622 int ret, i;
623 623
@@ -661,7 +661,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
661} 661}
662EXPORT_SYMBOL_GPL(bL_cpufreq_register); 662EXPORT_SYMBOL_GPL(bL_cpufreq_register);
663 663
664void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops) 664void bL_cpufreq_unregister(const struct cpufreq_arm_bL_ops *ops)
665{ 665{
666 if (arm_bL_ops != ops) { 666 if (arm_bL_ops != ops) {
667 pr_err("%s: Registered with: %s, can't unregister, exiting\n", 667 pr_err("%s: Registered with: %s, can't unregister, exiting\n",
diff --git a/drivers/cpufreq/arm_big_little.h b/drivers/cpufreq/arm_big_little.h
index 184d7c3a112a..88a176e466c8 100644
--- a/drivers/cpufreq/arm_big_little.h
+++ b/drivers/cpufreq/arm_big_little.h
@@ -37,7 +37,7 @@ struct cpufreq_arm_bL_ops {
37 void (*free_opp_table)(const struct cpumask *cpumask); 37 void (*free_opp_table)(const struct cpumask *cpumask);
38}; 38};
39 39
40int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops); 40int bL_cpufreq_register(const struct cpufreq_arm_bL_ops *ops);
41void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops); 41void bL_cpufreq_unregister(const struct cpufreq_arm_bL_ops *ops);
42 42
43#endif /* CPUFREQ_ARM_BIG_LITTLE_H */ 43#endif /* CPUFREQ_ARM_BIG_LITTLE_H */