Date: Mon, 4 Dec 2006 16:02:50 GMT From: Paolo Pisati <piso@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 111012 for review Message-ID: <200612041602.kB4G2ohr051240@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111012 Change 111012 by piso@piso_newluxor on 2006/12/04 16:02:38 Try to reduce diff against HEAD. Affected files ... .. //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#12 edit Differences ... ==== //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#12 (text+ko) ==== @@ -111,26 +111,26 @@ } static void -intrcnt_updatename(struct ppc_intr_handler *ppc_ih) +intrcnt_updatename(struct ppc_intr_handler *ih) { - intrcnt_setname(ppc_ih->ih_event->ie_fullname, ppc_ih->ih_index); + intrcnt_setname(ih->ih_event->ie_fullname, ih->ih_index); } static void -intrcnt_register(struct ppc_intr_handler *ppc_ih) +intrcnt_register(struct ppc_intr_handler *ih) { char straystr[MAXCOMLEN + 1]; - KASSERT(ppc_ih->ih_event != NULL, + KASSERT(ih->ih_event != NULL, ("%s: ppc_intr_handler with no event", __func__)); - ppc_ih->ih_index = intrcnt_index; + ih->ih_index = intrcnt_index; intrcnt_index += 2; - snprintf(straystr, MAXCOMLEN + 1, "stray irq%d", ppc_ih->ih_irq); - intrcnt_updatename(ppc_ih); - ppc_ih->ih_count = &intrcnt[ppc_ih->ih_index]; - intrcnt_setname(straystr, ppc_ih->ih_index + 1); - ppc_ih->ih_straycount = &intrcnt[ppc_ih->ih_index + 1]; + snprintf(straystr, MAXCOMLEN + 1, "stray irq%d", ih->ih_irq); + intrcnt_updatename(ih); + ih->ih_count = &intrcnt[ih->ih_index]; + intrcnt_setname(straystr, ih->ih_index + 1); + ih->ih_straycount = &intrcnt[ih->ih_index + 1]; } void @@ -143,7 +143,6 @@ if (intr_handlers != NULL) panic("intr_init: interrupts intialized twice\n"); - intr_nirq = nirq; intr_handlers = malloc(nirq * sizeof(struct ppc_intr_handler), M_INTR, M_NOWAIT|M_ZERO); @@ -175,7 +174,7 @@ inthand_add(const char *name, u_int irq, int (*filter)(void *), void (*handler)(void *), void *arg, int flags, void **cookiep) { - struct ppc_intr_handler *ppc_ih; + struct ppc_intr_handler *ih; struct intr_event *event, *orphan; int error = 0; @@ -183,9 +182,9 @@ * Work around a race where more than one CPU may be registering * handlers on the same IRQ at the same time. */ - ppc_ih = &intr_handlers[irq]; + ih = &intr_handlers[irq]; mtx_lock_spin(&intr_table_lock); - event = ppc_ih->ih_event; + event = ih->ih_event; mtx_unlock_spin(&intr_table_lock); if (event == NULL) { error = intr_event_create(&event, (void *)irq, 0, @@ -195,12 +194,12 @@ mtx_lock_spin(&intr_table_lock); - if (ppc_ih->ih_event == NULL) { - ppc_ih->ih_event = event; + if (ih->ih_event == NULL) { + ih->ih_event = event; mtx_unlock_spin(&intr_table_lock); } else { orphan = event; - event = ppc_ih->ih_event; + event = ih->ih_event; mtx_unlock_spin(&intr_table_lock); intr_event_destroy(orphan); } @@ -212,7 +211,7 @@ if (error) return (error); - intrcnt_register(ppc_ih); + intrcnt_register(ih); return (0); } @@ -221,16 +220,17 @@ inthand_remove(u_int irq, void *cookie) { - return(intr_event_remove_handler(cookie)); + return (intr_event_remove_handler(cookie)); } /* Stray detection MD code */ static struct intr_event * -walk_intr_ppc(void) { +walk_intr_ppc(void) +{ struct ppc_intr_handler *ppc; static int i = 0; - for (; i<intr_nirq; ) { + for (; i < intr_nirq; ) { int j = i++; ppc = &intr_handlers[j]; if (ppc != NULL && ppc->ih_event != NULL) @@ -286,15 +286,15 @@ static void intr_stray_handler(void *cookie) { - struct ppc_intr_handler *ppc_ih = cookie; + struct ppc_intr_handler *ih = cookie; - if (*intr_handlers[ppc_ih->ih_irq].ih_straycount < MAX_STRAY_LOG) { - printf("stray irq %d\n", ppc_ih->ih_irq); + if (*intr_handlers[ih->ih_irq].ih_straycount < MAX_STRAY_LOG) { + printf("stray irq %d\n", ih->ih_irq); - atomic_add_long(intr_handlers[ppc_ih->ih_irq].ih_straycount, 1); - if (*intr_handlers[ppc_ih->ih_irq].ih_straycount >= MAX_STRAY_LOG) + atomic_add_long(intr_handlers[ih->ih_irq].ih_straycount, 1); + if (*intr_handlers[ih->ih_irq].ih_straycount >= MAX_STRAY_LOG) printf("got %d stray irq %d's: not logging anymore\n", - MAX_STRAY_LOG, ppc_ih->ih_irq); + MAX_STRAY_LOG, ih->ih_irq); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612041602.kB4G2ohr051240>