- remove unused but set variables.

- use __USE() where necessary.
- remove useless 'volatile' markers

kd.c:consinit() might be wrong for old proms, but i've not
changed it really.
This commit is contained in:
mrg 2013-10-19 19:40:23 +00:00
parent 2af58edbe2
commit fa33d35f40
8 changed files with 29 additions and 27 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ie_obio.c,v 1.40 2011/07/01 18:50:41 dyoung Exp $ */
/* $NetBSD: if_ie_obio.c,v 1.41 2013/10/19 19:40:23 mrg Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.40 2011/07/01 18:50:41 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.41 2013/10/19 19:40:23 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -254,7 +254,6 @@ ie_obio_attach(device_t parent, device_t self, void *aux)
int rseg;
int error;
paddr_t pa;
struct intrhand *ih;
bus_size_t memsize;
u_long iebase;
uint8_t myaddr[ETHER_ADDR_LEN];
@ -392,7 +391,7 @@ ie_obio_attach(device_t parent, device_t self, void *aux)
i82586_attach(sc, "onboard", myaddr, media, NMEDIA, media[0]);
/* Establish interrupt channel */
ih = bus_intr_establish(oba->oba_bustag,
oba->oba_pri, IPL_NET,
i82586_intr, sc);
(void)bus_intr_establish(oba->oba_bustag,
oba->oba_pri, IPL_NET,
i82586_intr, sc);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kd.c,v 1.51 2012/10/27 17:18:11 chs Exp $ */
/* $NetBSD: kd.c,v 1.52 2013/10/19 19:40:23 mrg Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.51 2012/10/27 17:18:11 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.52 2013/10/19 19:40:23 mrg Exp $");
#include "opt_kgdb.h"
#include "fb.h"
@ -334,7 +334,6 @@ kdparam(struct tty *tp, struct termios *t)
static void
kdstart(struct tty *tp)
{
struct clist *cl;
int s1, s2;
s1 = splsoftclock();
@ -342,7 +341,6 @@ kdstart(struct tty *tp)
if (tp->t_state & (TS_BUSY|TS_TTSTOP|TS_TIMEOUT))
goto out;
cl = &tp->t_outq;
if (ttypull(tp)) {
tp->t_state |= TS_BUSY;
if ((s1 & PSR_PIL) == 0) {
@ -619,15 +617,20 @@ prom_get_device_args(const char *prop, char *args, unsigned int sz)
void
consinit(void)
{
#if 0
int inSource, outSink;
#endif
switch (prom_version()) {
#if 0
case PROM_OLDMON:
case PROM_OBP_V0:
/* The stdio handles identify the device type */
inSource = prom_stdin();
outSink = prom_stdout();
break;
// XXXMRG should these just set prom_stdin_node / prom_stdout_node?
#endif
case PROM_OBP_V2:
case PROM_OBP_V3:

View File

