summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uhid.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/usb/uhid.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/usb/uhid.c')
-rw-r--r--sys/dev/usb/uhid.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 440677deeaf..9cadd22ad35 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.74 2019/12/19 12:04:38 reyk Exp $ */
+/* $OpenBSD: uhid.c,v 1.75 2019/12/31 13:48:31 visa Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -456,11 +456,19 @@ filt_uhidread(struct knote *kn, long hint)
return (kn->kn_data > 0);
}
-struct filterops uhidread_filtops =
- { 1, NULL, filt_uhidrdetach, filt_uhidread };
+const struct filterops uhidread_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_uhidrdetach,
+ .f_event = filt_uhidread,
+};
-struct filterops uhid_seltrue_filtops =
- { 1, NULL, filt_uhidrdetach, filt_seltrue };
+const struct filterops uhid_seltrue_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_uhidrdetach,
+ .f_event = filt_seltrue,
+};
int
uhidkqfilter(dev_t dev, struct knote *kn)