arm64: topology: Get rid of "cap_parsing_done"
PATCH 1/1 arm64: topology: Get rid of "cap_parsing_done"
We can reuse "cap_parsing_failed" instead of keeping an additional variable. Also rename cap_parsing_failed to skip_cap_parsing.
--- arch/arm64/kernel/topology.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
arch/arm64/kernel/topology.c +9 -10
@@ -101,14 +101,14 @@ subsys_initcall(register_cpu_capacity_sysctl);static u32 capacity_scale;static u32 *raw_capacity; -static bool cap_parsing_failed; +static bool skip_cap_parsing;static void __init parse_cpu_capacity (struct device_node *cpu_node,int cpu) {int ret;u32 cpu_capacity; -if (cap_parsing_failed) +if (skip_cap_parsing)return ; ret = of_property_read_u32(cpu_node,
@@ -121,7 +121,7 @@ static void __init parse_cpu_capacity(struct device_node *cpu_node, int cpu) GFP_KERNEL);if (!raw_capacity) {pr_err ("cpu_capacity: failed to allocate memory for raw capacities\n" ); - cap_parsing_failed = true; + skip_cap_parsing = true;return ; } }
@@ -135,7 +135,7 @@ static void __init parse_cpu_capacity(struct device_node *cpu_node, int cpu) cpu_node->full_name);pr_err ("cpu_capacity: partial information: fallback to 1024 for all CPUs\n" ); } - cap_parsing_failed = true; + skip_cap_parsing = true;kfree (raw_capacity); } }
@@ -145,7 +145,7 @@ static void normalize_cpu_capacity(void)u64 capacity;int cpu; -if (!raw_capacity || cap_parsing_failed) +if (!raw_capacity || skip_cap_parsing)return ;pr_debug ("cpu_capacity: capacity_scale=%u\n" , capacity_scale);
@@ -164,7 +164,6 @@ static void normalize_cpu_capacity(void)#ifdef CONFIG_CPU_FREQ static cpumask_var_t cpus_to_visit; -static bool cap_parsing_done;static void parsing_done_workfn (struct work_struct *work); static DECLARE_WORK(parsing_done_work, parsing_done_workfn);
@@ -176,7 +175,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,struct cpufreq_policy *policy = data;int cpu; -if (cap_parsing_failed || cap_parsing_done) +if (skip_cap_parsing)return 0 ;switch (val) {
@@ -195,8 +194,8 @@ init_cpu_capacity_callback(struct notifier_block *nb,if (cpumask_empty (cpus_to_visit)) {normalize_cpu_capacity ();kfree (raw_capacity); + skip_cap_parsing = true;pr_debug ("cpu_capacity: parsing done\n" ); - cap_parsing_done = true;schedule_work (&parsing_done_work); } }
@@ -214,7 +213,7 @@ static int __init register_cpufreq_notifier(void)* until we have the necessary code to parse the cpu capacity, so * skip registering cpufreq notifier. */ -if (!acpi_disabled || cap_parsing_failed) +if (!acpi_disabled || skip_cap_parsing)return -EINVAL ;if (!alloc_cpumask_var (&cpus_to_visit,GFP_KERNEL )) {
@@ -401,7 +400,7 @@ static int __init parse_dt_topology(void)*/ map =of_get_child_by_name (cn,"cpu-map" );if (!map) { - cap_parsing_failed = true; + skip_cap_parsing = true; goto out; }
Signature · 1 line
2.13.0.71.gd7076ec9c9cb
PATCH 1/1 arm64: topology: Get rid of "cap_parsing_done"
Quoted 7 lines · Viresh Kumar
We can reuse "
cap_parsing_failed" instead of keeping an additional variable. Also renamecap_parsing_failedtoskip_cap_parsing.Signed-off-by Viresh Kumar <[email protected]>--- arch/arm64/kernel/topology.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
You probably need to co-ordinate with this series:
http://lkml.kernel.org/r/20170531165931.6945-5-juri.lelli at arm.com
and it would be clearer to split up the renaming part of the patch from the remove of the additional bool.
Will
PATCH 1/1 arm64: topology: Get rid of "cap_parsing_done"
Quoted 9 lines · Will Deacon
Quoted 7 lines · Viresh Kumar
We can reuse "
cap_parsing_failed" instead of keeping an additional variable. Also renamecap_parsing_failedtoskip_cap_parsing.Signed-off-by Viresh Kumar <[email protected]>--- arch/arm64/kernel/topology.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
Quoted 6 lines
You probably need to co-ordinate with this series:
http://lkml.kernel.org/r/20170531165931.6945-5-juri.lelli at arm.com
and it would be clearer to split up the renaming part of the patch from the remove of the additional bool.
Thanks, I missed that series for sure :)
Signature · 1 line
viresh