Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bhumika Goyal and committed by
Rafael J. Wysocki
cd6ce860 d9278077

+5 -5
+3 -3
drivers/cpufreq/arm_big_little.c
··· 57 57 #define VIRT_FREQ(cluster, freq) ((cluster == A7_CLUSTER) ? freq >> 1 : freq) 58 58 59 59 static struct thermal_cooling_device *cdev[MAX_CLUSTERS]; 60 - static struct cpufreq_arm_bL_ops *arm_bL_ops; 60 + static const struct cpufreq_arm_bL_ops *arm_bL_ops; 61 61 static struct clk *clk[MAX_CLUSTERS]; 62 62 static struct cpufreq_frequency_table *freq_table[MAX_CLUSTERS + 1]; 63 63 static atomic_t cluster_usage[MAX_CLUSTERS + 1]; ··· 617 617 static int __bLs_unregister_notifier(void) { return 0; } 618 618 #endif 619 619 620 - int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops) 620 + int bL_cpufreq_register(const struct cpufreq_arm_bL_ops *ops) 621 621 { 622 622 int ret, i; 623 623 ··· 661 661 } 662 662 EXPORT_SYMBOL_GPL(bL_cpufreq_register); 663 663 664 - void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops) 664 + void bL_cpufreq_unregister(const struct cpufreq_arm_bL_ops *ops) 665 665 { 666 666 if (arm_bL_ops != ops) { 667 667 pr_err("%s: Registered with: %s, can't unregister, exiting\n",
+2 -2
drivers/cpufreq/arm_big_little.h
··· 37 37 void (*free_opp_table)(const struct cpumask *cpumask); 38 38 }; 39 39 40 - int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops); 41 - void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops); 40 + int bL_cpufreq_register(const struct cpufreq_arm_bL_ops *ops); 41 + void bL_cpufreq_unregister(const struct cpufreq_arm_bL_ops *ops); 42 42 43 43 #endif /* CPUFREQ_ARM_BIG_LITTLE_H */