naddy@ pointed that the alpha kernel fails to build now because of my
evcount simplification diff. Previously two of its intr_disestablish
functions used the ec_parent field to detect whether or not the
evcount was attached.
As far as I can tell from following back the code, we always attach
the evcounts anyway, so we might as well just make that clear in the
code.
ok?
(I'm told this only affects antique, miod-class hardware, so I'm
inclined to just commit to fix the builds for alpha, and later fix any
drivers that turn out to not provide a name.)
Index: tc_3000_300.c
===================================================================
RCS file: /cvs/src/sys/arch/alpha/tc/tc_3000_300.c,v
retrieving revision 1.15
diff -u -p -r1.15 tc_3000_300.c
--- tc_3000_300.c 20 Sep 2010 06:33:46 -0000 1.15
+++ tc_3000_300.c 22 Sep 2010 11:10:48 -0000
@@ -119,6 +119,8 @@ tc_3000_300_intr_establish(tcadev, cooki
volatile u_int32_t *imskp;
u_long dev = (u_long)cookie;
+ KASSERT(name != NULL);
+
#ifdef DIAGNOSTIC
/* XXX bounds-check cookie. */
#endif
@@ -128,9 +130,7 @@ tc_3000_300_intr_establish(tcadev, cooki
tc_3000_300_intr[dev].tci_func = func;
tc_3000_300_intr[dev].tci_arg = arg;
- if (name != NULL)
- evcount_attach(&tc_3000_300_intr[dev].tci_count,
- name, NULL);
+ evcount_attach(&tc_3000_300_intr[dev].tci_count, name, NULL);
imskp = (volatile u_int32_t *)(DEC_3000_300_IOASIC_ADDR + IOASIC_IMSK);
switch (dev) {
@@ -177,8 +177,7 @@ tc_3000_300_intr_disestablish(tcadev, co
tc_3000_300_intr[dev].tci_func = tc_3000_300_intrnull;
tc_3000_300_intr[dev].tci_arg = (void *)dev;
- if (tc_3000_300_intr[dev].tci_count.ec_parent != NULL)
- evcount_detach(&tc_3000_300_intr[dev].tci_count);
+ evcount_detach(&tc_3000_300_intr[dev].tci_count);
}
int
Index: tc_3000_500.c
===================================================================
RCS file: /cvs/src/sys/arch/alpha/tc/tc_3000_500.c,v
retrieving revision 1.16
diff -u -p -r1.16 tc_3000_500.c
--- tc_3000_500.c 20 Sep 2010 06:33:46 -0000 1.16
+++ tc_3000_500.c 22 Sep 2010 11:10:48 -0000
@@ -136,6 +136,8 @@ tc_3000_500_intr_establish(tcadev, cooki
{
u_long dev = (u_long)cookie;
+ KASSERT(name != NULL);
+
#ifdef DIAGNOSTIC
/* XXX bounds-check cookie. */
#endif
@@ -145,9 +147,7 @@ tc_3000_500_intr_establish(tcadev, cooki
tc_3000_500_intr[dev].tci_func = func;
tc_3000_500_intr[dev].tci_arg = arg;
- if (name != NULL)
- evcount_attach(&tc_3000_500_intr[dev].tci_count,
- name, NULL);
+ evcount_attach(&tc_3000_500_intr[dev].tci_count, name, NULL);
tc_3000_500_imask &= ~tc_3000_500_intrbits[dev];
*(volatile u_int32_t *)TC_3000_500_IMR_WRITE = tc_3000_500_imask;
@@ -175,8 +175,7 @@ tc_3000_500_intr_disestablish(tcadev, co
tc_3000_500_intr[dev].tci_func = tc_3000_500_intrnull;
tc_3000_500_intr[dev].tci_arg = (void *)dev;
- if (tc_3000_500_intr[dev].tci_count.ec_parent != NULL)
- evcount_detach(&tc_3000_500_intr[dev].tci_count);
+ evcount_detach(&tc_3000_500_intr[dev].tci_count);
}
int