Skip to content

Commit 04ee53a

Browse files
brooniewilldeacon
authored andcommitted
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 49ed920 commit 04ee53a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/arm64/kernel/fpsimd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,24 +150,24 @@ struct vl_config {
150150

151151
static struct vl_config vl_config[ARM64_VEC_MAX];
152152

153-
static int get_default_vl(enum vec_type type)
153+
static inline int get_default_vl(enum vec_type type)
154154
{
155155
return READ_ONCE(vl_config[type].__default_vl);
156156
}
157157

158-
static int get_sve_default_vl(void)
158+
#ifdef CONFIG_ARM64_SVE
159+
160+
static inline int get_sve_default_vl(void)
159161
{
160162
return get_default_vl(ARM64_VEC_SVE);
161163
}
162164

163-
#ifdef CONFIG_ARM64_SVE
164-
165-
static void set_default_vl(enum vec_type type, int val)
165+
static inline void set_default_vl(enum vec_type type, int val)
166166
{
167167
WRITE_ONCE(vl_config[type].__default_vl, val);
168168
}
169169

170-
static void set_sve_default_vl(int val)
170+
static inline void set_sve_default_vl(int val)
171171
{
172172
set_default_vl(ARM64_VEC_SVE, val);
173173
}

0 commit comments

Comments
 (0)