diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-12-27 11:09:18 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-12-27 11:09:18 +0000 |
commit | b9fec97a41074a52b327d0a6e89f37224e0ca145 (patch) | |
tree | 34937289e1e1d53f29815e4497808e141f5c6b51 /sys/dev/sbus | |
parent | ad0e8e0eb7e48992d4ba394c7dcf65a4569a8a46 (diff) |
Convert K&R function definitions to modern C. clang is more picky about
them.
OK otto@ deraadt@
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r-- | sys/dev/sbus/agten.c | 19 | ||||
-rw-r--r-- | sys/dev/sbus/spif.c | 145 | ||||
-rw-r--r-- | sys/dev/sbus/stp4020.c | 135 |
3 files changed, 72 insertions, 227 deletions
diff --git a/sys/dev/sbus/agten.c b/sys/dev/sbus/agten.c index 53d84a26ab3..4a59e056e5b 100644 --- a/sys/dev/sbus/agten.c +++ b/sys/dev/sbus/agten.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agten.c,v 1.10 2013/10/20 20:07:30 miod Exp $ */ +/* $OpenBSD: agten.c,v 1.11 2018/12/27 11:09:17 claudio Exp $ */ /* * Copyright (c) 2002, 2003, Miodrag Vallat. * All rights reserved. @@ -221,12 +221,7 @@ agtenattach(struct device *parent, struct device *self, void *args) } int -agten_ioctl(dev, cmd, data, flags, p) - void *dev; - u_long cmd; - caddr_t data; - int flags; - struct proc *p; +agten_ioctl(void *dev, u_long cmd, caddr_t data, int flags, struct proc *p) { struct agten_softc *sc = dev; struct wsdisplay_cmap *cm; @@ -287,10 +282,7 @@ agten_ioctl(dev, cmd, data, flags, p) * offset, allowing for the given protection, or return -1 for error. */ paddr_t -agten_mmap(v, offset, prot) - void *v; - off_t offset; - int prot; +agten_mmap(void *v, off_t offset, int prot) { struct agten_softc *sc = v; @@ -307,10 +299,7 @@ agten_mmap(v, offset, prot) } void -agten_setcolor(v, index, r, g, b) - void *v; - u_int index; - u_int8_t r, g, b; +agten_setcolor(void *v, u_int index, u_int8_t r, u_int8_t g, u_int8_t b) { struct agten_softc *sc = v; diff --git a/sys/dev/sbus/spif.c b/sys/dev/sbus/spif.c index 2c2f0115070..b6dd4317a27 100644 --- a/sys/dev/sbus/spif.c +++ b/sys/dev/sbus/spif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spif.c,v 1.21 2018/02/19 08:59:52 mpi Exp $ */ +/* $OpenBSD: spif.c,v 1.22 2018/12/27 11:09:17 claudio Exp $ */ /* * Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net) @@ -145,9 +145,7 @@ struct cfdriver sbpp_cd = { #define DTR_READ(sc,port) ((sc)->sc_ttys->sc_port[(port)].sp_dtr) int -spifmatch(parent, vcf, aux) - struct device *parent; - void *vcf, *aux; +spifmatch(struct device *parent, void *vcf, void *aux) { struct cfdata *cf = vcf; struct sbus_attach_args *sa = aux; @@ -159,9 +157,7 @@ spifmatch(parent, vcf, aux) } void -spifattach(parent, self, aux) - struct device *parent, *self; - void *aux; +spifattach(struct device *parent, struct device *self, void *aux) { struct spif_softc *sc = (struct spif_softc *)self; struct sbus_attach_args *sa = aux; @@ -278,9 +274,7 @@ fail_unmapregs: } int -sttymatch(parent, vcf, aux) - struct device *parent; - void *vcf, *aux; +sttymatch(struct device *parent, void *vcf, void *aux) { struct spif_softc *sc = (struct spif_softc *)parent; @@ -288,9 +282,7 @@ sttymatch(parent, vcf, aux) } void -sttyattach(parent, dev, aux) - struct device *parent, *dev; - void *aux; +sttyattach(struct device *parent, struct device *dev, void *aux) { struct spif_softc *sc = (struct spif_softc *)parent; struct stty_softc *ssc = (struct stty_softc *)dev; @@ -326,11 +318,7 @@ sttyattach(parent, dev, aux) } int -sttyopen(dev, flags, mode, p) - dev_t dev; - int flags; - int mode; - struct proc *p; +sttyopen(dev_t dev, int flags, int mode, struct proc *p) { struct spif_softc *csc; struct stty_softc *sc; @@ -418,11 +406,7 @@ sttyopen(dev, flags, mode, p) } int -sttyclose(dev, flags, mode, p) - dev_t dev; - int flags; - int mode; - struct proc *p; +sttyclose(dev_t dev, int flags, int mode, struct proc *p) { struct stty_softc *sc = stty_cd.cd_devs[SPIF_CARD(dev)]; struct stty_port *sp = &sc->sc_port[SPIF_PORT(dev)]; @@ -447,12 +431,7 @@ sttyclose(dev, flags, mode, p) } int -sttyioctl(dev, cmd, data, flags, p) - dev_t dev; - u_long cmd; - caddr_t data; - int flags; - struct proc *p; +sttyioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) { struct stty_softc *stc = stty_cd.cd_devs[SPIF_CARD(dev)]; struct stty_port *sp = &stc->sc_port[SPIF_PORT(dev)]; @@ -520,9 +499,7 @@ sttyioctl(dev, cmd, data, flags, p) } int -stty_modem_control(sp, bits, how) - struct stty_port *sp; - int bits, how; +stty_modem_control(struct stty_port *sp, int bits, int how) { struct spif_softc *csc = sp->sp_sc; struct tty *tp = sp->sp_tty; @@ -576,9 +553,7 @@ stty_modem_control(sp, bits, how) } int -stty_param(tp, t) - struct tty *tp; - struct termios *t; +stty_param(struct tty *tp, struct termios *t) { struct stty_softc *st = stty_cd.cd_devs[SPIF_CARD(tp->t_dev)]; struct stty_port *sp = &st->sc_port[SPIF_PORT(tp->t_dev)]; @@ -674,10 +649,7 @@ stty_param(tp, t) } int -sttyread(dev, uio, flags) - dev_t dev; - struct uio *uio; - int flags; +sttyread(dev_t dev, struct uio *uio, int flags) { struct stty_softc *sc = stty_cd.cd_devs[SPIF_CARD(dev)]; struct stty_port *sp = &sc->sc_port[SPIF_PORT(dev)]; @@ -687,10 +659,7 @@ sttyread(dev, uio, flags) } int -sttywrite(dev, uio, flags) - dev_t dev; - struct uio *uio; - int flags; +sttywrite(dev_t dev, struct uio *uio, int flags) { struct stty_softc *sc = stty_cd.cd_devs[SPIF_CARD(dev)]; struct stty_port *sp = &sc->sc_port[SPIF_PORT(dev)]; @@ -700,8 +669,7 @@ sttywrite(dev, uio, flags) } struct tty * -sttytty(dev) - dev_t dev; +sttytty(dev_t dev) { struct stty_softc *sc = stty_cd.cd_devs[SPIF_CARD(dev)]; struct stty_port *sp = &sc->sc_port[SPIF_PORT(dev)]; @@ -710,9 +678,7 @@ sttytty(dev) } int -sttystop(tp, flags) - struct tty *tp; - int flags; +sttystop(struct tty *tp, int flags) { struct stty_softc *sc = stty_cd.cd_devs[SPIF_CARD(tp->t_dev)]; struct stty_port *sp = &sc->sc_port[SPIF_PORT(tp->t_dev)]; @@ -729,8 +695,7 @@ sttystop(tp, flags) } void -stty_start(tp) - struct tty *tp; +stty_start(struct tty *tp) { struct stty_softc *stc = stty_cd.cd_devs[SPIF_CARD(tp->t_dev)]; struct stty_port *sp = &stc->sc_port[SPIF_PORT(tp->t_dev)]; @@ -755,9 +720,7 @@ stty_start(tp) } int -spifstcintr_rxexception(sc, needsoftp) - struct spif_softc *sc; - int *needsoftp; +spifstcintr_rxexception(struct spif_softc *sc, int *needsoftp) { struct stty_port *sp; u_int8_t channel, *ptr; @@ -782,9 +745,7 @@ spifstcintr_rxexception(sc, needsoftp) } int -spifstcintr_rx(sc, needsoftp) - struct spif_softc *sc; - int *needsoftp; +spifstcintr_rx(struct spif_softc *sc, int *needsoftp) { struct stty_port *sp; u_int8_t channel, *ptr, cnt, rcsr; @@ -817,9 +778,7 @@ spifstcintr_rx(sc, needsoftp) } int -spifstcintr_tx(sc, needsoftp) - struct spif_softc *sc; - int *needsoftp; +spifstcintr_tx(struct spif_softc *sc, int *needsoftp) { struct stty_port *sp; u_int8_t channel, ch; @@ -870,9 +829,7 @@ spifstcintr_tx(sc, needsoftp) } int -spifstcintr_mx(sc, needsoftp) - struct spif_softc *sc; - int *needsoftp; +spifstcintr_mx(struct spif_softc *sc, int *needsoftp) { struct stty_port *sp; u_int8_t channel, mcr; @@ -890,8 +847,7 @@ spifstcintr_mx(sc, needsoftp) } int -spifstcintr(vsc) - void *vsc; +spifstcintr(void *vsc) { struct spif_softc *sc = (struct spif_softc *)vsc; int needsoft = 0, r = 0, i; @@ -923,8 +879,7 @@ spifstcintr(vsc) } void -spifsoftintr(vsc) - void *vsc; +spifsoftintr(void *vsc) { struct spif_softc *sc = (struct spif_softc *)vsc; struct stty_softc *stc = sc->sc_ttys; @@ -994,9 +949,7 @@ spifsoftintr(vsc) } void -stty_write_ccr(sc, val) - struct spif_softc *sc; - u_int8_t val; +stty_write_ccr(struct spif_softc *sc, u_int8_t val) { int tries = 100000; @@ -1008,10 +961,7 @@ stty_write_ccr(sc, val) } int -stty_compute_baud(speed, clock, bprlp, bprhp) - speed_t speed; - int clock; - u_int8_t *bprlp, *bprhp; +stty_compute_baud(speed_t speed, int clock, u_int8_t *bprlp, u_int8_t *bprhp) { u_int32_t rate; @@ -1030,9 +980,7 @@ stty_compute_baud(speed, clock, bprlp, bprhp) } int -sbppmatch(parent, vcf, aux) - struct device *parent; - void *vcf, *aux; +sbppmatch(struct device *parent, void *vcf, void *aux) { struct spif_softc *sc = (struct spif_softc *)parent; @@ -1040,9 +988,7 @@ sbppmatch(parent, vcf, aux) } void -sbppattach(parent, dev, aux) - struct device *parent, *dev; - void *aux; +sbppattach(struct device *parent, struct device *dev, void *aux) { struct spif_softc *sc = (struct spif_softc *)parent; struct sbpp_softc *psc = (struct sbpp_softc *)dev; @@ -1058,74 +1004,49 @@ sbppattach(parent, dev, aux) } int -sbppopen(dev, flags, mode, p) - dev_t dev; - int flags; - int mode; - struct proc *p; +sbppopen(dev_t dev, int flags, int mode, struct proc *p) { return (ENXIO); } int -sbppclose(dev, flags, mode, p) - dev_t dev; - int flags; - int mode; - struct proc *p; +sbppclose(dev_t dev, int flags, int mode, struct proc *p) { return (ENXIO); } int -spifppcintr(v) - void *v; +spifppcintr(void *v) { return (0); } int -sbppread(dev, uio, flags) - dev_t dev; - struct uio *uio; - int flags; +sbppread(dev_t dev, struct uio *uio, int flags) { return (sbpp_rw(dev, uio)); } int -sbppwrite(dev, uio, flags) - dev_t dev; - struct uio *uio; - int flags; +sbppwrite(dev_t dev, struct uio *uio, int flags) { return (sbpp_rw(dev, uio)); } int -sbpp_rw(dev, uio) - dev_t dev; - struct uio *uio; +sbpp_rw(dev_t dev, struct uio *uio) { return (ENXIO); } int -sbpppoll(dev, events, p) - dev_t dev; - int events; - struct proc *p; +sbpppoll(dev_t dev, int events, struct proc *p) { return (seltrue(dev, events, p)); } int -sbppioctl(dev, cmd, data, flags, p) - dev_t dev; - u_long cmd; - caddr_t data; - int flags; - struct proc *p; +sbppioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) { int error; diff --git a/sys/dev/sbus/stp4020.c b/sys/dev/sbus/stp4020.c index 1fd19684546..47621041924 100644 --- a/sys/dev/sbus/stp4020.c +++ b/sys/dev/sbus/stp4020.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stp4020.c,v 1.19 2016/03/19 11:34:22 mpi Exp $ */ +/* $OpenBSD: stp4020.c,v 1.20 2018/12/27 11:09:17 claudio Exp $ */ /* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */ /*- @@ -85,7 +85,6 @@ static void stp4020_dump_regs(struct stp4020_socket *); static u_int16_t stp4020_rd_sockctl(struct stp4020_socket *, int); static void stp4020_wr_sockctl(struct stp4020_socket *, int, u_int16_t); -static u_int16_t stp4020_rd_winctl(struct stp4020_socket *, int, int); static void stp4020_wr_winctl(struct stp4020_socket *, int, int, u_int16_t); void stp4020_delay(unsigned int); @@ -139,41 +138,21 @@ static struct pcmcia_chip_functions stp4020_functions = { static __inline__ u_int16_t -stp4020_rd_sockctl(h, idx) - struct stp4020_socket *h; - int idx; +stp4020_rd_sockctl(struct stp4020_socket *h, int idx) { int o = ((STP4020_SOCKREGS_SIZE * (h->sock)) + idx); return (bus_space_read_2(h->tag, h->regs, o)); } static __inline__ void -stp4020_wr_sockctl(h, idx, v) - struct stp4020_socket *h; - int idx; - u_int16_t v; +stp4020_wr_sockctl(struct stp4020_socket *h, int idx, u_int16_t v) { int o = (STP4020_SOCKREGS_SIZE * (h->sock)) + idx; bus_space_write_2(h->tag, h->regs, o, v); } -static __inline__ u_int16_t -stp4020_rd_winctl(h, win, idx) - struct stp4020_socket *h; - int win; - int idx; -{ - int o = (STP4020_SOCKREGS_SIZE * (h->sock)) + - (STP4020_WINREGS_SIZE * win) + idx; - return (bus_space_read_2(h->tag, h->regs, o)); -} - static __inline__ void -stp4020_wr_winctl(h, win, idx, v) - struct stp4020_socket *h; - int win; - int idx; - u_int16_t v; +stp4020_wr_winctl(struct stp4020_socket *h, int win, int idx, u_int16_t v) { int o = (STP4020_SOCKREGS_SIZE * (h->sock)) + (STP4020_WINREGS_SIZE * win) + idx; @@ -182,9 +161,7 @@ stp4020_wr_winctl(h, win, idx, v) int -stp4020print(aux, busname) - void *aux; - const char *busname; +stp4020print(void *aux, const char *busname) { struct pcmciabus_attach_args *paa = aux; struct stp4020_socket *h = paa->pch; @@ -227,9 +204,7 @@ stpattach_common(struct stp4020_softc *sc, int clockfreq) } void -stp4020_attach_socket(h, speed) - struct stp4020_socket *h; - int speed; +stp4020_attach_socket(struct stp4020_socket *h, int speed) { struct pcmciabus_attach_args paa; int v; @@ -291,8 +266,7 @@ stp4020_attach_socket(h, speed) * Deferred thread creation callback. */ void -stp4020_create_event_thread(arg) - void *arg; +stp4020_create_event_thread(void *arg) { struct stp4020_softc *sc = arg; @@ -306,8 +280,7 @@ stp4020_create_event_thread(arg) * The actual event handling thread. */ void -stp4020_event_thread(arg) - void *arg; +stp4020_event_thread(void *arg) { struct stp4020_softc *sc = arg; int s, sense; @@ -365,9 +338,7 @@ stp4020_event_thread(arg) } void -stp4020_queue_event(sc, sock) - struct stp4020_softc *sc; - int sock; +stp4020_queue_event(struct stp4020_softc *sc, int sock) { int s; @@ -396,8 +367,7 @@ stp4020_intr_dispatch(void *arg) } int -stp4020_statintr(arg) - void *arg; +stp4020_statintr(void *arg) { struct stp4020_softc *sc = arg; int i, sense, r = 0; @@ -502,8 +472,7 @@ stp4020_statintr(arg) } int -stp4020_iointr(arg) - void *arg; +stp4020_iointr(void *arg) { struct stp4020_softc *sc = arg; int i, r = 0; @@ -617,10 +586,8 @@ stp4020_map_window(struct stp4020_socket *h, int win, int speed) } int -stp4020_chip_mem_alloc(pch, size, pcmhp) - pcmcia_chipset_handle_t pch; - bus_size_t size; - struct pcmcia_mem_handle *pcmhp; +stp4020_chip_mem_alloc(pcmcia_chipset_handle_t pch, bus_size_t size, + struct pcmcia_mem_handle *pcmhp) { struct stp4020_socket *h = (struct stp4020_socket *)pch; @@ -635,21 +602,15 @@ stp4020_chip_mem_alloc(pch, size, pcmhp) } void -stp4020_chip_mem_free(pch, pcmhp) - pcmcia_chipset_handle_t pch; - struct pcmcia_mem_handle *pcmhp; +stp4020_chip_mem_free(pcmcia_chipset_handle_t pch, + struct pcmcia_mem_handle *pcmhp) { } int -stp4020_chip_mem_map(pch, kind, card_addr, size, pcmhp, offsetp, windowp) - pcmcia_chipset_handle_t pch; - int kind; - bus_addr_t card_addr; - bus_size_t size; - struct pcmcia_mem_handle *pcmhp; - bus_size_t *offsetp; - int *windowp; +stp4020_chip_mem_map(pcmcia_chipset_handle_t pch, int kind, + bus_addr_t card_addr, bus_size_t size, struct pcmcia_mem_handle *pcmhp, + bus_size_t *offsetp, int *windowp) { struct stp4020_socket *h = (struct stp4020_socket *)pch; int win = (kind & PCMCIA_MEM_ATTR) ? STP_WIN_ATTR : STP_WIN_MEM; @@ -666,19 +627,13 @@ stp4020_chip_mem_map(pch, kind, card_addr, size, pcmhp, offsetp, windowp) } void -stp4020_chip_mem_unmap(pch, win) - pcmcia_chipset_handle_t pch; - int win; +stp4020_chip_mem_unmap(pcmcia_chipset_handle_t pch, int win) { } int -stp4020_chip_io_alloc(pch, start, size, align, pcihp) - pcmcia_chipset_handle_t pch; - bus_addr_t start; - bus_size_t size; - bus_size_t align; - struct pcmcia_io_handle *pcihp; +stp4020_chip_io_alloc(pcmcia_chipset_handle_t pch, bus_addr_t start, + bus_size_t size, bus_size_t align, struct pcmcia_io_handle *pcihp) { struct stp4020_socket *h = (struct stp4020_socket *)pch; @@ -689,20 +644,14 @@ stp4020_chip_io_alloc(pch, start, size, align, pcihp) } void -stp4020_chip_io_free(pch, pcihp) - pcmcia_chipset_handle_t pch; - struct pcmcia_io_handle *pcihp; +stp4020_chip_io_free(pcmcia_chipset_handle_t pch, + struct pcmcia_io_handle *pcihp) { } int -stp4020_chip_io_map(pch, width, offset, size, pcihp, windowp) - pcmcia_chipset_handle_t pch; - int width; - bus_addr_t offset; - bus_size_t size; - struct pcmcia_io_handle *pcihp; - int *windowp; +stp4020_chip_io_map(pcmcia_chipset_handle_t pch, int width, bus_addr_t offset, + bus_size_t size, struct pcmcia_io_handle *pcihp, int *windowp) { struct stp4020_socket *h = (struct stp4020_socket *)pch; @@ -714,15 +663,12 @@ stp4020_chip_io_map(pch, width, offset, size, pcihp, windowp) } void -stp4020_chip_io_unmap(pch, win) - pcmcia_chipset_handle_t pch; - int win; +stp4020_chip_io_unmap(pcmcia_chipset_handle_t pch, int win) { } void -stp4020_chip_socket_enable(pch) - pcmcia_chipset_handle_t pch; +stp4020_chip_socket_enable(pcmcia_chipset_handle_t pch) { struct stp4020_socket *h = (struct stp4020_socket *)pch; int i, v; @@ -818,8 +764,7 @@ stp4020_chip_socket_enable(pch) } void -stp4020_chip_socket_disable(pch) - pcmcia_chipset_handle_t pch; +stp4020_chip_socket_disable(pcmcia_chipset_handle_t pch) { struct stp4020_socket *h = (struct stp4020_socket *)pch; int v; @@ -842,13 +787,9 @@ stp4020_chip_socket_disable(pch) } void * -stp4020_chip_intr_establish(pch, pf, ipl, handler, arg, xname) - pcmcia_chipset_handle_t pch; - struct pcmcia_function *pf; - int ipl; - int (*handler) (void *); - void *arg; - char *xname; +stp4020_chip_intr_establish(pcmcia_chipset_handle_t pch, + struct pcmcia_function *pf, int ipl, int (*handler) (void *), void *arg, + char *xname) { struct stp4020_socket *h = (struct stp4020_socket *)pch; @@ -865,9 +806,7 @@ stp4020_chip_intr_establish(pch, pf, ipl, handler, arg, xname) } void -stp4020_chip_intr_disestablish(pch, ih) - pcmcia_chipset_handle_t pch; - void *ih; +stp4020_chip_intr_disestablish(pcmcia_chipset_handle_t pch, void *ih) { struct stp4020_socket *h = (struct stp4020_socket *)pch; @@ -880,9 +819,7 @@ stp4020_chip_intr_disestablish(pch, ih) } const char * -stp4020_chip_intr_string(pch, ih) - pcmcia_chipset_handle_t pch; - void *ih; +stp4020_chip_intr_string(pcmcia_chipset_handle_t pch, void *ih) { if (ih == NULL) return ("couldn't establish interrupt"); @@ -895,8 +832,7 @@ stp4020_chip_intr_string(pch, ih) * XXX - assumes a context */ void -stp4020_delay(ms) - unsigned int ms; +stp4020_delay(unsigned int ms) { unsigned int nticks; @@ -917,8 +853,7 @@ stp4020_delay(ms) #ifdef STP4020_DEBUG void -stp4020_dump_regs(h) - struct stp4020_socket *h; +stp4020_dump_regs(struct stp4020_socket *h) { /* * Dump control and status registers. |