Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: gdb@sourceware.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Will Deacon" <will.deacon@arm.com>,
	"Julien Grall" <julien.grall@arm.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Zhang Lei" <zhang.lei@jp.fujitsu.com>,
	"Alan Hayward" <alan.hayward@arm.com>
Subject: [PATCH v2 3/3] arm64/sve: Fix a couple of magic numbers for the Z-reg count
Date: Wed, 12 Jun 2019 16:01:00 -0000	[thread overview]
Message-ID: <1560355234-25516-4-git-send-email-Dave.Martin@arm.com> (raw)
In-Reply-To: <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


  parent reply	other threads:[~2019-06-12 16:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 16:00 [PATCH v2 0/3] arm64/sve: Fix mutating register endianness on big-endian Dave Martin
2019-06-12 16:01 ` [PATCH v2 1/3] arm64/sve: Fix missing SVE/FPSIMD endianness conversions Dave Martin
2019-06-12 17:29   ` Will Deacon
2019-06-12 17:46   ` Julien Grall
2019-06-13 10:00     ` Dave Martin
2019-06-13 10:17       ` Will Deacon
2019-06-13 10:20         ` Dave Martin
2019-06-12 16:01 ` [PATCH v2 2/3] arm64/sve: Factor out FPSIMD to SVE state conversion Dave Martin
2019-06-20 13:45   ` Julien Grall
2019-07-22 10:31   ` Catalin Marinas
2019-06-12 16:01 ` Dave Martin [this message]
2019-06-20 13:43   ` [PATCH v2 3/3] arm64/sve: Fix a couple of magic numbers for the Z-reg count Julien Grall
2019-07-22 10:32   ` Catalin Marinas

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=1560355234-25516-4-git-send-email-Dave.Martin@arm.com \
    --to=dave.martin@arm.com \
    --cc=alan.hayward@arm.com \
    --cc=alex.bennee@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=gdb@sourceware.org \
    --cc=julien.grall@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=peter.maydell@linaro.org \
    --cc=will.deacon@arm.com \
    --cc=zhang.lei@jp.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox