ANSIify and minor KNF.

This commit is contained in:
toshii 2001-05-18 14:51:40 +00:00
parent 6ccfedb598
commit a90c8b6620

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_irqhandler.c,v 1.4 2001/05/14 16:19:31 toshii Exp $ */
/* $NetBSD: sa11x0_irqhandler.c,v 1.5 2001/05/18 14:51:40 toshii Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@ -158,13 +158,13 @@ intr_calculatemasks()
* Enforce a hierarchy that gives slow devices a better chance at not
* dropping data.
*/
for(level = NIPL - 1; level > 0; level--)
for (level = NIPL - 1; level > 0; level--)
imask[level - 1] |= imask[level];
/*
* Calculate irqblock[], which emulates hardware interrupt levels.
*/
for(irq = 0; irq < ICU_LEN; irq++) {
for (irq = 0; irq < ICU_LEN; irq++) {
int irqs = 1 << irq;
for (q = irqhandlers[irq]; q; q = q->ih_next)
irqs |= ~imask[q->ih_level];
@ -182,13 +182,8 @@ sa11x0_intr_evcnt(sa11x0_chipset_tag_t ic, int irq)
}
void *
sa11x0_intr_establish(ic, irq, type, level, ih_fun, ih_arg)
sa11x0_chipset_tag_t ic;
int irq;
int type;
int level;
int (*ih_fun)(void *);
void *ih_arg;
sa11x0_intr_establish(sa11x0_chipset_tag_t ic, int irq, int type, int level,
int (*ih_fun)(void *), void *ih_arg)
{
int saved_cpsr;
struct irqhandler **p, *q, *ih;
@ -251,9 +246,7 @@ sa11x0_intr_establish(ic, irq, type, level, ih_fun, ih_arg)
* Deregister an interrupt handler.
*/
void
sa11x0_intr_disestablish(ic, arg)
sa11x0_chipset_tag_t ic;
void *arg;
sa11x0_intr_disestablish(sa11x0_chipset_tag_t ic, void *arg)
{
struct irqhandler *ih = arg;
int irq = ih->ih_irq;
@ -269,7 +262,8 @@ sa11x0_intr_disestablish(ic, arg)
* Remove the handler from the chain.
* This is O(n^2), too.
*/
for (p = &irqhandlers[irq]; (q = *p) != NULL && q != ih; p = &q->ih_next)
for (p = &irqhandlers[irq]; (q = *p) != NULL && q != ih;
p = &q->ih_next)
;
if (q)
*p = q->ih_next;
@ -290,12 +284,14 @@ sa11x0_intr_disestablish(ic, arg)
void
stray_irqhandler(void *p)
{
printf("stray interrupt\n");
}
int
fakeintr(void *p)
{
return 0;
}
@ -306,10 +302,10 @@ dumpirqhandlers()
int irq;
struct irqhandler *p;
for(irq = 0; irq < ICU_LEN; irq++) {
for (irq = 0; irq < ICU_LEN; irq++) {
printf("irq %d:", irq);
p = irqhandlers[irq];
for(; p; p = p->ih_next)
for (; p; p = p->ih_next)
printf("ih_func: 0x%lx, ", (unsigned long)p->ih_func);
printf("\n");
}