[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240318055222.34462-1-gehao@kylinos.cn>
Date: Mon, 18 Mar 2024 13:52:22 +0800
From: Hao Ge <gehao@...inos.cn>
To: dave.hansen@...ux.intel.com,
luto@...nel.org,
peterz@...radead.org,
tglx@...utronix.de,
bp@...en8.de,
hpa@...or.com
Cc: linux-kernel@...r.kernel.org,
gehao618@....com,
Hao Ge <gehao@...inos.cn>
Subject: [PATCH] mm/fault: make some is_*** function return bool
is_*** function can return bool,so we change it
Signed-off-by: Hao Ge <gehao@...inos.cn>
---
arch/x86/mm/fault.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index d6375b3c633b..591efd80a3e2 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -415,31 +415,31 @@ static void dump_pagetable(unsigned long address)
* Note we only handle faults in kernel here.
* Does nothing on 32-bit.
*/
-static int is_errata93(struct pt_regs *regs, unsigned long address)
+static bool is_errata93(struct pt_regs *regs, unsigned long address)
{
#if defined(CONFIG_X86_64) && defined(CONFIG_CPU_SUP_AMD)
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD
|| boot_cpu_data.x86 != 0xf)
- return 0;
+ return false;
if (user_mode(regs))
- return 0;
+ return false;
if (address != regs->ip)
- return 0;
+ return false;
if ((address >> 32) != 0)
- return 0;
+ return false;
address |= 0xffffffffUL << 32;
if ((address >= (u64)_stext && address <= (u64)_etext) ||
(address >= MODULES_VADDR && address <= MODULES_END)) {
printk_once(errata93_warning);
regs->ip = address;
- return 1;
+ return true;
}
#endif
- return 0;
+ return false;
}
/*
@@ -450,27 +450,27 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
* are not reachable. Just detect this case and return. Any code
* segment in LDT is compatibility mode.
*/
-static int is_errata100(struct pt_regs *regs, unsigned long address)
+static bool is_errata100(struct pt_regs *regs, unsigned long address)
{
#ifdef CONFIG_X86_64
if ((regs->cs == __USER32_CS || (regs->cs & (1<<2))) && (address >> 32))
- return 1;
+ return true;
#endif
- return 0;
+ return false;
}
/* Pentium F0 0F C7 C8 bug workaround: */
-static int is_f00f_bug(struct pt_regs *regs, unsigned long error_code,
+static bool is_f00f_bug(struct pt_regs *regs, unsigned long error_code,
unsigned long address)
{
#ifdef CONFIG_X86_F00F_BUG
if (boot_cpu_has_bug(X86_BUG_F00F) && !(error_code & X86_PF_USER) &&
idt_is_f00f_address(address)) {
handle_invalid_op(regs);
- return 1;
+ return true;
}
#endif
- return 0;
+ return false;
}
static void show_ldttss(const struct desc_ptr *gdt, const char *name, u16 index)
--
2.25.1
Powered by blists - more mailing lists