Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Use C99 initializer for filterops



details:   https://anonhg.NetBSD.org/src/rev/187040438d0a
branches:  trunk
changeset: 357065:187040438d0a
user:      maya <maya%NetBSD.org@localhost>
date:      Wed Oct 25 08:12:37 2017 +0000

description:
Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
-       { a, b, c, d
+       {
+       .f_isfd = a,
+       .f_attach = b,
+       .f_detach = c,
+       .f_event = d,
};

diffstat:

 sys/arch/amiga/dev/event.c            |  12 +++++--
 sys/arch/arc/dev/opms.c               |  12 +++++--
 sys/arch/atari/dev/event.c            |  12 +++++--
 sys/arch/landisk/dev/button.c         |  20 ++++++++++----
 sys/arch/mac68k/dev/aed.c             |  20 ++++++++++----
 sys/arch/macppc/dev/aed.c             |  20 ++++++++++----
 sys/arch/sandpoint/sandpoint/satmgr.c |   9 ++++--
 sys/arch/shark/shark/opms.c           |  12 +++++--
 sys/arch/sparc/dev/tctrl.c            |  12 +++++--
 sys/arch/x68k/dev/event.c             |  12 +++++--
 sys/coda/coda_psdev.c                 |  12 +++++--
 sys/dev/apm/apm.c                     |  12 +++++--
 sys/dev/audio.c                       |  20 ++++++++++----
 sys/dev/hpc/apm/apmdev.c              |  12 +++++--
 sys/dev/ir/irframe_tty.c              |  21 +++++++++++----
 sys/dev/isa/satlink.c                 |  20 ++++++++++----
 sys/dev/midi.c                        |  20 ++++++++++----
 sys/dev/pci/oboe.c                    |  21 +++++++++++----
 sys/dev/putter/putter.c               |  12 +++++--
 sys/dev/qbus/qd.c                     |  22 +++++++++++-----
 sys/dev/sbus/bpp.c                    |  20 ++++++++++----
 sys/dev/scsipi/ch.c                   |  20 ++++++++++----
 sys/dev/sequencer.c                   |  20 ++++++++++----
 sys/dev/sun/event.c                   |  12 +++++--
 sys/dev/sysmon/sysmon_power.c         |  20 ++++++++++----
 sys/dev/usb/udsir.c                   |  21 +++++++++++----
 sys/dev/usb/ugen.c                    |  36 +++++++++++++++++++-------
 sys/dev/usb/uhid.c                    |  20 ++++++++++----
 sys/dev/usb/uirda.c                   |  21 +++++++++++----
 sys/dev/usb/usb.c                     |  12 +++++--
 sys/dev/usb/uscanner.c                |  12 +++++--
 sys/dev/usb/ustir.c                   |  21 +++++++++++----
 sys/dev/wscons/wsevent.c              |  12 +++++--
 sys/external/bsd/drm2/drm/drm_drv.c   |  12 +++++--
 sys/fs/smbfs/smbfs_kq.c               |  21 +++++++++++----
 sys/kern/kern_event.c                 |  47 ++++++++++++++++++++++++++--------
 sys/kern/kern_sig.c                   |   9 ++++--
 sys/kern/subr_cprng.c                 |  12 +++++--
 sys/kern/subr_log.c                   |  12 +++++--
 sys/kern/sys_pipe.c                   |  21 +++++++++++----
 sys/kern/tty.c                        |  21 +++++++++++----
 sys/kern/tty_pty.c                    |  21 +++++++++++----
 sys/kern/uipc_socket.c                |  30 ++++++++++++++++-----
 sys/miscfs/fifofs/fifo_vnops.c        |  21 +++++++++++----
 sys/miscfs/genfs/genfs_vnops.c        |  30 ++++++++++++++++-----
 sys/net/bpf.c                         |  12 +++++--
 sys/net/if_tun.c                      |  20 ++++++++++----
 sys/netisdn/i4b_i4bdrv.c              |  20 ++++++++++----
 sys/netisdn/i4b_rbch.c                |  20 ++++++++++----
 sys/netisdn/i4b_tel.c                 |  36 +++++++++++++++++++-------
 sys/nfs/nfs_kq.c                      |  21 +++++++++++----
 51 files changed, 663 insertions(+), 283 deletions(-)

diffs (truncated from 2086 to 300 lines):

diff -r 2bf803feab23 -r 187040438d0a sys/arch/amiga/dev/event.c
--- a/sys/arch/amiga/dev/event.c        Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/amiga/dev/event.c        Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event.c,v 1.13 2008/03/01 14:16:49 rmind Exp $ */
+/*     $NetBSD: event.c,v 1.14 2017/10/25 08:12:37 maya Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: event.c,v 1.13 2008/03/01 14:16:49 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: event.c,v 1.14 2017/10/25 08:12:37 maya Exp $");
 
 /*
  * Internal `Firm_event' interface for the keyboard and mouse drivers.
@@ -190,8 +190,12 @@
        return (1);
 }
 
-static const struct filterops ev_filtops =
-       { 1, NULL, filt_evrdetach, filt_evread };
+static const struct filterops ev_filtops = {
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_evrdetach,
+       .f_event = filt_evread,
+};
 
 int
 ev_kqfilter(struct evvar *ev, struct knote *kn)
diff -r 2bf803feab23 -r 187040438d0a sys/arch/arc/dev/opms.c
--- a/sys/arch/arc/dev/opms.c   Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/arc/dev/opms.c   Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: opms.c,v 1.21 2014/07/25 08:10:31 dholland Exp $       */
+/*     $NetBSD: opms.c,v 1.22 2017/10/25 08:12:37 maya Exp $   */
 /*     $OpenBSD: pccons.c,v 1.22 1999/01/30 22:39:37 imp Exp $ */
 /*     NetBSD: pms.c,v 1.21 1995/04/18 02:25:18 mycroft Exp    */
 
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.21 2014/07/25 08:10:31 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.22 2017/10/25 08:12:37 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -472,8 +472,12 @@
        return kn->kn_data > 0;
 }
 
-static const struct filterops opmsread_filtops =
-       { 1, NULL, filt_opmsrdetach, filt_opmsread };
+static const struct filterops opmsread_filtops = {
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_opmsrdetach,
+       .f_event = filt_opmsread,
+};
 
 int
 opmskqfilter(dev_t dev, struct knote *kn)
diff -r 2bf803feab23 -r 187040438d0a sys/arch/atari/dev/event.c
--- a/sys/arch/atari/dev/event.c        Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/atari/dev/event.c        Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event.c,v 1.13 2009/03/14 15:36:03 dsl Exp $   */
+/*     $NetBSD: event.c,v 1.14 2017/10/25 08:12:37 maya Exp $  */
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: event.c,v 1.13 2009/03/14 15:36:03 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: event.c,v 1.14 2017/10/25 08:12:37 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/fcntl.h>
@@ -189,8 +189,12 @@
        return (1);
 }
 
-static const struct filterops ev_filtops =
-       { 1, NULL, filt_evrdetach, filt_evread };
+static const struct filterops ev_filtops = {
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_evrdetach,
+       .f_event = filt_evread,
+};
 
 int
 ev_kqfilter(struct evvar *ev, struct knote *kn)
diff -r 2bf803feab23 -r 187040438d0a sys/arch/landisk/dev/button.c
--- a/sys/arch/landisk/dev/button.c     Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/landisk/dev/button.c     Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: button.c,v 1.8 2014/07/25 08:10:33 dholland Exp $      */
+/*     $NetBSD: button.c,v 1.9 2017/10/25 08:12:37 maya Exp $  */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: button.c,v 1.8 2014/07/25 08:10:33 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: button.c,v 1.9 2017/10/25 08:12:37 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -312,11 +312,19 @@
        return (kn->kn_data > 0);
 }
 
-static const struct filterops btn_read_filtops =
-    { 1, NULL, filt_btn_rdetach, filt_btn_read };
+static const struct filterops btn_read_filtops = {
+    .f_isfd = 1,
+    .f_attach = NULL,
+    .f_detach = filt_btn_rdetach,
+    .f_event = filt_btn_read,
+};
 
-static const struct filterops btn_write_filtops =
-    { 1, NULL, filt_btn_rdetach, filt_seltrue };
+static const struct filterops btn_write_filtops = {
+    .f_isfd = 1,
+    .f_attach = NULL,
+    .f_detach = filt_btn_rdetach,
+    .f_event = filt_seltrue,
+};
 
 int
 btnkqfilter(dev_t dev, struct knote *kn)
