Skip to contentSkip to conversation

x86: init: Remove raw kernel pointer from printk

PATCH In review Jeff loughlin 2 participants 2 messages Sep 28, 2018 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: init: Remove raw kernel pointer from printk

From: Jeff Loughlin <[email protected]>

printk message in set_real_mode_mem() contains a raw kernel pointer, which printk rightly changes to (ptrval). This is useless in the dmesg log and should be removed.

---
 arch/x86/realmode/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/realmode/init.c +2 -2
index d101058..d76a138 100644
@@ -20,8 +20,8 @@ void __init set_real_mode_mem(phys_addr_t mem, size_t size)
 	void *base = __va(mem);
 
 	real_mode_header = (struct real_mode_header *) base;
-	printk(KERN_DEBUG "Base memory trampoline at [%p] %llx size %zu\n",
-	       base, (unsigned long long)mem, size);
+	printk(KERN_DEBUG "Base memory trampoline at %llx size %zu\n",
+	       (unsigned long long)mem, size);
 }
 
 void __init reserve_real_mode(void)
Signature · 1 line
2.1.4
#1 lore raw

Jeff,

Quoted 3 lines · Jeff loughlin

From: Jeff Loughlin <[email protected]>

printk message in set_real_mode_mem() contains a raw kernel pointer, which printk rightly changes to (ptrval).

Please format your changelog properly next time. Left aligned and line breaks around 78 characters.

Quoted 1 line

This is useless in the dmesg log and should be removed.

Agreed, (ptrval) is pretty useless, but this is a debug printk and the real address is not useless for debugging, so just removing it is not necessarily the best solution.

Quoted 10 lines
---
 arch/x86/realmode/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/realmode/init.c +0 -0
index d101058..d76a138 100644

arch/x86/realmode/init.c void __init set_real_mode_mem(phys_addr_t mem, size_t size) · line 24

Quoted 7 lines
arch/x86/realmode/init.c +2 -2
@@ -20,8 +20,8 @@ void __init set_real_mode_mem(phys_addr_t mem, size_t size)
 	void *base = __va(mem);
 
 	real_mode_header = (struct real_mode_header *) base;
-	printk(KERN_DEBUG "Base memory trampoline at [%p] %llx size %zu\n",
-	       base, (unsigned long long)mem, size);
+	printk(KERN_DEBUG "Base memory trampoline at %llx size %zu\n",
+	       (unsigned long long)mem, size);

Please check your patches with scripts/checkpatch.pl next time. It would have told you to change that printk(KERN_DEBUG) to pr_debug()

Thanks,

tglx