From: wudaemon <wudaemon@163.com>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, wudaemon <wudaemon@163.com>
Subject: [RESEND] genirq: add log level to printk in print_irq_desc
Date: Sun, 13 Mar 2022 03:44:15 +0000 [thread overview]
Message-ID: <20220313034415.4110-1-wudaemon@163.com> (raw)
add KERN_DEBUG level for debuging purpose, use checkpatch.pl check prompt:
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
so add do - while loop to Macros
Signed-off-by: wudaemon <wudaemon@163.com>
---
kernel/irq/debug.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kernel/irq/debug.h b/kernel/irq/debug.h
index 8ccb326d2977..ce0ec677bea0 100644
--- a/kernel/irq/debug.h
+++ b/kernel/irq/debug.h
@@ -3,8 +3,8 @@
* Debugging printout:
*/
-#define ___P(f) if (desc->status_use_accessors & f) printk("%14s set\n", #f)
-#define ___PS(f) if (desc->istate & f) printk("%14s set\n", #f)
+#define ___P(f) do {if (desc->status_use_accessors & f) printk(KERN_DEBUG "%14s set\n", #f); } while (0)
+#define ___PS(f) do {if (desc->istate & f) printk(KERN_DEBUG "%14s set\n", #f); } while (0)
/* FIXME */
#define ___PD(f) do { } while (0)
@@ -15,15 +15,15 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
if (!__ratelimit(&ratelimit))
return;
- printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
+ printk(KERN_DEBUG "irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
- printk("->handle_irq(): %p, %pS\n",
+ printk(KERN_DEBUG "->handle_irq(): %p, %pS\n",
desc->handle_irq, desc->handle_irq);
- printk("->irq_data.chip(): %p, %pS\n",
+ printk(KERN_DEBUG "->irq_data.chip(): %p, %pS\n",
desc->irq_data.chip, desc->irq_data.chip);
- printk("->action(): %p\n", desc->action);
+ printk(KERN_DEBUG "->action(): %p\n", desc->action);
if (desc->action) {
- printk("->action->handler(): %p, %pS\n",
+ printk(KERN_DEBUG "->action->handler(): %p, %pS\n",
desc->action->handler, desc->action->handler);
}
--
2.25.1
next reply other threads:[~2022-03-13 4:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-13 3:44 wudaemon [this message]
2022-03-15 13:58 ` Thomas Gleixner
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=20220313034415.4110-1-wudaemon@163.com \
--to=wudaemon@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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®