summaryrefslogtreecommitdiff
path: root/sys/arch
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/arch
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/arch')
-rw-r--r--sys/arch/arm64/dev/apm.c10
-rw-r--r--sys/arch/i386/i386/apm.c9
-rw-r--r--sys/arch/loongson/dev/apm.c10
-rw-r--r--sys/arch/macppc/dev/apm.c10
4 files changed, 27 insertions, 12 deletions
diff --git a/sys/arch/arm64/dev/apm.c b/sys/arch/arm64/dev/apm.c
index 48fee1144af..85b2ea7c75a 100644
--- a/sys/arch/arm64/dev/apm.c
+++ b/sys/arch/arm64/dev/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.1 2019/01/23 09:57:36 phessler Exp $ */
+/* $OpenBSD: apm.c,v 1.2 2019/12/31 13:48:31 visa Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -87,8 +87,12 @@ int filt_apmread(struct knote *kn, long hint);
int apmkqfilter(dev_t dev, struct knote *kn);
int apm_getdefaultinfo(struct apm_power_info *);
-struct filterops apmread_filtops =
- { 1, NULL, filt_apmrdetach, filt_apmread};
+const struct filterops apmread_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_apmrdetach,
+ .f_event = filt_apmread,
+};
int (*get_apminfo)(struct apm_power_info *) = apm_getdefaultinfo;
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index aafcffdd3ac..99a1c2daf6b 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.120 2019/10/12 15:56:17 cheloha Exp $ */
+/* $OpenBSD: apm.c,v 1.121 2019/12/31 13:48:31 visa Exp $ */
/*-
* Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
@@ -103,8 +103,11 @@ struct cfattach apm_ca = {
void filt_apmrdetach(struct knote *kn);
int filt_apmread(struct knote *kn, long hint);
-struct filterops apmread_filtops = {
- 1, NULL, filt_apmrdetach, filt_apmread
+const struct filterops apmread_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_apmrdetach,
+ .f_event = filt_apmread,
};
#define APM_RESUME_HOLDOFF 3
diff --git a/sys/arch/loongson/dev/apm.c b/sys/arch/loongson/dev/apm.c
index a6736d69c51..f768c63cced 100644
--- a/sys/arch/loongson/dev/apm.c
+++ b/sys/arch/loongson/dev/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.32 2017/03/27 18:24:08 deraadt Exp $ */
+/* $OpenBSD: apm.c,v 1.33 2019/12/31 13:48:31 visa Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -93,8 +93,12 @@ int apm_getdefaultinfo(struct apm_power_info *);
int apm_suspend(int state);
-struct filterops apmread_filtops =
- { 1, NULL, filt_apmrdetach, filt_apmread};
+const struct filterops apmread_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_apmrdetach,
+ .f_event = filt_apmread,
+};
int (*get_apminfo)(struct apm_power_info *) = apm_getdefaultinfo;
diff --git a/sys/arch/macppc/dev/apm.c b/sys/arch/macppc/dev/apm.c
index 92caa63e764..86eb7dc58fd 100644
--- a/sys/arch/macppc/dev/apm.c
+++ b/sys/arch/macppc/dev/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.19 2016/12/05 15:04:15 fcambus Exp $ */
+/* $OpenBSD: apm.c,v 1.20 2019/12/31 13:48:31 visa Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -85,8 +85,12 @@ void filt_apmrdetach(struct knote *kn);
int filt_apmread(struct knote *kn, long hint);
int apmkqfilter(dev_t dev, struct knote *kn);
-struct filterops apmread_filtops =
- { 1, NULL, filt_apmrdetach, filt_apmread};
+const struct filterops apmread_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_apmrdetach,
+ .f_event = filt_apmread,
+};
/*
* Flags to control kernel display