Commit ebce3d3d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] m68knommu: cleanup ColdFire/5307 ints code

From: <gerg@snapgear.com>

. add type field to printk calls (from kernel janitors)
. there is no loop in show_interrupts(), don't use continue
parent 57f5029b
...@@ -47,7 +47,7 @@ unsigned int local_irq_count[NR_CPUS]; ...@@ -47,7 +47,7 @@ unsigned int local_irq_count[NR_CPUS];
static irqreturn_t default_irq_handler(int irq, void *ptr, struct pt_regs *regs) static irqreturn_t default_irq_handler(int irq, void *ptr, struct pt_regs *regs)
{ {
#if 1 #if 1
printk("%s(%d): default irq handler vec=%d [0x%x]\n", printk(KERN_INFO "%s(%d): default irq handler vec=%d [0x%x]\n",
__FILE__, __LINE__, irq, irq); __FILE__, __LINE__, irq, irq);
#endif #endif
return(IRQ_HANDLED); return(IRQ_HANDLED);
...@@ -94,7 +94,7 @@ irq_node_t *new_irq_node(void) ...@@ -94,7 +94,7 @@ irq_node_t *new_irq_node(void)
if (!node->handler) if (!node->handler)
return node; return node;
printk("new_irq_node: out of nodes\n"); printk(KERN_INFO "new_irq_node: out of nodes\n");
return NULL; return NULL;
} }
...@@ -106,19 +106,19 @@ int request_irq( ...@@ -106,19 +106,19 @@ int request_irq(
void *dev_id) void *dev_id)
{ {
if (irq < 0 || irq >= NR_IRQS) { if (irq < 0 || irq >= NR_IRQS) {
printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__, printk(KERN_WARNING "%s: Incorrect IRQ %d from %s\n", __FUNCTION__,
irq, devname); irq, devname);
return -ENXIO; return -ENXIO;
} }
if (!(irq_list[irq].flags & IRQ_FLG_STD)) { if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
if (irq_list[irq].flags & IRQ_FLG_LOCK) { if (irq_list[irq].flags & IRQ_FLG_LOCK) {
printk("%s: IRQ %d from %s is not replaceable\n", printk(KERN_WARNING "%s: IRQ %d from %s is not replaceable\n",
__FUNCTION__, irq, irq_list[irq].devname); __FUNCTION__, irq, irq_list[irq].devname);
return -EBUSY; return -EBUSY;
} }
if (flags & IRQ_FLG_REPLACE) { if (flags & IRQ_FLG_REPLACE) {
printk("%s: %s can't replace IRQ %d from %s\n", printk(KERN_WARNING "%s: %s can't replace IRQ %d from %s\n",
__FUNCTION__, devname, irq, irq_list[irq].devname); __FUNCTION__, devname, irq, irq_list[irq].devname);
return -EBUSY; return -EBUSY;
} }
...@@ -142,12 +142,12 @@ EXPORT_SYMBOL(request_irq); ...@@ -142,12 +142,12 @@ EXPORT_SYMBOL(request_irq);
void free_irq(unsigned int irq, void *dev_id) void free_irq(unsigned int irq, void *dev_id)
{ {
if (irq >= NR_IRQS) { if (irq >= NR_IRQS) {
printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq); printk(KERN_WARNING "%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
return; return;
} }
if (irq_list[irq].dev_id != dev_id) if (irq_list[irq].dev_id != dev_id)
printk("%s: Removing probably wrong IRQ %d from %s\n", printk(KERN_WARNING "%s: Removing probably wrong IRQ %d from %s\n",
__FUNCTION__, irq, irq_list[irq].devname); __FUNCTION__, irq, irq_list[irq].devname);
if (irq_list[irq].flags & IRQ_FLG_FAST) { if (irq_list[irq].flags & IRQ_FLG_FAST) {
...@@ -173,7 +173,7 @@ int sys_request_irq(unsigned int irq, ...@@ -173,7 +173,7 @@ int sys_request_irq(unsigned int irq,
unsigned long flags, const char *devname, void *dev_id) unsigned long flags, const char *devname, void *dev_id)
{ {
if (irq > IRQ7) { if (irq > IRQ7) {
printk("%s: Incorrect IRQ %d from %s\n", printk(KERN_WARNING "%s: Incorrect IRQ %d from %s\n",
__FUNCTION__, irq, devname); __FUNCTION__, irq, devname);
return -ENXIO; return -ENXIO;
} }
...@@ -181,12 +181,12 @@ int sys_request_irq(unsigned int irq, ...@@ -181,12 +181,12 @@ int sys_request_irq(unsigned int irq,
#if 0 #if 0
if (!(irq_list[irq].flags & IRQ_FLG_STD)) { if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
if (irq_list[irq].flags & IRQ_FLG_LOCK) { if (irq_list[irq].flags & IRQ_FLG_LOCK) {
printk("%s: IRQ %d from %s is not replaceable\n", printk(KERN_WARNING "%s: IRQ %d from %s is not replaceable\n",
__FUNCTION__, irq, irq_list[irq].devname); __FUNCTION__, irq, irq_list[irq].devname);
return -EBUSY; return -EBUSY;
} }
if (!(flags & IRQ_FLG_REPLACE)) { if (!(flags & IRQ_FLG_REPLACE)) {
printk("%s: %s can't replace IRQ %d from %s\n", printk(KERN_WARNING "%s: %s can't replace IRQ %d from %s\n",
__FUNCTION__, devname, irq, irq_list[irq].devname); __FUNCTION__, devname, irq, irq_list[irq].devname);
return -EBUSY; return -EBUSY;
} }
...@@ -203,12 +203,12 @@ int sys_request_irq(unsigned int irq, ...@@ -203,12 +203,12 @@ int sys_request_irq(unsigned int irq,
void sys_free_irq(unsigned int irq, void *dev_id) void sys_free_irq(unsigned int irq, void *dev_id)
{ {
if (irq > IRQ7) { if (irq > IRQ7) {
printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq); printk(KERN_WARNING "%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
return; return;
} }
if (irq_list[irq].dev_id != dev_id) if (irq_list[irq].dev_id != dev_id)
printk("%s: Removing probably wrong IRQ %d from %s\n", printk(KERN_WARNING "%s: Removing probably wrong IRQ %d from %s\n",
__FUNCTION__, irq, irq_list[irq].devname); __FUNCTION__, irq, irq_list[irq].devname);
irq_list[irq].handler = (*mach_default_handler)[irq]; irq_list[irq].handler = (*mach_default_handler)[irq];
...@@ -257,9 +257,7 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -257,9 +257,7 @@ int show_interrupts(struct seq_file *p, void *v)
int i = *(loff_t *) v; int i = *(loff_t *) v;
if (i < NR_IRQS) { if (i < NR_IRQS) {
if (irq_list[i].flags & IRQ_FLG_STD) if (! (irq_list[i].flags & IRQ_FLG_STD)) {
continue;
seq_printf(p, "%3d: %10u ", i, seq_printf(p, "%3d: %10u ", i,
(i ? kstat_cpu(0).irqs[i] : num_spurious)); (i ? kstat_cpu(0).irqs[i] : num_spurious));
if (irq_list[i].flags & IRQ_FLG_LOCK) if (irq_list[i].flags & IRQ_FLG_LOCK)
...@@ -268,10 +266,11 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -268,10 +266,11 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, " "); seq_printf(p, " ");
seq_printf(p, "%s\n", irq_list[i].devname); seq_printf(p, "%s\n", irq_list[i].devname);
} }
}
if (i == NR_IRQS && mach_get_irq_list) if (i == NR_IRQS && mach_get_irq_list)
mach_get_irq_list(p, v); mach_get_irq_list(p, v);
return(0); return 0;
} }
void init_irq_proc(void) void init_irq_proc(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment