aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2017-06-23 05:25:32 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-17 11:32:05 -0400
commit805df2966f67a6b1a228c8e580e230b6c849b41e (patch)
treed600706aaa5a28ebba5825362f7640091c8a1c7d
parent93a57081d20c1f93c209fec0f247f5bed936cc34 (diff)
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: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Juri Lelli <juri.lelli@arm.com> Tested-by: Juri Lelli <juri.lelli@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/arch_topology.c8
-rw-r--r--include/linux/arch_topology.h4
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index a3cd7c869c3e..5728e2fbb765 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -119,13 +119,13 @@ void topology_normalize_cpu_scale(void)
119 mutex_unlock(&cpu_scale_mutex); 119 mutex_unlock(&cpu_scale_mutex);
120} 120}
121 121
122int __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu) 122bool __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
123{ 123{
124 int ret = 1; 124 int ret;
125 u32 cpu_capacity; 125 u32 cpu_capacity;
126 126
127 if (cap_parsing_failed) 127 if (cap_parsing_failed)
128 return !ret; 128 return false;
129 129
130 ret = of_property_read_u32(cpu_node, "capacity-dmips-mhz", 130 ret = of_property_read_u32(cpu_node, "capacity-dmips-mhz",
131 &cpu_capacity); 131 &cpu_capacity);
@@ -137,7 +137,7 @@ int __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
137 if (!raw_capacity) { 137 if (!raw_capacity) {
138 pr_err("cpu_capacity: failed to allocate memory for raw capacities\n"); 138 pr_err("cpu_capacity: failed to allocate memory for raw capacities\n");
139 cap_parsing_failed = true; 139 cap_parsing_failed = true;
140 return 0; 140 return false;
141 } 141 }
142 } 142 }
143 capacity_scale = max(cpu_capacity, capacity_scale); 143 capacity_scale = max(cpu_capacity, capacity_scale);
diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h
index 9af3c174c03a..716ce587247e 100644
--- a/include/linux/arch_topology.h
+++ b/include/linux/arch_topology.h
@@ -4,10 +4,12 @@
4#ifndef _LINUX_ARCH_TOPOLOGY_H_ 4#ifndef _LINUX_ARCH_TOPOLOGY_H_
5#define _LINUX_ARCH_TOPOLOGY_H_ 5#define _LINUX_ARCH_TOPOLOGY_H_
6 6
7#include <linux/types.h>
8
7void topology_normalize_cpu_scale(void); 9void topology_normalize_cpu_scale(void);
8 10
9struct device_node; 11struct device_node;
10int topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); 12bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu);
11 13
12struct sched_domain; 14struct sched_domain;
13unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); 15unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu);