Commit 09d1223a authored by Dave Martin's avatar Dave Martin Committed by Marc Zyngier

arm64: Use update{,_tsk}_thread_flag()

This patch uses the new update_thread_flag() helpers to simplify a
couple of if () set; else clear; constructs.

No functional change.
Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 93ee37c2
...@@ -618,10 +618,8 @@ int sve_set_vector_length(struct task_struct *task, ...@@ -618,10 +618,8 @@ int sve_set_vector_length(struct task_struct *task,
task->thread.sve_vl = vl; task->thread.sve_vl = vl;
out: out:
if (flags & PR_SVE_VL_INHERIT) update_tsk_thread_flag(task, TIF_SVE_VL_INHERIT,
set_tsk_thread_flag(task, TIF_SVE_VL_INHERIT); flags & PR_SVE_VL_INHERIT);
else
clear_tsk_thread_flag(task, TIF_SVE_VL_INHERIT);
return 0; return 0;
} }
...@@ -910,12 +908,12 @@ void fpsimd_thread_switch(struct task_struct *next) ...@@ -910,12 +908,12 @@ void fpsimd_thread_switch(struct task_struct *next)
* the TIF_FOREIGN_FPSTATE flag so the state will be loaded * the TIF_FOREIGN_FPSTATE flag so the state will be loaded
* upon the next return to userland. * upon the next return to userland.
*/ */
if (__this_cpu_read(fpsimd_last_state.st) == bool wrong_task = __this_cpu_read(fpsimd_last_state.st) !=
&next->thread.uw.fpsimd_state &next->thread.uw.fpsimd_state;
&& next->thread.fpsimd_cpu == smp_processor_id()) bool wrong_cpu = next->thread.fpsimd_cpu != smp_processor_id();
clear_tsk_thread_flag(next, TIF_FOREIGN_FPSTATE);
else update_tsk_thread_flag(next, TIF_FOREIGN_FPSTATE,
set_tsk_thread_flag(next, TIF_FOREIGN_FPSTATE); wrong_task || wrong_cpu);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment