From e1d46407d705bb612ebbeebddbe85779b52a42a5 Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Tue, 31 Dec 2019 13:48:33 +0000 Subject: 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@ --- sys/dev/hotplug.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys/dev/hotplug.c') 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 * @@ -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) -- cgit v1.2.3