diff -r 2bf803feab23 -r 187040438d0a sys/arch/mac68k/dev/aed.c
--- a/sys/arch/mac68k/dev/aed.c Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/mac68k/dev/aed.c Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aed.c,v 1.33 2014/07/25 08:10:33 dholland Exp $        */
+/*     $NetBSD: aed.c,v 1.34 2017/10/25 08:12:37 maya Exp $    */
 
 /*
  * Copyright (C) 1994  Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.33 2014/07/25 08:10:33 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.34 2017/10/25 08:12:37 maya Exp $");
 
 #include "opt_adb.h"
 
@@ -597,11 +597,19 @@
        return (kn->kn_data > 0);
 }
 
-static const struct filterops aedread_filtops =
-       { 1, NULL, filt_aedrdetach, filt_aedread };
+static const struct filterops aedread_filtops = {
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_aedrdetach,
+       .f_event = filt_aedread,
+};
 
-static const struct filterops aed_seltrue_filtops =
-       { 1, NULL, filt_aedrdetach, filt_seltrue };
+static const struct filterops aed_seltrue_filtops = {
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_aedrdetach,
+       .f_event = filt_seltrue,
+};
 
 int
 aedkqfilter(dev_t dev, struct knote *kn)
diff -r 2bf803feab23 -r 187040438d0a sys/arch/macppc/dev/aed.c
--- a/sys/arch/macppc/dev/aed.c Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/macppc/dev/aed.c Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aed.c,v 1.29 2014/07/25 08:10:34 dholland Exp $        */
+/*     $NetBSD: aed.c,v 1.30 2017/10/25 08:12:37 maya Exp $    */
 
 /*
  * Copyright (C) 1994  Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.29 2014/07/25 08:10:34 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.30 2017/10/25 08:12:37 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -602,11 +602,19 @@
        return (kn->kn_data > 0);
 }
 
-static const struct filterops aedread_filtops =
-       { 1, NULL, filt_aedrdetach, filt_aedread };
+static const struct filterops aedread_filtops = {
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_aedrdetach,
+       .f_event = filt_aedread
+};
 
-static const struct filterops aed_seltrue_filtops =
-       { 1, NULL, filt_aedrdetach, filt_seltrue };
+static const struct filterops aed_seltrue_filtops = {
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_aedrdetach,
+       .f_event = filt_seltrue
+};
 
 int
 aedkqfilter(dev_t dev, struct knote *kn)
diff -r 2bf803feab23 -r 187040438d0a sys/arch/sandpoint/sandpoint/satmgr.c
--- a/sys/arch/sandpoint/sandpoint/satmgr.c     Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/sandpoint/sandpoint/satmgr.c     Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: satmgr.c,v 1.26 2014/07/25 08:10:34 dholland Exp $ */
+/* $NetBSD: satmgr.c,v 1.27 2017/10/25 08:12:37 maya Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -602,8 +602,11 @@
        return (kn->kn_data > 0);
 }
 
-static const struct filterops read_filtops = {
-       1, NULL, filt_rdetach, filt_read
+static const struct filterops read_filtops ={
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_rdetach,
+       .f_event = filt_read,
 };
 
 static int
diff -r 2bf803feab23 -r 187040438d0a sys/arch/shark/shark/opms.c
--- a/sys/arch/shark/shark/opms.c       Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/shark/shark/opms.c       Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: opms.c,v 1.28 2016/07/07 06:55:38 msaitoh Exp $        */
+/*      $NetBSD: opms.c,v 1.29 2017/10/25 08:12:37 maya Exp $        */
 
 /*
  * Copyright 1997
@@ -91,7 +91,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.28 2016/07/07 06:55:38 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.29 2017/10/25 08:12:37 maya Exp $");
 
 #include "opms.h"
 #if NOPMS > 1
@@ -979,8 +979,12 @@
        return (kn->kn_data > 0);
 }
 
-static const struct filterops opmsread_filtops =
-       { 1, NULL, filt_opmsrdetach, filt_opmsread };
+static const struct filterops opmsread_filtops = {
+       .f_isfd = 1,
+       .f_attach = NULL,
+       .f_detach = filt_opmsrdetach,
+       .f_event = filt_opmsread,
+};
 
 int
 opmskqfilter(dev_t dev, struct knote *kn)
diff -r 2bf803feab23 -r 187040438d0a sys/arch/sparc/dev/tctrl.c
--- a/sys/arch/sparc/dev/tctrl.c        Wed Oct 25 07:41:35 2017 +0000
+++ b/sys/arch/sparc/dev/tctrl.c        Wed Oct 25 08:12:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tctrl.c,v 1.60 2016/12/11 16:25:54 christos Exp $      */
+/*     $NetBSD: tctrl.c,v 1.61 2017/10/25 08:12:37 maya Exp $  */
 
 /*-
  * Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tctrl.c,v 1.60 2016/12/11 16:25:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tctrl.c,v 1.61 2017/10/25 08:12:37 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1230,8 +1230,12 @@



Home | Main Index | Thread Index | Old Index