]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
csky: Fixup init_fpu compile warning with __init
authorGuo Ren <guoren@linux.alibaba.com>
Wed, 26 Feb 2020 02:23:26 +0000 (10:23 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:41:26 +0000 (10:41 +0200)
BugLink: https://bugs.launchpad.net/bugs/1875660
[ Upstream commit 12879bda3c2a974b7e4fe199a9c21f0c5f6bca04 ]

WARNING: vmlinux.o(.text+0x2366): Section mismatch in reference from the
function csky_start_secondary() to the function .init.text:init_fpu()

The function csky_start_secondary() references
the function __init init_fpu().
This is often because csky_start_secondary lacks a __init
annotation or the annotation of init_fpu is wrong.

Reported-by: Lu Chongzhi <chongzhi.lcz@alibaba-inc.com>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/csky/abiv2/fpu.c
arch/csky/abiv2/inc/abi/fpu.h
arch/csky/kernel/smp.c

index 86d187d4e5af1b9efba5be1ddffbd29aeabd0ca7..5acc5c2e544e15e5bc29f18bee6f2b421ffcdee5 100644 (file)
 #define MTCR_DIST      0xC0006420
 #define MFCR_DIST      0xC0006020
 
-void __init init_fpu(void)
-{
-       mtcr("cr<1, 2>", 0);
-}
-
 /*
  * fpu_libc_helper() is to help libc to excute:
  *  - mfcr %a, cr<1, 2>
index 22ca3cf2794a1cb0aef6d2e55af1f59f81959a98..09e2700a36936e35479eaccd4691772216ee13ce 100644 (file)
@@ -9,7 +9,8 @@
 
 int fpu_libc_helper(struct pt_regs *regs);
 void fpu_fpe(struct pt_regs *regs);
-void __init init_fpu(void);
+
+static inline void init_fpu(void) { mtcr("cr<1, 2>", 0); }
 
 void save_to_user_fp(struct user_fp *user_fp);
 void restore_from_user_fp(struct user_fp *user_fp);
index de61feb4b6df263483562e3f394484d01f3a8603..b5c5bc3afeb5c8c1bf97bd3d24fd6acdbfc6a8e6 100644 (file)
@@ -22,6 +22,9 @@
 #include <asm/sections.h>
 #include <asm/mmu_context.h>
 #include <asm/pgalloc.h>
+#ifdef CONFIG_CPU_HAS_FPU
+#include <abi/fpu.h>
+#endif
 
 struct ipi_data_struct {
        unsigned long bits ____cacheline_aligned;