This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
[PATCH v2 3/3] arm64/sve: Fix a couple of magic numbers for the Z-reg count
- From: Dave Martin <Dave dot Martin at arm dot com>
- To: linux-arm-kernel at lists dot infradead dot org
- Cc: gdb at sourceware dot org, Alex Bennée <alex dot bennee at linaro dot org>, Will Deacon <will dot deacon at arm dot com>, Julien Grall <julien dot grall at arm dot com>, Catalin Marinas <catalin dot marinas at arm dot com>, Peter Maydell <peter dot maydell at linaro dot org>, Zhang Lei <zhang dot lei at jp dot fujitsu dot com>, Alan Hayward <alan dot hayward at arm dot com>
- Date: Wed, 12 Jun 2019 17:00:34 +0100
- Subject: [PATCH v2 3/3] arm64/sve: Fix a couple of magic numbers for the Z-reg count
- References: <1560355234-25516-1-git-send-email-Dave.Martin@arm.com>
There are some hand-written instances of "32" to express the number
of SVE Z-registers.
Since this code was written a #define was added for this, so
convert trivial instances of this magic number as appropriate.
No functional change.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
arch/arm64/kernel/fpsimd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index d2f7544..a5702c3 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -376,7 +376,7 @@ static void __fpsimd_to_sve(void *sst, struct user_fpsimd_state const *fst,
unsigned int i;
__uint128_t *p;
- for (i = 0; i < 32; ++i) {
+ for (i = 0; i < SVE_NUM_ZREGS; ++i) {
p = (__uint128_t *)ZREG(sst, vq, i);
*p = arm64_cpu_to_le128(fst->vregs[i]);
}
@@ -428,7 +428,7 @@ static void sve_to_fpsimd(struct task_struct *task)
return;
vq = sve_vq_from_vl(task->thread.sve_vl);
- for (i = 0; i < 32; ++i) {
+ for (i = 0; i < SVE_NUM_ZREGS; ++i) {
p = (__uint128_t const *)ZREG(sst, vq, i);
fst->vregs[i] = arm64_le128_to_cpu(*p);
}
--
2.1.4