diff options
author | Oliver Upton <oliver.upton@linux.dev> | 2022-07-27 17:29:05 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-07-27 20:18:38 +0300 |
commit | 62ae21627aa96f6ef361981dd181c74dc7aa314c (patch) | |
tree | c087793184ed00acbd5c2693598b2baecf441635 /arch/arm64/kvm/stacktrace.c | |
parent | 0e773da1e688a1425ef7deae58fa11c5c7e09533 (diff) | |
download | linux-62ae21627aa96f6ef361981dd181c74dc7aa314c.tar.xz |
KVM: arm64: Don't open code ARRAY_SIZE()
Use ARRAY_SIZE() instead of an open-coded version.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Kalesh Singh <kaleshsingh@google.com>
Tested-by: Kalesh Singh <kaleshsingh@google.com>
Link: https://lore.kernel.org/r/20220727142906.1856759-6-maz@kernel.org
Diffstat (limited to 'arch/arm64/kvm/stacktrace.c')
-rw-r--r-- | arch/arm64/kvm/stacktrace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm64/kvm/stacktrace.c b/arch/arm64/kvm/stacktrace.c index 417665854f86..949d19d603fb 100644 --- a/arch/arm64/kvm/stacktrace.c +++ b/arch/arm64/kvm/stacktrace.c @@ -187,11 +187,13 @@ static void pkvm_dump_backtrace(unsigned long hyp_offset) { unsigned long *stacktrace = (unsigned long *) this_cpu_ptr_nvhe_sym(pkvm_stacktrace); - int i, size = NVHE_STACKTRACE_SIZE / sizeof(long); + int i; kvm_nvhe_dump_backtrace_start(); /* The saved stacktrace is terminated by a null entry */ - for (i = 0; i < size && stacktrace[i]; i++) + for (i = 0; + i < ARRAY_SIZE(kvm_nvhe_sym(pkvm_stacktrace)) && stacktrace[i]; + i++) kvm_nvhe_dump_backtrace_entry((void *)hyp_offset, stacktrace[i]); kvm_nvhe_dump_backtrace_end(); } |