c99 struct initializersdiff -r1.4 -r1.5 src/sys/arch/arm/xscale/pxa2x0_apm.c
(christos)
--- 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 *); | |||
94 | extern int perflevel; | 94 | extern int perflevel; | |
95 | #endif | 95 | #endif | |
96 | 96 | |||
97 | int freq; | 97 | int freq; | |
98 | void pxa2x0_setperf(int speed); | 98 | void pxa2x0_setperf(int speed); | |
99 | int pxa2x0_cpuspeed(int *speed); | 99 | int pxa2x0_cpuspeed(int *speed); | |
100 | 100 | |||
101 | int apm_record_event(struct pxa2x0_apm_softc *, u_int); | 101 | int apm_record_event(struct pxa2x0_apm_softc *, u_int); | |
102 | #if 0 | 102 | #if 0 | |
103 | void filt_apmrdetach(struct knote *kn); | 103 | void filt_apmrdetach(struct knote *kn); | |
104 | int filt_apmread(struct knote *kn, long hint); | 104 | int filt_apmread(struct knote *kn, long hint); | |
105 | int apmkqfilter(dev_t dev, struct knote *kn); | 105 | int apmkqfilter(dev_t dev, struct knote *kn); | |
106 | 106 | |||
107 | struct filterops apmread_filtops = | 107 | static 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 |
--- 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 | |||
425 | static int | 425 | static int | |
426 | filt_apmread(struct knote *kn, long hint) | 426 | filt_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 | |||
434 | static struct filterops apmread_filtops = | 434 | static 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 | |||
437 | int | 441 | int | |
438 | apmkqfilter(dev_t dev, struct knote *kn) | 442 | apmkqfilter(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: |
--- 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
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ralink_gpio.c,v 1.8 2020/03/10 11:07:39 martin Exp $ */ | 1 | /* $NetBSD: ralink_gpio.c,v 1.9 2020/10/30 22:20:38 christos Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2011 CradlePoint Technology, Inc. | 3 | * Copyright (c) 2011 CradlePoint Technology, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* ra_gpio.c -- Ralink 3052 gpio driver */ | 29 | /* ra_gpio.c -- Ralink 3052 gpio driver */ | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.8 2020/03/10 11:07:39 martin Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.9 2020/10/30 22:20:38 christos Exp $"); | |
33 | 33 | |||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> | |
35 | #include <sys/bus.h> | 35 | #include <sys/bus.h> | |
36 | #include <sys/callout.h> | 36 | #include <sys/callout.h> | |
37 | #include <sys/device.h> | 37 | #include <sys/device.h> | |
38 | #include <sys/event.h> | 38 | #include <sys/event.h> | |
39 | #include <sys/intr.h> | 39 | #include <sys/intr.h> | |
40 | #include <sys/kernel.h> | 40 | #include <sys/kernel.h> | |
41 | #include <sys/systm.h> | 41 | #include <sys/systm.h> | |
42 | 42 | |||
43 | #include <dev/cons.h> | 43 | #include <dev/cons.h> | |
44 | 44 | |||
45 | #include <mips/cpuregs.h> | 45 | #include <mips/cpuregs.h> | |
@@ -485,30 +485,30 @@ static const int pin_tab_index[GPIO_PINS | @@ -485,30 +485,30 @@ static const int pin_tab_index[GPIO_PINS | |||
485 | CFATTACH_DECL_NEW(rgpio, sizeof(struct ra_gpio_softc), ra_gpio_match, | 485 | CFATTACH_DECL_NEW(rgpio, sizeof(struct ra_gpio_softc), ra_gpio_match, | |
486 | ra_gpio_attach, NULL, NULL); | 486 | ra_gpio_attach, NULL, NULL); | |
487 | 487 | |||
488 | /* | 488 | /* | |
489 | * Event handler calls and structures | 489 | * Event handler calls and structures | |
490 | */ | 490 | */ | |
491 | static int gpio_event_app_user_attach(struct knote *); | 491 | static int gpio_event_app_user_attach(struct knote *); | |
492 | static void gpio_event_app_user_detach(struct knote *); | 492 | static void gpio_event_app_user_detach(struct knote *); | |
493 | static int gpio_event_app_user_event(struct knote *, long); | 493 | static int gpio_event_app_user_event(struct knote *, long); | |
494 | 494 | |||
495 | static struct klist knotes; | 495 | static struct klist knotes; | |
496 | static int app_filter_id; | 496 | static int app_filter_id; | |
497 | static struct filterops app_fops = { | 497 | static struct filterops app_fops = { | |
498 | 0, | 498 | .f_isfd = 0, | |
499 | gpio_event_app_user_attach, | 499 | .f_attach = gpio_event_app_user_attach, | |
500 | gpio_event_app_user_detach, | 500 | .f_detach = gpio_event_app_user_detach, | |
501 | gpio_event_app_user_event | 501 | .f_event = gpio_event_app_user_event, | |
502 | }; | 502 | }; | |
503 | static struct callout led_tick_callout; | 503 | static struct callout led_tick_callout; | |
504 | static int gpio_driver_blink_leds = 1; | 504 | static int gpio_driver_blink_leds = 1; | |
505 | 505 | |||
506 | static inline uint32_t | 506 | static inline uint32_t | |
507 | sy_read(ra_gpio_softc_t *sc, bus_size_t off) | 507 | sy_read(ra_gpio_softc_t *sc, bus_size_t off) | |
508 | { | 508 | { | |
509 | KASSERTMSG((off & 3) == 0, "%s: unaligned off=%#" PRIxBUSSIZE "\n", | 509 | KASSERTMSG((off & 3) == 0, "%s: unaligned off=%#" PRIxBUSSIZE "\n", | |
510 | __func__, off); | 510 | __func__, off); | |
511 | return bus_space_read_4(sc->sc_memt, sc->sc_sy_memh, off); | 511 | return bus_space_read_4(sc->sc_memt, sc->sc_sy_memh, off); | |
512 | } | 512 | } | |
513 | 513 | |||
514 | static inline void | 514 | static inline void |