diff mbox series

[U-Boot,09/40] x86: mp_init: Use proper error numbers

Message ID 20190130035935.235565-10-sjg@chromium.org
State Superseded
Delegated to: Bin Meng
Headers show
Series x86: Add support for booting from TPL | expand

Commit Message

Simon Glass Jan. 30, 2019, 3:59 a.m. UTC
At present many of the functions in this file return -1 as an error
number. which is -EPERM. Update the code to use real error numbers.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/x86/cpu/mp_init.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Bin Meng Feb. 22, 2019, 7:18 a.m. UTC | #1
On Wed, Jan 30, 2019 at 12:00 PM Simon Glass <sjg@chromium.org> wrote:
>
> At present many of the functions in this file return -1 as an error
> number. which is -EPERM. Update the code to use real error numbers.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/x86/cpu/mp_init.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox series

Patch

diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c
index ea64c2ee57..fefbf8f728 100644
--- a/arch/x86/cpu/mp_init.c
+++ b/arch/x86/cpu/mp_init.c
@@ -322,7 +322,7 @@  static int start_aps(int ap_count, atomic_t *num_aps)
 	if (sipi_vector > max_vector_loc) {
 		printf("SIPI vector too large! 0x%08x\n",
 		       sipi_vector);
-		return -1;
+		return -ENOSPC;
 	}
 
 	debug("Attempting to start %d APs\n", ap_count);
@@ -364,7 +364,7 @@  static int start_aps(int ap_count, atomic_t *num_aps)
 	if (wait_for_aps(num_aps, ap_count, 10000, 50)) {
 		debug("Not all APs checked in: %d/%d\n",
 		      atomic_read(num_aps), ap_count);
-		return -1;
+		return -EIO;
 	}
 
 	return 0;
@@ -387,7 +387,7 @@  static int bsp_do_flight_plan(struct udevice *cpu, struct mp_params *mp_params)
 			if (wait_for_aps(&rec->cpus_entered, num_aps,
 					 timeout_us, step_us)) {
 				debug("MP record %d timeout\n", i);
-				ret = -1;
+				ret = -ETIMEDOUT;
 			}
 		}
 
@@ -508,7 +508,7 @@  int mp_init(struct mp_params *p)
 
 	if (p == NULL || p->flight_plan == NULL || p->num_records < 1) {
 		printf("Invalid MP parameters\n");
-		return -1;
+		return -EINVAL;
 	}
 
 	num_cpus = cpu_get_count(cpu);
@@ -531,7 +531,7 @@  int mp_init(struct mp_params *p)
 	/* Load the SIPI vector */
 	ret = load_sipi_vector(&ap_count, num_cpus);
 	if (ap_count == NULL)
-		return -1;
+		return -ENOENT;
 
 	/*
 	 * Make sure SIPI data hits RAM so the APs that come up will see