Commit 805df296 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

arch_topology: Change return type of topology_parse_cpu_capacity() to bool

topology_parse_cpu_capacity() returns 1 on success and 0 on errors. Make
it return bool instead of int as that suits the purpose 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 93a57081
...@@ -119,13 +119,13 @@ void topology_normalize_cpu_scale(void) ...@@ -119,13 +119,13 @@ void topology_normalize_cpu_scale(void)
mutex_unlock(&cpu_scale_mutex); mutex_unlock(&cpu_scale_mutex);
} }
int __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu) bool __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
{ {
int ret = 1; int ret;
u32 cpu_capacity; u32 cpu_capacity;
if (cap_parsing_failed) if (cap_parsing_failed)
return !ret; return false;
ret = of_property_read_u32(cpu_node, "capacity-dmips-mhz", ret = of_property_read_u32(cpu_node, "capacity-dmips-mhz",
&cpu_capacity); &cpu_capacity);
...@@ -137,7 +137,7 @@ int __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu) ...@@ -137,7 +137,7 @@ int __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
if (!raw_capacity) { if (!raw_capacity) {
pr_err("cpu_capacity: failed to allocate memory for raw capacities\n"); pr_err("cpu_capacity: failed to allocate memory for raw capacities\n");
cap_parsing_failed = true; cap_parsing_failed = true;
return 0; return false;
} }
} }
capacity_scale = max(cpu_capacity, capacity_scale); capacity_scale = max(cpu_capacity, capacity_scale);
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
#ifndef _LINUX_ARCH_TOPOLOGY_H_ #ifndef _LINUX_ARCH_TOPOLOGY_H_
#define _LINUX_ARCH_TOPOLOGY_H_ #define _LINUX_ARCH_TOPOLOGY_H_
#include <linux/types.h>
void topology_normalize_cpu_scale(void); void topology_normalize_cpu_scale(void);
struct device_node; struct device_node;
int topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu);
struct sched_domain; struct sched_domain;
unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment