Skip to content

Commit 261c40c

Browse files
fenrus75torvalds
authored andcommitted
use WARN() in kernel/irq/chip.c
Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes part of the warning section for better reporting/collection. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4c8573e commit 261c40c

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎kernel/irq/chip.c‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ void dynamic_irq_init(unsigned int irq)
2828
unsigned long flags;
2929

3030
if (irq >= NR_IRQS) {
31-
printk(KERN_ERR "Trying to initialize invalid IRQ%d\n", irq);
32-
WARN_ON(1);
31+
WARN(1, KERN_ERR "Trying to initialize invalid IRQ%d\n", irq);
3332
return;
3433
}
3534

@@ -62,18 +61,16 @@ void dynamic_irq_cleanup(unsigned int irq)
6261
unsigned long flags;
6362

6463
if (irq >= NR_IRQS) {
65-
printk(KERN_ERR "Trying to cleanup invalid IRQ%d\n", irq);
66-
WARN_ON(1);
64+
WARN(1, KERN_ERR "Trying to cleanup invalid IRQ%d\n", irq);
6765
return;
6866
}
6967

7068
desc = irq_desc + irq;
7169
spin_lock_irqsave(&desc->lock, flags);
7270
if (desc->action) {
7371
spin_unlock_irqrestore(&desc->lock, flags);
74-
printk(KERN_ERR "Destroying IRQ%d without calling free_irq\n",
72+
WARN(1, KERN_ERR "Destroying IRQ%d without calling free_irq\n",
7573
irq);
76-
WARN_ON(1);
7774
return;
7875
}
7976
desc->msi_desc = NULL;
@@ -96,8 +93,7 @@ int set_irq_chip(unsigned int irq, struct irq_chip *chip)
9693
unsigned long flags;
9794

9895
if (irq >= NR_IRQS) {
99-
printk(KERN_ERR "Trying to install chip for IRQ%d\n", irq);
100-
WARN_ON(1);
96+
WARN(1, KERN_ERR "Trying to install chip for IRQ%d\n", irq);
10197
return -EINVAL;
10298
}
10399

0 commit comments

Comments
 (0)