MIPS: cpu-bugs64: Mark inline functions as __always_inline

Commit ac7c3e4ff4 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly") allows compiler to uninline functions marked as 'inline'.
Leading to section mismatch in this case.

Since we're using const variables to pass assembly flags, 'inline's
can't be dropped. So we simply mark them as __always_inline.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org
[paul.burton@mips.com:
  - Annotate these functions with __init, even if it only serves to
    inform human readers when the code can be used.
  - Drop the __always_inline from check_daddi() & check_daddiu() which
    don't use arguments as immediates in inline asm.
  - Rewrap the commit message.]
Signed-off-by: Paul Burton <paul.burton@mips.com>
This commit is contained in:
Jiaxun Yang 2019-09-27 13:33:39 +08:00 committed by Paul Burton
parent 0889d07f3e
commit d345d9cad2
No known key found for this signature in database
GPG Key ID: 3EA79FACB57500DD
1 changed files with 8 additions and 6 deletions

View File

@ -24,7 +24,8 @@ static char r4kwar[] __initdata =
static char daddiwar[] __initdata =
"Enable CPU_DADDI_WORKAROUNDS to rectify.";
static inline void align_mod(const int align, const int mod)
static __always_inline __init
void align_mod(const int align, const int mod)
{
asm volatile(
".set push\n\t"
@ -38,7 +39,8 @@ static inline void align_mod(const int align, const int mod)
: "n"(align), "n"(mod));
}
static __always_inline void mult_sh_align_mod(long *v1, long *v2, long *w,
static __always_inline __init
void mult_sh_align_mod(long *v1, long *v2, long *w,
const int align, const int mod)
{
unsigned long flags;
@ -113,7 +115,7 @@ static __always_inline void mult_sh_align_mod(long *v1, long *v2, long *w,
*w = lw;
}
static inline void check_mult_sh(void)
static __always_inline __init void check_mult_sh(void)
{
long v1[8], v2[8], w[8];
int bug, fix, i;
@ -176,7 +178,7 @@ asmlinkage void __init do_daddi_ov(struct pt_regs *regs)
exception_exit(prev_state);
}
static inline void check_daddi(void)
static __init void check_daddi(void)
{
extern asmlinkage void handle_daddi_ov(void);
unsigned long flags;
@ -242,7 +244,7 @@ static inline void check_daddi(void)
int daddiu_bug = IS_ENABLED(CONFIG_CPU_MIPSR6) ? 0 : -1;
static inline void check_daddiu(void)
static __init void check_daddiu(void)
{
long v, w, tmp;