]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
arm64/fp: Reindent fpsimd_save()
authorMark Brown <broonie@kernel.org>
Tue, 19 Oct 2021 17:22:06 +0000 (18:22 +0100)
committerWill Deacon <will@kernel.org>
Thu, 21 Oct 2021 09:18:16 +0000 (10:18 +0100)
Currently all the active code in fpsimd_save() is inside a check for
TIF_FOREIGN_FPSTATE. Reduce the indentation level by changing to return
from the function if TIF_FOREIGN_FPSTATE is set.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211019172247.3045838-2-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/fpsimd.c

index ff4962750b3d0f66327167eaf0686a8efdfc9a29..995f8801602bb2bbf0839c1317905a98e54d3f7a 100644 (file)
@@ -308,24 +308,26 @@ static void fpsimd_save(void)
        WARN_ON(!system_supports_fpsimd());
        WARN_ON(!have_cpu_fpsimd_context());
 
-       if (!test_thread_flag(TIF_FOREIGN_FPSTATE)) {
-               if (IS_ENABLED(CONFIG_ARM64_SVE) &&
-                   test_thread_flag(TIF_SVE)) {
-                       if (WARN_ON(sve_get_vl() != last->sve_vl)) {
-                               /*
-                                * Can't save the user regs, so current would
-                                * re-enter user with corrupt state.
-                                * There's no way to recover, so kill it:
-                                */
-                               force_signal_inject(SIGKILL, SI_KERNEL, 0, 0);
-                               return;
-                       }
-
-                       sve_save_state((char *)last->sve_state +
-                                               sve_ffr_offset(last->sve_vl),
-                                      &last->st->fpsr);
-               } else
-                       fpsimd_save_state(last->st);
+       if (test_thread_flag(TIF_FOREIGN_FPSTATE))
+               return;
+
+       if (IS_ENABLED(CONFIG_ARM64_SVE) &&
+           test_thread_flag(TIF_SVE)) {
+               if (WARN_ON(sve_get_vl() != last->sve_vl)) {
+                       /*
+                        * Can't save the user regs, so current would
+                        * re-enter user with corrupt state.
+                        * There's no way to recover, so kill it:
+                        */
+                       force_signal_inject(SIGKILL, SI_KERNEL, 0, 0);
+                       return;
+               }
+
+               sve_save_state((char *)last->sve_state +
+                                       sve_ffr_offset(last->sve_vl),
+                              &last->st->fpsr);
+       } else {
+               fpsimd_save_state(last->st);
        }
 }