diff options
| author | Viresh Kumar <viresh.kumar@linaro.org> | 2017-06-23 05:25:32 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-17 11:32:05 -0400 |
| commit | 805df2966f67a6b1a228c8e580e230b6c849b41e (patch) | |
| tree | d600706aaa5a28ebba5825362f7640091c8a1c7d | |
| parent | 93a57081d20c1f93c209fec0f247f5bed936cc34 (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.c | 8 | ||||
| -rw-r--r-- | include/linux/arch_topology.h | 4 |
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 | ||
| 122 | int __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu) | 122 | bool __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 | |||
| 7 | void topology_normalize_cpu_scale(void); | 9 | void topology_normalize_cpu_scale(void); |
| 8 | 10 | ||
| 9 | struct device_node; | 11 | struct device_node; |
| 10 | int topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); | 12 | bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); |
| 11 | 13 | ||
| 12 | struct sched_domain; | 14 | struct sched_domain; |
| 13 | unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); | 15 | unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); |
