Skip to content

Commit 8e1f78a

Browse files
geertuctmarinas
authored andcommitted
arm64/sve: Move sve_free() into SVE code section
If CONFIG_ARM64_SVE is not set: arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function] Fix this by moving sve_free() and __sve_free() into the existing section protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that section has been removed. Fixes: a1259dd ("arm64/sve: Delay freeing memory in fpsimd_flush_thread()") Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/cd633284683c24cb9469f8ff429915aedf67f868.1652798894.git.geert+renesas@glider.be Signed-off-by: Catalin Marinas <[email protected]>
1 parent 696207d commit 8e1f78a

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

arch/arm64/kernel/fpsimd.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -281,23 +281,6 @@ static bool have_cpu_fpsimd_context(void)
281281
return !preemptible() && __this_cpu_read(fpsimd_context_busy);
282282
}
283283

284-
/*
285-
* Call __sve_free() directly only if you know task can't be scheduled
286-
* or preempted.
287-
*/
288-
static void __sve_free(struct task_struct *task)
289-
{
290-
kfree(task->thread.sve_state);
291-
task->thread.sve_state = NULL;
292-
}
293-
294-
static void sve_free(struct task_struct *task)
295-
{
296-
WARN_ON(test_tsk_thread_flag(task, TIF_SVE));
297-
298-
__sve_free(task);
299-
}
300-
301284
unsigned int task_get_vl(const struct task_struct *task, enum vec_type type)
302285
{
303286
return task->thread.vl[type];
@@ -690,6 +673,22 @@ static void sve_to_fpsimd(struct task_struct *task)
690673
}
691674

692675
#ifdef CONFIG_ARM64_SVE
676+
/*
677+
* Call __sve_free() directly only if you know task can't be scheduled
678+
* or preempted.
679+
*/
680+
static void __sve_free(struct task_struct *task)
681+
{
682+
kfree(task->thread.sve_state);
683+
task->thread.sve_state = NULL;
684+
}
685+
686+
static void sve_free(struct task_struct *task)
687+
{
688+
WARN_ON(test_tsk_thread_flag(task, TIF_SVE));
689+
690+
__sve_free(task);
691+
}
693692

694693
/*
695694
* Return how many bytes of memory are required to store the full SVE

0 commit comments

Comments
 (0)