Skip to content

Commit 8bd76cd

Browse files
committed
kern/intr: use swi_add() string as name if no handler
If swi_add() is used to initialize an event without adding a handler, the name should be used as the device name. Otherwise there can be mysterious unnamed events lying around.
1 parent 236d9bd commit 8bd76cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sys/kern/kern_intr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,9 @@ swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
10891089
return (EINVAL);
10901090
} else {
10911091
error = intr_event_create(&ie, NULL, ieflags, 0,
1092-
NULL, NULL, NULL, swi_assign_cpu, "swi%d:", pri);
1092+
NULL, NULL, NULL, swi_assign_cpu,
1093+
handler == NULL && name != NULL ? "%2$s swi%1$d:" : "swi%d",
1094+
pri);
10931095
if (error)
10941096
return (error);
10951097
if (eventp != NULL)

0 commit comments

Comments
 (0)