diff options
| author | christos <christos@NetBSD.org> | 2005-05-29 22:11:28 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2005-05-29 22:11:28 +0000 |
| commit | 9b1843d7c2cd5d9559601f3e12c87fde8fdeee59 (patch) | |
| tree | eabc6a45326568cfee6b0f9e8fb43dbca3740153 /sys/dev/ata | |
| parent | 80f7d2107bf9bd3287d1e61a9efb09bfdf32b80c (diff) | |
- remove casts [to avoid volatile]
- sprinkle const
- avoid shadowed variables
Diffstat (limited to 'sys/dev/ata')
| -rw-r--r-- | sys/dev/ata/ata.c | 10 | ||||
| -rw-r--r-- | sys/dev/ata/ata_raid.c | 8 | ||||
| -rw-r--r-- | sys/dev/ata/ata_wdc.c | 6 | ||||
| -rw-r--r-- | sys/dev/ata/wd.c | 22 |
4 files changed, 23 insertions, 23 deletions
diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c index c631d5e356b..02d18deb273 100644 --- a/sys/dev/ata/ata.c +++ b/sys/dev/ata/ata.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata.c,v 1.69 2005/05/20 14:39:04 bouyer Exp $ */ +/* $NetBSD: ata.c,v 1.70 2005/05/29 22:11:28 christos Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.69 2005/05/20 14:39:04 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.70 2005/05/29 22:11:28 christos Exp $"); #ifndef ATADEBUG #define ATADEBUG @@ -358,7 +358,7 @@ atabus_thread(void *arg) } splx(s); chp->ch_thread = NULL; - wakeup((void *)&chp->ch_flags); + wakeup(&chp->ch_flags); kthread_exit(0); } @@ -509,7 +509,7 @@ atabus_detach(struct device *self, int flags) splx(s); wakeup(&chp->ch_thread); while (chp->ch_thread != NULL) - (void) tsleep((void *)&chp->ch_flags, PRIBIO, "atadown", 0); + (void) tsleep(&chp->ch_flags, PRIBIO, "atadown", 0); /* power hook */ if (sc->sc_powerhook) @@ -1083,7 +1083,7 @@ ata_probe_caps(struct ata_drive_datas *drvp) struct atac_softc *atac = chp->ch_atac; struct device *drv_dev = drvp->drv_softc; int i, printed, s; - char *sep = ""; + const char *sep = ""; int cf_flags; if (ata_get_params(drvp, AT_WAIT, ¶ms) != CMD_OK) { diff --git a/sys/dev/ata/ata_raid.c b/sys/dev/ata/ata_raid.c index 7b5326cf3d2..7acd9bec6c7 100644 --- a/sys/dev/ata/ata_raid.c +++ b/sys/dev/ata/ata_raid.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata_raid.c,v 1.11 2004/10/28 07:07:39 yamt Exp $ */ +/* $NetBSD: ata_raid.c,v 1.12 2005/05/29 22:11:28 christos Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.11 2004/10/28 07:07:39 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.12 2005/05/29 22:11:28 christos Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -305,7 +305,7 @@ ata_raid_get_array_info(u_int type, u_int arrayno) } int -ata_raid_config_block_rw(struct vnode *vp, daddr_t blkno, void *buf, +ata_raid_config_block_rw(struct vnode *vp, daddr_t blkno, void *tbuf, size_t size, int bflags) { struct buf *bp; @@ -321,7 +321,7 @@ ata_raid_config_block_rw(struct vnode *vp, daddr_t blkno, void *buf, bp->b_bcount = bp->b_resid = size; bp->b_flags = bflags; bp->b_proc = curproc; - bp->b_data = buf; + bp->b_data = tbuf; VOP_STRATEGY(vp, bp); error = biowait(bp); diff --git a/sys/dev/ata/ata_wdc.c b/sys/dev/ata/ata_wdc.c index 82df8243a62..58735897305 100644 --- a/sys/dev/ata/ata_wdc.c +++ b/sys/dev/ata/ata_wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata_wdc.c,v 1.79 2005/02/27 00:26:58 perry Exp $ */ +/* $NetBSD: ata_wdc.c,v 1.80 2005/05/29 22:11:28 christos Exp $ */ /* * Copyright (c) 1998, 2001, 2003 Manuel Bouyer. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.79 2005/02/27 00:26:58 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.80 2005/05/29 22:11:28 christos Exp $"); #ifndef ATADEBUG #define ATADEBUG @@ -183,7 +183,7 @@ wdc_ata_bio_start(struct ata_channel *chp, struct ata_xfer *xfer) struct ata_bio *ata_bio = xfer->c_cmd; struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive]; int wait_flags = (xfer->c_flags & C_POLL) ? AT_POLL : 0; - char *errstring; + const char *errstring; ATADEBUG_PRINT(("wdc_ata_bio_start %s:%d:%d\n", atac->atac_dev.dv_xname, chp->ch_channel, xfer->c_drive), diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index f7cecb8472e..d413d3d19fe 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.300 2005/05/16 15:36:57 bouyer Exp $ */ +/* $NetBSD: wd.c,v 1.301 2005/05/29 22:11:28 christos Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.300 2005/05/16 15:36:57 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.301 2005/05/29 22:11:28 christos Exp $"); #ifndef ATADEBUG #define ATADEBUG @@ -283,7 +283,7 @@ wdattach(struct device *parent, struct device *self, void *aux) struct wd_softc *wd = (void *)self; struct ata_device *adev= aux; int i, blank; - char buf[41], pbuf[9], c, *p, *q; + char tbuf[41], pbuf[9], c, *p, *q; const struct wd_quirk *wdq; ATADEBUG_PRINT(("wdattach\n"), DEBUG_FUNCS | DEBUG_PROBE); @@ -307,7 +307,7 @@ wdattach(struct device *parent, struct device *self, void *aux) return; } - for (blank = 0, p = wd->sc_params.atap_model, q = buf, i = 0; + for (blank = 0, p = wd->sc_params.atap_model, q = tbuf, i = 0; i < sizeof(wd->sc_params.atap_model); i++) { c = *p++; if (c == '\0') @@ -323,9 +323,9 @@ wdattach(struct device *parent, struct device *self, void *aux) } *q++ = '\0'; - aprint_normal(": <%s>\n", buf); + aprint_normal(": <%s>\n", tbuf); - wdq = wd_lookup_quirks(buf); + wdq = wd_lookup_quirks(tbuf); if (wdq != NULL) wd->sc_quirks = wdq->wdq_quirks; @@ -1102,7 +1102,7 @@ wdperror(const struct wd_softc *wd) "uncorrectable data error", "interface CRC error"}; const char *const *errstr; int i; - char *sep = ""; + const char *sep = ""; const char *devname = wd->sc_dev.dv_xname; struct ata_drive_datas *drvp = wd->drvp; @@ -1366,7 +1366,7 @@ bad: { struct wd_ioctl *wi; atareq_t *atareq = (atareq_t *) addr; - int error; + int error1; wi = wi_get(); wi->wi_softc = wd; @@ -1384,7 +1384,7 @@ bad: wi->wi_uio.uio_rw = (atareq->flags & ATACMD_READ) ? B_READ : B_WRITE; wi->wi_uio.uio_procp = p; - error = physio(wdioctlstrategy, &wi->wi_bp, dev, + error1 = physio(wdioctlstrategy, &wi->wi_bp, dev, (atareq->flags & ATACMD_READ) ? B_READ : B_WRITE, minphys, &wi->wi_uio); } else { @@ -1396,11 +1396,11 @@ bad: wi->wi_bp.b_dev = 0; wi->wi_bp.b_proc = p; wdioctlstrategy(&wi->wi_bp); - error = wi->wi_bp.b_error; + error1 = wi->wi_bp.b_error; } *atareq = wi->wi_atareq; wi_free(wi); - return(error); + return(error1); } case DIOCAWEDGE: |
