Fri Oct 30 22:20:38 2020 UTC ()
c99 struct initializers


(christos)
diff -r1.4 -r1.5 src/sys/arch/arm/xscale/pxa2x0_apm.c
diff -r1.27 -r1.28 src/sys/arch/macppc/dev/apm.c
diff -r1.8 -r1.9 src/sys/arch/mips/ralink/ralink_gpio.c

cvs diff -r1.4 -r1.5 src/sys/arch/arm/xscale/pxa2x0_apm.c (expand / switch to unified diff)

--- src/sys/arch/arm/xscale/pxa2x0_apm.c 2012/11/12 18:00:38 1.4
+++ src/sys/arch/arm/xscale/pxa2x0_apm.c 2020/10/30 22:20:38 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pxa2x0_apm.c,v 1.4 2012/11/12 18:00:38 skrll Exp $ */ 1/* $NetBSD: pxa2x0_apm.c,v 1.5 2020/10/30 22:20:38 christos Exp $ */
2/* $OpenBSD: pxa2x0_apm.c,v 1.28 2007/03/29 18:42:38 uwe Exp $ */ 2/* $OpenBSD: pxa2x0_apm.c,v 1.28 2007/03/29 18:42:38 uwe Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2001 Alexander Guy. All rights reserved. 5 * Copyright (c) 2001 Alexander Guy. All rights reserved.
6 * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. 6 * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
7 * Copyright (c) 1995 John T. Kohl. All rights reserved. 7 * Copyright (c) 1995 John T. Kohl. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -94,28 +94,32 @@ void apm_thread(void *); @@ -94,28 +94,32 @@ void apm_thread(void *);
94extern int perflevel; 94extern int perflevel;
95#endif 95#endif
96 96
97int freq; 97int freq;
98void pxa2x0_setperf(int speed); 98void pxa2x0_setperf(int speed);
99int pxa2x0_cpuspeed(int *speed); 99int pxa2x0_cpuspeed(int *speed);
100 100
101int apm_record_event(struct pxa2x0_apm_softc *, u_int); 101int apm_record_event(struct pxa2x0_apm_softc *, u_int);
102#if 0 102#if 0
103void filt_apmrdetach(struct knote *kn); 103void filt_apmrdetach(struct knote *kn);
104int filt_apmread(struct knote *kn, long hint); 104int filt_apmread(struct knote *kn, long hint);
105int apmkqfilter(dev_t dev, struct knote *kn); 105int apmkqfilter(dev_t dev, struct knote *kn);
106 106
107struct filterops apmread_filtops = 107static const struct filterops apmread_filtops = {
108 { 1, NULL, filt_apmrdetach, filt_apmread}; 108 .f_isfd = 1,
 109 .f_attach = NULL,
 110 .f_detach = filt_apmrdetach,
 111 .f_event = filt_apmread,
 112};
109#endif 113#endif
110 114
111/* 115/*
112 * Flags to control kernel display 116 * Flags to control kernel display
113 * SCFLAG_NOPRINT: do not output APM power messages due to 117 * SCFLAG_NOPRINT: do not output APM power messages due to
114 * a power change event. 118 * a power change event.
115 * 119 *
116 * SCFLAG_PCTPRINT: do not output APM power messages due to 120 * SCFLAG_PCTPRINT: do not output APM power messages due to
117 * to a power change event unless the battery 121 * to a power change event unless the battery
118 * percentage changes. 122 * percentage changes.
119 */ 123 */
120 124
121#define SCFLAG_NOPRINT 0x0008000 125#define SCFLAG_NOPRINT 0x0008000

cvs diff -r1.27 -r1.28 src/sys/arch/macppc/dev/apm.c (expand / switch to unified diff)

