Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev - remove set but unused variable.
details: https://anonhg.NetBSD.org/src/rev/28de57754da0
branches: trunk
changeset: 790725:28de57754da0
user: mrg <mrg%NetBSD.org@localhost>
date: Sat Oct 19 21:00:32 2013 +0000
description:
- remove set but unused variable.
- put variables only inside #ifdef inside that same #ifdef.
use __USE() where appropriate.
diffstat:
sys/dev/sbus/agten.c | 7 +++----
sys/dev/sbus/dbri.c | 17 ++++++++++++++---
sys/dev/sbus/magma.c | 6 ++----
sys/dev/vme/xd.c | 5 +++--
sys/dev/vme/xy.c | 11 +++++++----
5 files changed, 29 insertions(+), 17 deletions(-)
diffs (219 lines):
diff -r f0ad40bd4ff6 -r 28de57754da0 sys/dev/sbus/agten.c
--- a/sys/dev/sbus/agten.c Sat Oct 19 20:49:22 2013 +0000
+++ b/sys/dev/sbus/agten.c Sat Oct 19 21:00:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: agten.c,v 1.31 2013/07/30 19:24:26 macallan Exp $ */
+/* $NetBSD: agten.c,v 1.32 2013/10/19 21:00:32 mrg Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.31 2013/07/30 19:24:26 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.32 2013/10/19 21:00:32 mrg Exp $");
/*
* a driver for the Fujitsu AG-10e SBus framebuffer
@@ -618,7 +618,6 @@
{
int i;
uint32_t src, srcw;
- volatile uint32_t junk;
/* then we set up a linear LUT for 24bit colour */
agten_write_idx(sc, IBM561_CMAP_TABLE + 256);
@@ -683,7 +682,7 @@
bus_space_write_4(sc->sc_bustag, sc->sc_p9100_regh, COORD_INDEX, 0);
bus_space_write_4(sc->sc_bustag, sc->sc_p9100_regh, RECT_RTW_XY, src);
bus_space_write_4(sc->sc_bustag, sc->sc_p9100_regh, RECT_RTW_XY, srcw);
- junk = bus_space_read_4(sc->sc_bustag, sc->sc_p9100_regh, COMMAND_QUAD);
+ (void)bus_space_read_4(sc->sc_bustag, sc->sc_p9100_regh, COMMAND_QUAD);
/* initialize the cursor registers */
diff -r f0ad40bd4ff6 -r 28de57754da0 sys/dev/sbus/dbri.c
--- a/sys/dev/sbus/dbri.c Sat Oct 19 20:49:22 2013 +0000
+++ b/sys/dev/sbus/dbri.c Sat Oct 19 21:00:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dbri.c,v 1.34 2011/11/23 23:07:36 jmcneill Exp $ */
+/* $NetBSD: dbri.c,v 1.35 2013/10/19 21:00:32 mrg Exp $ */
/*
* Copyright (C) 1997 Rudolf Koenig (rfkoenig%immd4.informatik.uni-erlangen.de@localhost)
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dbri.c,v 1.34 2011/11/23 23:07:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbri.c,v 1.35 2013/10/19 21:00:32 mrg Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -1270,8 +1270,10 @@
{
volatile uint32_t *cmd;
int i;
+#if 0
int td;
int td_first, td_last;
+#endif
bus_addr_t dmabuf, dmabase;
struct dbri_desc *dd = &sc->sc_desc[which];
@@ -1285,8 +1287,10 @@
return;
}
+#if 0
td = 0;
td_first = td_last = -1;
+#endif
if (sc->sc_pipe[pipe].sdp == 0) {
aprint_error_dev(sc->sc_dev, "uninitialized pipe %d\n",
@@ -1296,7 +1300,6 @@
dmabuf = dd->dmabase;
dmabase = sc->sc_dmabase;
- td = 0;
for (i = 0; i < (num - 1); i++) {
@@ -1306,7 +1309,9 @@
sc->sc_dma->xmit[i].nda = dmabase + dbri_dma_off(xmit, i + 1);
sc->sc_dma->xmit[i].status = 0;
+#if 0
td_last = td;
+#endif
dmabuf += blksz;
}
@@ -1366,7 +1371,9 @@
{
volatile uint32_t *cmd;
int i;
+#if 0
int td_first, td_last;
+#endif
bus_addr_t dmabuf, dmabase;
struct dbri_desc *dd = &sc->sc_desc[which];
@@ -1379,7 +1386,9 @@
return;
}
+#if 0
td_first = td_last = -1;
+#endif
if (sc->sc_pipe[pipe].sdp == 0) {
aprint_error_dev(sc->sc_dev, "uninitialized pipe %d\n",
@@ -1397,7 +1406,9 @@
sc->sc_dma->recv[i].nda = dmabase + dbri_dma_off(recv, i + 1);
sc->sc_dma->recv[i].status = RX_EOF;
+#if 0
td_last = i;
+#endif
dmabuf += blksz;
}
diff -r f0ad40bd4ff6 -r 28de57754da0 sys/dev/sbus/magma.c
--- a/sys/dev/sbus/magma.c Sat Oct 19 20:49:22 2013 +0000
+++ b/sys/dev/sbus/magma.c Sat Oct 19 21:00:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: magma.c,v 1.56 2012/10/27 17:18:37 chs Exp $ */
+/* $NetBSD: magma.c,v 1.57 2013/10/19 21:00:32 mrg Exp $ */
/*-
* Copyright (c) 1998 Iain Hibbert
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.56 2012/10/27 17:18:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.57 2013/10/19 21:00:32 mrg Exp $");
#if 0
#define MAGMA_DEBUG
@@ -618,11 +618,9 @@
}
} else { /* serial port */
struct mtty_port *mtty;
- struct tty *tp;
mtty = &sc->ms_mtty->ms_port[port];
cd = mtty->mp_cd1400;
- tp = mtty->mp_tty;
if( !ISSET(mtty->mp_flags, MTTYF_STOP) ) {
int count = 0;
diff -r f0ad40bd4ff6 -r 28de57754da0 sys/dev/vme/xd.c
--- a/sys/dev/vme/xd.c Sat Oct 19 20:49:22 2013 +0000
+++ b/sys/dev/vme/xd.c Sat Oct 19 21:00:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xd.c,v 1.89 2012/10/27 17:18:38 chs Exp $ */
+/* $NetBSD: xd.c,v 1.90 2013/10/19 21:00:32 mrg Exp $ */
/*
* Copyright (c) 1995 Charles D. Cranor
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.89 2012/10/27 17:18:38 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.90 2013/10/19 21:00:32 mrg Exp $");
#undef XDC_DEBUG /* full debug */
#define XDC_DIAG /* extra sanity checks */
@@ -2437,6 +2437,7 @@
xio->errnum = xdcsc->reqs[rqno].errnum;
xio->tries = xdcsc->reqs[rqno].tries;
XDC_DONE(xdcsc, rqno, dummy);
+ __USE(dummy);
if (xio->cmd == XDCMD_RD || xio->cmd == XDCMD_XRD)
error = copyout(buf, xio->dptr, xio->dlen);
diff -r f0ad40bd4ff6 -r 28de57754da0 sys/dev/vme/xy.c
--- a/sys/dev/vme/xy.c Sat Oct 19 20:49:22 2013 +0000
+++ b/sys/dev/vme/xy.c Sat Oct 19 21:00:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xy.c,v 1.93 2012/10/27 17:18:38 chs Exp $ */
+/* $NetBSD: xy.c,v 1.94 2013/10/19 21:00:32 mrg Exp $ */
/*
* Copyright (c) 1995 Charles D. Cranor
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.93 2012/10/27 17:18:38 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.94 2013/10/19 21:00:32 mrg Exp $");
#undef XYC_DEBUG /* full debug */
#undef XYC_DIAG /* extra sanity checks */
@@ -1397,7 +1397,10 @@
int
xyc_startbuf(struct xyc_softc *xycsc, struct xy_softc *xysc, struct buf *bp)
{
- int partno, error;
+#ifdef XYC_DEBUG
+ int partno;
+#endif
+ int error;
struct xy_iorq *iorq;
struct xy_iopb *iopb;
u_long block;
@@ -1410,8 +1413,8 @@
if (bp == NULL)
panic("xyc_startbuf null buf");
+#ifdef XYC_DEBUG
partno = DISKPART(bp->b_dev);
-#ifdef XYC_DEBUG
printf("xyc_startbuf: %s%c: %s block %d\n", device_xname(xysc->sc_dev),
'a' + partno, (bp->b_flags & B_READ) ? "read" : "write", bp->b_blkno);
printf("xyc_startbuf: b_bcount %d, b_data 0x%x\n",
Home |
Main Index |
Thread Index |
Old Index