From: Joe Perches <joe@perches.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: Marc Zyngier <maz@kernel.org>, Andy Lutomirski <luto@kernel.org>,
Ming Lei <ming.lei@redhat.com>, Peter Xu <peterx@redhat.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH V2] x86/vector: print_APIC_field - use print_hex_dump_debug
Date: Mon, 21 Sep 2020 19:09:44 -0700 [thread overview]
Message-ID: <613f58fe866eb6cc8a043aac5ec97fe9d8a0126d.camel@perches.com> (raw)
Convert the printk(KERN_DEBUG) / pr_cont uses to print_hex_dump_debug.
Output is now single line with spaces between output u32s.
Signed-off-by: Joe Perches <joe@perches.com>
---
> On Mon, 2020-09-21 at 21:35 +0200, Borislav Petkov wrote:
> Forgot to use checkpatch on your patch:
V2: I've heard of it but rarely use it myself.
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)) {
reply other threads:[~2020-09-22 2:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=613f58fe866eb6cc8a043aac5ec97fe9d8a0126d.camel@perches.com \
--to=joe@perches.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=maz@kernel.org \
--cc=ming.lei@redhat.com \
--cc=peterx@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®