@ -1,4 +1,4 @@
/* $NetBSD: tctrl.c,v 1.56 2012/10/27 17:18:11 chs Exp $ */
/* $NetBSD: tctrl.c,v 1.57 2013/10/19 19:40:23 mrg Exp $ */
/*-
* Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tctrl.c,v 1.56 2012/10/27 17:18:11 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: tctrl.c,v 1.57 2013/10/19 19:40:23 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -747,7 +747,7 @@ static void
tctrl_read_event_status(struct tctrl_softc *sc)
{
struct tctrl_req req;
int s, lid;
int s;
uint32_t v;
req.cmdbuf[0] = TS102_OP_RD_EVENT_STATUS;
@ -800,7 +800,6 @@ tctrl_read_event_status(struct tctrl_softc *sc)
(sc->sc_ext_status & TS102_EXT_STATUS_LID_DOWN)
? "closed" : "opened");
#endif
lid = (sc->sc_ext_status & TS102_EXT_STATUS_LID_DOWN) == 0;
}
if (v & TS102_EVENT_STATUS_EXTERNAL_VGA_STATUS_CHANGE) {
int vga;

View File

@ -1,5 +1,5 @@
/* $OpenBSD: ts102.c,v 1.14 2005/01/27 17:03:23 millert Exp $ */
/* $NetBSD: ts102.c,v 1.17 2012/10/27 17:18:11 chs Exp $ */
/* $NetBSD: ts102.c,v 1.18 2013/10/19 19:40:23 mrg Exp $ */
/*
* Copyright (c) 2003, 2004, Miodrag Vallat.
* Copyright (c) 2005, Michael Lorenz.
@ -866,6 +866,8 @@ tslot_slot_intr(struct tslot_data *td, int intreg)
#ifdef TSLOT_DEBUG
printf("%s: interrupt on socket %d ir %x sts %x\n",
device_xname(sc->sc_dev), td->td_slot, intreg, status);
#else
__USE(status);
#endif
sockstat = td->td_status;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.91 2013/01/07 16:59:18 chs Exp $ */
/* $NetBSD: pmap.h,v 1.92 2013/10/19 19:40:23 mrg Exp $ */
/*
* Copyright (c) 1996
@ -260,7 +260,7 @@ vaddr_t pmap_map(vaddr_t, paddr_t, paddr_t, int);
#define pmap_phys_address(x) (x)
void pmap_reference(pmap_t);
void pmap_remove(pmap_t, vaddr_t, vaddr_t);
#define pmap_update(pmap) /* nothing (yet) */
#define pmap_update(pmap) __USE(pmap)
void pmap_virtual_space(vaddr_t *, vaddr_t *);
#ifdef PMAP_GROWKERNEL
vaddr_t pmap_growkernel(vaddr_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpuvar.h,v 1.90 2011/08/15 02:19:44 mrg Exp $ */
/* $NetBSD: cpuvar.h,v 1.91 2013/10/19 19:40:23 mrg Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -171,9 +171,9 @@ struct cpu_info {
* the pending register to avoid a hardware bug.
*/
#define raise_ipi(cpi,lvl) do { \
volatile int x; \
int x; \
(cpi)->intreg_4m->pi_set = PINTR_SINTRLEV(lvl); \
x = (cpi)->intreg_4m->pi_pend; \
x = (cpi)->intreg_4m->pi_pend; __USE(x); \
} while (0)
int sun4_mmu3l; /* [4]: 3-level MMU present */

View File

@ -1,4 +1,4 @@
/* $NetBSD: memecc.c,v 1.15 2012/10/10 16:51:51 tsutsui Exp $ */
/* $NetBSD: memecc.c,v 1.16 2013/10/19 19:40:23 mrg Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: memecc.c,v 1.15 2012/10/10 16:51:51 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: memecc.c,v 1.16 2013/10/19 19:40:23 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -77,7 +77,6 @@ memecc_attach(device_t parent, device_t self, void *aux)
{
struct memecc_softc *sc = device_private(self);
struct mainbus_attach_args *ma = aux;
int node;
uint32_t reg;
if (memerr_handler) {
@ -86,7 +85,6 @@ memecc_attach(device_t parent, device_t self, void *aux)
}
sc->sc_bt = ma->ma_bustag;
node = ma->ma_node;
/*
* Map registers

View File

@ -1,4 +1,4 @@
/* $NetBSD: timer.c,v 1.30 2012/07/29 00:04:05 matt Exp $ */
/* $NetBSD: timer.c,v 1.31 2013/10/19 19:40:23 mrg Exp $ */
/*
* Copyright (c) 1992, 1993
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: timer.c,v 1.30 2012/07/29 00:04:05 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: timer.c,v 1.31 2013/10/19 19:40:23 mrg Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -163,11 +163,12 @@ timerattach(volatile int *cntreg, volatile int *limreg)
* Note: sun4m clocks tick with 500ns periods.
*/
for (timerblurb = 1; ; timerblurb++) {
volatile int discard;
int discard;
u_int t1;
/* Reset counter register by writing some large limit value */
discard = *limreg;
__USE(discard);
*limreg = tmr_ustolim(TMR_MASK-1);
t0 = *cntreg;