Skip to content

Commit

Permalink
kern/intr: use swi_add() string as name if no handler
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ehem committed Oct 25, 2024
1 parent c8cc59c commit 68d3cbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sys/kern/kern_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,9 @@ swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
return (EINVAL);
} else {
error = intr_event_create(&ie, NULL, ieflags, 0,
NULL, NULL, NULL, swi_assign_cpu, "swi%d:", pri);
NULL, NULL, NULL, swi_assign_cpu,
handler == NULL && name != NULL ? "%2$s swi%1$d:" : "swi%d",
pri, name);
if (error)
return (error);
if (eventp != NULL)
Expand Down

0 comments on commit 68d3cbb

Please sign in to comment.