--- src/sys/arch/macppc/dev/apm.c 2014/07/25 08:10:34 1.27
+++ src/sys/arch/macppc/dev/apm.c 2020/10/30 22:20:38 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: apm.c,v 1.27 2014/07/25 08:10:34 dholland Exp $ */ 1/* $NetBSD: apm.c,v 1.28 2020/10/30 22:20:38 christos Exp $ */
2/* $OpenBSD: apm.c,v 1.5 2002/06/07 07:13:59 miod Exp $ */ 2/* $OpenBSD: apm.c,v 1.5 2002/06/07 07:13:59 miod Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2001 Alexander Guy. All rights reserved. 5 * Copyright (c) 2001 Alexander Guy. All rights reserved.
6 * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. 6 * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
7 * Copyright (c) 1995 John T. Kohl. All rights reserved. 7 * Copyright (c) 1995 John T. Kohl. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * OR SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE. 31 * SUCH DAMAGE.
32 * 32 *
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.27 2014/07/25 08:10:34 dholland Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.28 2020/10/30 22:20:38 christos Exp $");
37 37
38#include "apm.h" 38#include "apm.h"
39 39
40#if NAPM > 1 40#if NAPM > 1
41#error only one APM emulation device may be configured 41#error only one APM emulation device may be configured
42#endif 42#endif
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/kernel.h> 46#include <sys/kernel.h>
47#include <sys/proc.h> 47#include <sys/proc.h>
48#include <sys/device.h> 48#include <sys/device.h>
49#include <sys/fcntl.h> 49#include <sys/fcntl.h>
@@ -421,28 +421,32 @@ filt_apmrdetach(struct knote *kn) @@ -421,28 +421,32 @@ filt_apmrdetach(struct knote *kn)
421 SLIST_REMOVE(&sc->sc_rsel.sel_klist, kn, knote, kn_selnext); 421 SLIST_REMOVE(&sc->sc_rsel.sel_klist, kn, knote, kn_selnext);
422 APM_UNLOCK(sc); 422 APM_UNLOCK(sc);
423} 423}
424 424
425static int 425static int
426filt_apmread(struct knote *kn, long hint) 426filt_apmread(struct knote *kn, long hint)
427{ 427{
428 struct apm_softc *sc = kn->kn_hook; 428 struct apm_softc *sc = kn->kn_hook;
429 429
430 kn->kn_data = sc->event_count; 430 kn->kn_data = sc->event_count;
431 return (kn->kn_data > 0); 431 return (kn->kn_data > 0);
432} 432}
433 433
434static struct filterops apmread_filtops = 434static struct filterops apmread_filtops = {
435 { 1, NULL, filt_apmrdetach, filt_apmread}; 435 .f_isfd = 1,
 436 .f_attach = NULL,
 437 .f_detach = filt_apmrdetach,
 438 .f_event = filt_apmread,
 439};
436 440
437int 441int
438apmkqfilter(dev_t dev, struct knote *kn) 442apmkqfilter(dev_t dev, struct knote *kn)
439{ 443{
440 struct apm_softc *sc = device_lookup_private(&apm_cd,APMUNIT(dev)); 444 struct apm_softc *sc = device_lookup_private(&apm_cd,APMUNIT(dev));
441 struct klist *klist; 445 struct klist *klist;
442 446
443 switch (kn->kn_filter) { 447 switch (kn->kn_filter) {
444 case EVFILT_READ: 448 case EVFILT_READ:
445 klist = &sc->sc_rsel.sel_klist; 449 klist = &sc->sc_rsel.sel_klist;
446 kn->kn_fop = &apmread_filtops; 450 kn->kn_fop = &apmread_filtops;
447 break; 451 break;
448 default: 452 default:

cvs diff -r1.8 -r1.9 src/sys/arch/mips/ralink/ralink_gpio.c (expand / switch to unified diff)

--- src/sys/arch/mips/ralink/ralink_gpio.c 2020/03/10 11:07:39 1.8
+++ src/sys/arch/mips/ralink/ralink_gpio.c 2020/10/30 22:20:38 1.9