From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, rkrcmar@redhat.com, lvivier@redhat.com,
thuth@redhat.com
Subject: [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg
Date: Mon, 22 May 2017 20:18:20 +0200 [thread overview]
Message-ID: <20170522181821.29482-2-drjones@redhat.com> (raw)
In-Reply-To: <20170522181821.29482-1-drjones@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
lib/arm/setup.c | 7 ++-----
lib/powerpc/setup.c | 8 ++------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/lib/arm/setup.c b/lib/arm/setup.c
index 689c211d3018..9974b4c131dd 100644
--- a/lib/arm/setup.c
+++ b/lib/arm/setup.c
@@ -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);
}
diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c
index 8d44311cac3b..7157bcb70094 100644
--- a/lib/powerpc/setup.c
+++ b/lib/powerpc/setup.c
@@ -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]));
--
2.9.3
next prev parent reply other threads:[~2017-05-22 18:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 18:18 [PATCH kvm-unit-tests 0/2] apply some new lib functions Andrew Jones
2017-05-22 18:18 ` Andrew Jones [this message]
2017-05-22 20:05 ` [PATCH kvm-unit-tests 1/2] arm/powerpc: setup: apply assert_msg Thomas Huth
2017-05-22 18:18 ` [PATCH kvm-unit-tests 2/2] arm/arm64: gic: apply report_prefix_pushf Andrew Jones
2017-05-22 20:09 ` Thomas Huth
2017-05-25 16:36 ` [PATCH kvm-unit-tests 0/2] apply some new lib functions Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170522181821.29482-2-drjones@redhat.com \
--to=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.