Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93a57081 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman
Browse files

arch_topology: Convert switch block to if block



We only need to take care of one case here (CPUFREQ_NOTIFY) and there is
no need to add an extra level of indentation to the case specific code
by using a switch block. Use an if block instead.

Also add some blank lines to make the code look better.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarJuri Lelli <juri.lelli@arm.com>
Tested-by: default avatarJuri Lelli <juri.lelli@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3eeba1a2
Loading
Loading
Loading
Loading
+22 −19
Original line number Diff line number Diff line
@@ -174,18 +174,21 @@ init_cpu_capacity_callback(struct notifier_block *nb,
	if (cap_parsing_failed || cap_parsing_done)
		return 0;

	switch (val) {
	case CPUFREQ_NOTIFY:
	if (val != CPUFREQ_NOTIFY)
		return 0;

	pr_debug("cpu_capacity: init cpu capacity for CPUs [%*pbl] (to_visit=%*pbl)\n",
		 cpumask_pr_args(policy->related_cpus),
		 cpumask_pr_args(cpus_to_visit));
		cpumask_andnot(cpus_to_visit, cpus_to_visit,
			       policy->related_cpus);

	cpumask_andnot(cpus_to_visit, cpus_to_visit, policy->related_cpus);

	for_each_cpu(cpu, policy->related_cpus) {
		raw_capacity[cpu] = topology_get_cpu_scale(NULL, cpu) *
				    policy->cpuinfo.max_freq / 1000UL;
		capacity_scale = max(raw_capacity[cpu], capacity_scale);
	}

	if (cpumask_empty(cpus_to_visit)) {
		topology_normalize_cpu_scale();
		kfree(raw_capacity);
@@ -193,7 +196,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,
		cap_parsing_done = true;
		schedule_work(&parsing_done_work);
	}
	}

	return 0;
}