* [RESEND] genirq: add log level to printk in print_irq_desc
@ 2022-03-13 3:44 wudaemon
2022-03-15 13:58 ` Thomas Gleixner
0 siblings, 1 reply; 2+ messages in thread
From: wudaemon @ 2022-03-13 3:44 UTC (permalink / raw)
To: tglx; +Cc: linux-kernel, wudaemon
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RESEND] genirq: add log level to printk in print_irq_desc
2022-03-13 3:44 [RESEND] genirq: add log level to printk in print_irq_desc wudaemon
@ 2022-03-15 13:58 ` Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2022-03-15 13:58 UTC (permalink / raw)
To: wudaemon; +Cc: linux-kernel
On Sun, Mar 13 2022 at 03:44, wudaemon@163.com wrote:
> add KERN_DEBUG level for debuging purpose, use checkpatch.pl check prompt:
... and then ignore the checkpatch.pl output vs. the patch which "fixes"
the problems:
WARNING: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...
#29: FILE: kernel/irq/debug.h:6:
+#define ___P(f) do {if (desc->status_use_accessors & f) printk(KERN_DEBUG "%14s set\n", #f); } while (0)
and 6 more of the same...
> Signed-off-by: wudaemon <wudaemon@163.com>
Please read Documentation/process/submitting-patches.rst especially the
chapter about the Developer's Certification of Origin:
"... using your real name (sorry, no pseudonyms or anonymous contributions.)"
Thanks,
tglx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-15 13:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-13 3:44 [RESEND] genirq: add log level to printk in print_irq_desc wudaemon
2022-03-15 13:58 ` Thomas Gleixner
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).