Commit 3a9d03a4 authored by Andrew Jones's avatar Andrew Jones Committed by Paolo Bonzini
Browse files

arm/powerpc: setup: apply assert_msg


Signed-off-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
Message-Id: <20170522181821.29482-2-drjones@redhat.com>
Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 67c2cc50
......@@ -48,11 +48,8 @@ static void cpu_set(int fdtnode __unused, u64 regval, void *info __unused)
{
int cpu = nr_cpus++;
if (cpu >= NR_CPUS) {
printf("Number cpus exceeds maximum supported (%d).\n",
NR_CPUS);
assert(0);
}
assert_msg(cpu < NR_CPUS, "Number cpus exceeds maximum supported (%d).", NR_CPUS);
cpus[cpu] = regval;
set_cpu_present(cpu, true);
}
......
......@@ -50,15 +50,11 @@ static void cpu_set(int fdtnode, u64 regval, void *info)
struct cpu_set_params *params = info;
int cpu = nr_cpus++;
if (cpu >= NR_CPUS) {
printf("Number cpus exceeds maximum supported (%d).\n",
NR_CPUS);
assert(0);
}
assert_msg(cpu < NR_CPUS, "Number cpus exceeds maximum supported (%d).", NR_CPUS);
cpus[cpu] = regval;
/* set exception stack address for this CPU (in SPGR0) */
asm volatile ("mtsprg0 %[addr]" ::
[addr] "r" (exception_stack[cpu + 1]));
......
Supports Markdown
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