[PATCH 1/2] x86/mce: Spell the long long conversions in __print_mce() as %llx
From: Breno Leitao
Date: Tue Sep 22 2026 - 07:12:59 EST
__print_mce() mixes %Lx and %llx for the same u64 fields. Kernel
vsnprintf() treats the two identically, format_decode() maps both to
sizeof(long long):
['l'] = { 0, sizeof(long), sizeof(long long) },
['L'] = { 0, sizeof(long long) },
but checkpatch flags %Lx, and the rest of the function already uses
%llx. Use %llx throughout, and while touching the RIP call, align its
continuation lines with the open parenthesis.
No change to the printed output.
Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
---
arch/x86/kernel/cpu/mce/core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 9bba1e2f03af7..4b457c6bed8f5 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -177,15 +177,15 @@ static void __print_mce(struct mce_hw_err *err)
{
struct mce *m = &err->m;
- pr_emerg(HW_ERR "CPU %d: Machine Check%s: %Lx Bank %d: %016Lx\n",
+ pr_emerg(HW_ERR "CPU %d: Machine Check%s: %llx Bank %d: %016llx\n",
m->extcpu,
(m->mcgstatus & MCG_STATUS_MCIP ? " Exception" : ""),
m->mcgstatus, m->bank, m->status);
if (m->ip) {
- pr_emerg(HW_ERR "RIP%s %02x:<%016Lx> ",
- !(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
- m->cs, m->ip);
+ pr_emerg(HW_ERR "RIP%s %02x:<%016llx> ",
+ !(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
+ m->cs, m->ip);
if (m->cs == __KERNEL_CS)
pr_cont("{%pS}", (void *)(unsigned long)m->ip);
--
2.53.0-Meta