linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/vector: print_APIC_field - use print_hex_dump_debug
@ 2020-09-21 19:10 Joe Perches
  2020-09-21 19:35 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2020-09-21 19:10 UTC (permalink / raw)
  To: Thomas Gleixner, Borislav Petkov, x86, H. Peter Anvin
  Cc: Marc Zyngier, Andy Lutomirski, Ming Lei, Peter Xu, linux-kernel

Convert the printk(KERN_DEBUG) / pr_cont uses to print_hex_dump_debug.

Output is now single line with spaces between output u32s.

---
 arch/x86/kernel/apic/vector.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index f8a56b5dc29f..fd4b630ac4c1 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -1051,16 +1051,16 @@ int lapic_can_unplug_cpu(void)
 #endif /* HOTPLUG_CPU */
 #endif /* SMP */
 
-static void __init print_APIC_field(int base)
+static void __init print_APIC_field(const char *prefix, int base)
 {
 	int i;
+	u32 reads[8];
 
-	printk(KERN_DEBUG);
+	for (i = 0; i < ARRAY_SIZE(reads); i++)
+		reads[i] = apic_read(base + i*0x10);
 
-	for (i = 0; i < 8; i++)
-		pr_cont("%08x", apic_read(base + i*0x10));
-
-	pr_cont("\n");
+	print_hex_dump_debug(prefix, DUMP_PREFIX_NONE, 32, 4,
+			     reads, sizeof(reads), false);
 }
 
 static void __init print_local_APIC(void *dummy)
@@ -1109,12 +1109,9 @@ static void __init print_local_APIC(void *dummy)
 	v = apic_read(APIC_SPIV);
 	pr_debug("... APIC SPIV: %08x\n", v);
 
-	pr_debug("... APIC ISR field:\n");
-	print_APIC_field(APIC_ISR);
-	pr_debug("... APIC TMR field:\n");
-	print_APIC_field(APIC_TMR);
-	pr_debug("... APIC IRR field:\n");
-	print_APIC_field(APIC_IRR);
+	print_APIC_field("... APIC ISR field: ", APIC_ISR);
+	print_APIC_field("... APIC TMR field: ", APIC_TMR);
+	print_APIC_field("... APIC IRR field: ", APIC_IRR);
 
 	/* !82489DX */
 	if (APIC_INTEGRATED(ver)) {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/vector: print_APIC_field - use print_hex_dump_debug
  2020-09-21 19:10 [PATCH] x86/vector: print_APIC_field - use print_hex_dump_debug Joe Perches
@ 2020-09-21 19:35 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2020-09-21 19:35 UTC (permalink / raw)
  To: Joe Perches
  Cc: Thomas Gleixner, x86, H. Peter Anvin, Marc Zyngier,
	Andy Lutomirski, Ming Lei, Peter Xu, linux-kernel

On Mon, Sep 21, 2020 at 12:10:38PM -0700, Joe Perches wrote:
> Convert the printk(KERN_DEBUG) / pr_cont uses to print_hex_dump_debug.
> 
> Output is now single line with spaces between output u32s.
> 
> ---
>  arch/x86/kernel/apic/vector.c | 21 +++++++++------------
>  1 file changed, 9 insertions(+), 12 deletions(-)

Forgot to use checkpatch on your patch:

$ ./scripts/checkpatch.pl /tmp/joe
ERROR: Missing Signed-off-by: line(s)

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-21 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 19:10 [PATCH] x86/vector: print_APIC_field - use print_hex_dump_debug Joe Perches
2020-09-21 19:35 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).