aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanjun Guo <hanjun.guo@linaro.org>2015-03-27 08:14:36 -0400
committerWill Deacon <will.deacon@arm.com>2015-03-31 11:31:00 -0400
commit7676fa70feb2f3bcdd4b854a553a57d8ef8505aa (patch)
tree3f4dcfc5066eb0038282e6c09354f57170e07d28
parentec81ad4eca9736bb73d4458fb7d8a5ccaf3e908e (diff)
ARM64 / ACPI: make acpi_map_gic_cpu_interface() as void function
Since the only caller of acpi_parse_gic_cpu_interface() doesn't need the return value, make it have a void return type to avoid introducing subtle bugs, and update the comments of the function accordingly. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm64/kernel/acpi.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index c263cbaa6484..8b839558838e 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -98,12 +98,8 @@ void __init __acpi_unmap_table(char *map, unsigned long size)
98/** 98/**
99 * acpi_map_gic_cpu_interface - generates a logical cpu number 99 * acpi_map_gic_cpu_interface - generates a logical cpu number
100 * and map to MPIDR represented by GICC structure 100 * and map to MPIDR represented by GICC structure
101 * @mpidr: CPU's hardware id to register, MPIDR represented in MADT
102 * @enabled: this cpu is enabled or not
103 *
104 * Returns the logical cpu number which maps to MPIDR
105 */ 101 */
106static int __init 102static void __init
107acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) 103acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
108{ 104{
109 int i; 105 int i;
@@ -112,17 +108,17 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
112 108
113 if (mpidr == INVALID_HWID) { 109 if (mpidr == INVALID_HWID) {
114 pr_info("Skip MADT cpu entry with invalid MPIDR\n"); 110 pr_info("Skip MADT cpu entry with invalid MPIDR\n");
115 return -EINVAL; 111 return;
116 } 112 }
117 113
118 total_cpus++; 114 total_cpus++;
119 if (!enabled) 115 if (!enabled)
120 return -EINVAL; 116 return;
121 117
122 if (enabled_cpus >= NR_CPUS) { 118 if (enabled_cpus >= NR_CPUS) {
123 pr_warn("NR_CPUS limit of %d reached, Processor %d/0x%llx ignored.\n", 119 pr_warn("NR_CPUS limit of %d reached, Processor %d/0x%llx ignored.\n",
124 NR_CPUS, total_cpus, mpidr); 120 NR_CPUS, total_cpus, mpidr);
125 return -EINVAL; 121 return;
126 } 122 }
127 123
128 /* Check if GICC structure of boot CPU is available in the MADT */ 124 /* Check if GICC structure of boot CPU is available in the MADT */
@@ -130,7 +126,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
130 if (bootcpu_valid) { 126 if (bootcpu_valid) {
131 pr_err("Firmware bug, duplicate CPU MPIDR: 0x%llx in MADT\n", 127 pr_err("Firmware bug, duplicate CPU MPIDR: 0x%llx in MADT\n",
132 mpidr); 128 mpidr);
133 return -EINVAL; 129 return;
134 } 130 }
135 131
136 bootcpu_valid = true; 132 bootcpu_valid = true;
@@ -145,28 +141,27 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
145 if (cpu_logical_map(i) == mpidr) { 141 if (cpu_logical_map(i) == mpidr) {
146 pr_err("Firmware bug, duplicate CPU MPIDR: 0x%llx in MADT\n", 142 pr_err("Firmware bug, duplicate CPU MPIDR: 0x%llx in MADT\n",
147 mpidr); 143 mpidr);
148 return -EINVAL; 144 return;
149 } 145 }
150 } 146 }
151 147
152 if (!acpi_psci_present()) 148 if (!acpi_psci_present())
153 return -EOPNOTSUPP; 149 return;
154 150
155 cpu_ops[enabled_cpus] = cpu_get_ops("psci"); 151 cpu_ops[enabled_cpus] = cpu_get_ops("psci");
156 /* CPU 0 was already initialized */ 152 /* CPU 0 was already initialized */
157 if (enabled_cpus) { 153 if (enabled_cpus) {
158 if (!cpu_ops[enabled_cpus]) 154 if (!cpu_ops[enabled_cpus])
159 return -EINVAL; 155 return;
160 156
161 if (cpu_ops[enabled_cpus]->cpu_init(NULL, enabled_cpus)) 157 if (cpu_ops[enabled_cpus]->cpu_init(NULL, enabled_cpus))
162 return -EOPNOTSUPP; 158 return;
163 159
164 /* map the logical cpu id to cpu MPIDR */ 160 /* map the logical cpu id to cpu MPIDR */
165 cpu_logical_map(enabled_cpus) = mpidr; 161 cpu_logical_map(enabled_cpus) = mpidr;
166 } 162 }
167 163
168 enabled_cpus++; 164 enabled_cpus++;
169 return enabled_cpus;
170} 165}
171 166
172static int __init 167static int __init