summaryrefslogtreecommitdiff
path: root/sys/dev/hotplug.c
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2019-12-31 13:48:33 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2019-12-31 13:48:33 +0000
commite1d46407d705bb612ebbeebddbe85779b52a42a5 (patch)
treeb128da7e2130d5eeae1d5918b1cc8692523d852b /sys/dev/hotplug.c
parenta2985aa5fb51f9899868daaf2cde0dfa5a0f449f (diff)
Use C99 designated initializers with struct filterops. In addition,
make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
Diffstat (limited to 'sys/dev/hotplug.c')
-rw-r--r--sys/dev/hotplug.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/hotplug.c b/sys/dev/hotplug.c
index 772c4e3a4c1..8f6042cbd9d 100644
--- a/sys/dev/hotplug.c
+++ b/sys/dev/hotplug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hotplug.c,v 1.17 2019/12/31 10:05:32 mpi Exp $ */
+/* $OpenBSD: hotplug.c,v 1.18 2019/12/31 13:48:31 visa Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -38,8 +38,12 @@ static struct selinfo hotplug_sel;
void filt_hotplugrdetach(struct knote *);
int filt_hotplugread(struct knote *, long);
-struct filterops hotplugread_filtops =
- { 1, NULL, filt_hotplugrdetach, filt_hotplugread};
+const struct filterops hotplugread_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_hotplugrdetach,
+ .f_event = filt_hotplugread,
+};
#define EVQUEUE_NEXT(p) (p == HOTPLUG_MAXEVENTS - 1 ? 0 : p + 1)