summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2021-10-22 15:16:35 +0100
committerWill Deacon <willdeacon@google.com>2022-09-29 12:35:47 +0100
commit2ea078c25c19f6f51896f267a48aee6e9878df69 (patch)
treeb45fc85d88c2127b5dd5d98429cca0ee69e926dd
parent3913b9b11860297083129020984830785762bb69 (diff)
UPSTREAM: arm64/sve: Fix warnings when SVE is disabled
In configurations where SVE is disabled we define but never reference the functions for retrieving the default vector length, causing warnings. Fix this by move the ifdef up, marking get_default_vl() inline since it is referenced from code guarded by an IS_ENABLED() check, and do the same for the other accessors for consistency. Reported-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20211022141635.2360415-3-broonie@kernel.org Signed-off-by: Will Deacon <will@kernel.org> (cherry picked from commit 04ee53a55543ddc16398391ac95e97e5c9436ba3) Signed-off-by: Will Deacon <willdeacon@google.com> Bug: 247169981 Change-Id: I4a64a03c790b42f5c133bc09d52bb327215bfc5f
-rw-r--r--arch/arm64/kernel/fpsimd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 07dc2a050af2..a46be5787a1b 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -166,24 +166,24 @@ struct vl_config {
static struct vl_config vl_config[ARM64_VEC_MAX];
-static int get_default_vl(enum vec_type type)
+static inline int get_default_vl(enum vec_type type)
{
return READ_ONCE(vl_config[type].__default_vl);
}
-static int get_sve_default_vl(void)
+#ifdef CONFIG_ARM64_SVE
+
+static inline int get_sve_default_vl(void)
{
return get_default_vl(ARM64_VEC_SVE);
}
-#ifdef CONFIG_ARM64_SVE
-
-static void set_default_vl(enum vec_type type, int val)
+static inline void set_default_vl(enum vec_type type, int val)
{
WRITE_ONCE(vl_config[type].__default_vl, val);
}
-static void set_sve_default_vl(int val)
+static inline void set_sve_default_vl(int val)
{
set_default_vl(ARM64_VEC_SVE, val);
}