mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
If check_bugs_early() is not inlined, which a compiler is free to do
after commit ac7c3e4ff4
("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly"), modpost would warn that check_bugs_early(), a non-init
function, refers to check_bugs64_early(), which is marked __init. This
would not result in any run time issues, as check_bugs_early() is only
called from setup_arch(), which is marked __init.
To avoid this potential warning, just sink the body of
check_bugs_early() into its single call site in setup_arch().
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
47 lines
883 B
C
47 lines
883 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* This is included by init/main.c to check for architecture-dependent bugs.
|
|
*
|
|
* Copyright (C) 2007 Maciej W. Rozycki
|
|
*
|
|
* Needs:
|
|
* void check_bugs(void);
|
|
*/
|
|
#ifndef _ASM_BUGS_H
|
|
#define _ASM_BUGS_H
|
|
|
|
#include <linux/bug.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/smp.h>
|
|
|
|
#include <asm/cpu.h>
|
|
#include <asm/cpu-info.h>
|
|
|
|
extern int daddiu_bug;
|
|
|
|
extern void check_bugs64_early(void);
|
|
|
|
extern void check_bugs32(void);
|
|
extern void check_bugs64(void);
|
|
|
|
static inline void __init check_bugs(void)
|
|
{
|
|
unsigned int cpu = smp_processor_id();
|
|
|
|
cpu_data[cpu].udelay_val = loops_per_jiffy;
|
|
check_bugs32();
|
|
|
|
if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
|
|
check_bugs64();
|
|
}
|
|
|
|
static inline int r4k_daddiu_bug(void)
|
|
{
|
|
if (!IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
|
|
return 0;
|
|
|
|
WARN_ON(daddiu_bug < 0);
|
|
return daddiu_bug != 0;
|
|
}
|
|
|
|
#endif /* _ASM_BUGS_H */
|