diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-06-27 17:51:09 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-06-27 17:51:09 +0000 |
commit | 83afa7914acb200536853aba5ac76929f2210c1b (patch) | |
tree | 437f31ca926ac913be3ced3cee9b5e8c8690e98d /sys/arch | |
parent | 04e7c9d9257a0290cc02dab12c3dfdb99f1bf745 (diff) |
Standardize xfer byte counts to ssize_t rather than a mix of size_t and int
(we need to make them signed to spot controller overruns), and fix format
strings accordingly.
While there, make sure every runtime printf is prefixed by either the complete
target information, if available, or at least the driver name with the
proper instance number - supported systems with > 1 wdsc are quite common.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sgi/hpc/wdsc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/sgi/hpc/wdsc.c b/sys/arch/sgi/hpc/wdsc.c index 2022fe97357..e8422e5bbde 100644 --- a/sys/arch/sgi/hpc/wdsc.c +++ b/sys/arch/sgi/hpc/wdsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdsc.c,v 1.4 2013/05/18 23:13:07 miod Exp $ */ +/* $OpenBSD: wdsc.c,v 1.5 2014/06/27 17:51:08 miod Exp $ */ /* $NetBSD: wdsc.c,v 1.32 2011/07/01 18:53:47 dyoung Exp $ */ /* @@ -78,7 +78,8 @@ struct cfdriver wdsc_cd = { NULL, "wdsc", DV_DULL }; -int wdsc_dmasetup(struct wd33c93_softc *, void ** ,size_t *, int, size_t *); +int wdsc_dmasetup(struct wd33c93_softc *, void **, ssize_t *, int, + ssize_t *); int wdsc_dmago(struct wd33c93_softc *); void wdsc_dmastop(struct wd33c93_softc *); void wdsc_reset(struct wd33c93_softc *); @@ -185,18 +186,19 @@ wdsc_attach(struct device *parent, struct device *self, void *aux) * Requires splbio() interrupts to be disabled by the caller */ int -wdsc_dmasetup(struct wd33c93_softc *sc, void **addr, size_t *len, int datain, - size_t *dmasize) +wdsc_dmasetup(struct wd33c93_softc *sc, void **addr, ssize_t *len, int datain, + ssize_t *dmasize) { struct wdsc_softc *wsc = (struct wdsc_softc *)sc; struct hpc_dma_softc *dsc = &wsc->sc_hpcdma; - int count, err; + ssize_t count; + int err; void *vaddr; KASSERT((wsc->sc_flags & WDSC_DMA_ACTIVE) == 0); vaddr = *addr; - count = dsc->sc_dlen = *len; + dsc->sc_dlen = count = *len; if (count) { KASSERT((wsc->sc_flags & WDSC_DMA_MAPLOADED) == 0); |