arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels
authorDave Martin <Dave.Martin@arm.com>
Mon, 18 Sep 2017 08:40:12 +0000 (09:40 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 18 Sep 2017 10:20:17 +0000 (11:20 +0100)
__efi_fpsimd_begin()/__efi_fpsimd_end() are for use when making EFI
calls only, so using them in non-EFI kernels is not allowed.

This patch compiles them out if CONFIG_EFI is not set.

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/fpsimd.c

index 3a68cf38a6b36712e1a5a6a8463a19d32bbdb4f5..f444f374bd7b3ccea1b097cc13d9229db5c8f2c3 100644 (file)
@@ -321,6 +321,8 @@ void kernel_neon_end(void)
 }
 EXPORT_SYMBOL(kernel_neon_end);
 
+#ifdef CONFIG_EFI
+
 static DEFINE_PER_CPU(struct fpsimd_state, efi_fpsimd_state);
 static DEFINE_PER_CPU(bool, efi_fpsimd_state_used);
 
@@ -370,6 +372,8 @@ void __efi_fpsimd_end(void)
                kernel_neon_end();
 }
 
+#endif /* CONFIG_EFI */
+
 #endif /* CONFIG_KERNEL_MODE_NEON */
 
 #ifdef CONFIG_CPU_PM