Skip to content

Commit 12879bd

Browse files
committed
csky: Fixup init_fpu compile warning with __init
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 <[email protected]> Signed-off-by: Guo Ren <[email protected]>
1 parent 98d54f8 commit 12879bd

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

arch/csky/abiv2/fpu.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
#define MTCR_DIST 0xC0006420
1111
#define MFCR_DIST 0xC0006020
1212

13-
void __init init_fpu(void)
14-
{
15-
mtcr("cr<1, 2>", 0);
16-
}
17-
1813
/*
1914
* fpu_libc_helper() is to help libc to excute:
2015
* - mfcr %a, cr<1, 2>

arch/csky/abiv2/inc/abi/fpu.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
int fpu_libc_helper(struct pt_regs *regs);
1111
void fpu_fpe(struct pt_regs *regs);
12-
void __init init_fpu(void);
12+
13+
static inline void init_fpu(void) { mtcr("cr<1, 2>", 0); }
1314

1415
void save_to_user_fp(struct user_fp *user_fp);
1516
void restore_from_user_fp(struct user_fp *user_fp);

arch/csky/kernel/smp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include <asm/sections.h>
2323
#include <asm/mmu_context.h>
2424
#include <asm/pgalloc.h>
25+
#ifdef CONFIG_CPU_HAS_FPU
26+
#include <abi/fpu.h>
27+
#endif
2528

2629
struct ipi_data_struct {
2730
unsigned long bits ____cacheline_aligned;

0 commit comments

Comments
 (0)