Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys avoid set but unused variables.
details: https://anonhg.NetBSD.org/src/rev/9e5624708d10
branches: trunk
changeset: 327569:9e5624708d10
user: mrg <mrg%NetBSD.org@localhost>
date: Tue Mar 11 08:19:45 2014 +0000
description:
avoid set but unused variables.
move variables under their usage #ifdef.
diffstat:
sys/arch/evbmips/gdium/gdium_intr.c | 6 ++----
sys/arch/mips/bonito/bonito_pci.c | 12 ++++++------
sys/arch/mips/rmi/rmixl_pcix.c | 9 ++++++---
sys/arch/mips/rmi/rmixlvar.h | 5 ++---
sys/dev/pci/voyager/voyagerfb.c | 7 +++----
5 files changed, 19 insertions(+), 20 deletions(-)
diffs (182 lines):
diff -r cac41e887f65 -r 9e5624708d10 sys/arch/evbmips/gdium/gdium_intr.c
--- a/sys/arch/evbmips/gdium/gdium_intr.c Tue Mar 11 07:52:37 2014 +0000
+++ b/sys/arch/evbmips/gdium/gdium_intr.c Tue Mar 11 08:19:45 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gdium_intr.c,v 1.5 2011/07/10 00:03:53 matt Exp $ */
+/* $NetBSD: gdium_intr.c,v 1.6 2014/03/11 08:19:45 mrg Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdium_intr.c,v 1.5 2011/07/10 00:03:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdium_intr.c,v 1.6 2014/03/11 08:19:45 mrg Exp $");
#define __INTR_PRIVATE
@@ -299,7 +299,6 @@
void
evbmips_iointr(int ipl, vaddr_t pc, uint32_t ipending)
{
- const struct gdium_irqmap *irqmap;
struct evbmips_intrhand *ih;
int level;
uint32_t isr;
@@ -315,7 +314,6 @@
continue;
gdium_cpuintrs[level].cintr_count.ev_count++;
LIST_FOREACH (ih, &gdium_cpuintrs[level].cintr_list, ih_q) {
- irqmap = &gdium_irqmap[ih->ih_irq];
if (isr & (1 << ih->ih_irq)) {
gdium_intrtab[ih->ih_irq].intr_count.ev_count++;
(*ih->ih_func)(ih->ih_arg);
diff -r cac41e887f65 -r 9e5624708d10 sys/arch/mips/bonito/bonito_pci.c
--- a/sys/arch/mips/bonito/bonito_pci.c Tue Mar 11 07:52:37 2014 +0000
+++ b/sys/arch/mips/bonito/bonito_pci.c Tue Mar 11 08:19:45 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bonito_pci.c,v 1.10 2011/08/27 12:59:16 bouyer Exp $ */
+/* $NetBSD: bonito_pci.c,v 1.11 2014/03/11 08:19:45 mrg Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bonito_pci.c,v 1.10 2011/08/27 12:59:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bonito_pci.c,v 1.11 2014/03/11 08:19:45 mrg Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -139,7 +139,7 @@
{
struct bonito_config *bc = v;
pcireg_t data;
- u_int32_t cfgoff, dummy, pcimap_cfg;
+ u_int32_t cfgoff, pcimap_cfg;
int s;
if (bonito_conf_addr(bc, tag, offset, &cfgoff, &pcimap_cfg))
@@ -156,7 +156,7 @@
wbflush();
/* Issue a read to make sure the write is posted */
- dummy = REGVAL(BONITO_PCIMAP_CFG);
+ (void)REGVAL(BONITO_PCIMAP_CFG);
/* low 16 bits of address are offset into config space */
data = REGVAL(BONITO_PCICFG_BASE + (cfgoff & 0xfffc));
@@ -175,7 +175,7 @@
bonito_conf_write(void *v, pcitag_t tag, int offset, pcireg_t data)
{
struct bonito_config *vt = v;
- u_int32_t cfgoff, dummy, pcimap_cfg;
+ u_int32_t cfgoff, pcimap_cfg;
int s;
if (bonito_conf_addr(vt, tag, offset, &cfgoff, &pcimap_cfg))
@@ -192,7 +192,7 @@
wbflush();
/* Issue a read to make sure the write is posted */
- dummy = REGVAL(BONITO_PCIMAP_CFG);
+ (void)REGVAL(BONITO_PCIMAP_CFG);
/* low 16 bits of address are offset into config space */
REGVAL(BONITO_PCICFG_BASE + (cfgoff & 0xfffc)) = data;
diff -r cac41e887f65 -r 9e5624708d10 sys/arch/mips/rmi/rmixl_pcix.c
--- a/sys/arch/mips/rmi/rmixl_pcix.c Tue Mar 11 07:52:37 2014 +0000
+++ b/sys/arch/mips/rmi/rmixl_pcix.c Tue Mar 11 08:19:45 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rmixl_pcix.c,v 1.10 2012/10/27 17:18:03 chs Exp $ */
+/* $NetBSD: rmixl_pcix.c,v 1.11 2014/03/11 08:19:45 mrg Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_pcix.c,v 1.10 2012/10/27 17:18:03 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_pcix.c,v 1.11 2014/03/11 08:19:45 mrg Exp $");
#include "opt_pci.h"
#include "pci.h"
@@ -385,11 +385,14 @@
* check PCI-X interface byteswap setup
* ensure 'Match Byte Lane' is disabled
*/
- uint32_t mble, mba, mbs;
+ uint32_t mble;
mble = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_XLR_MBLE);
+#ifdef PCI_DEBUG
+ uint32_t mba, mbs;
mba = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_MATCH_BIT_ADDR);
mbs = RMIXL_PCIXREG_READ(RMIXL_PCIX_ECFG_MATCH_BIT_SIZE);
DPRINTF(("%s: MBLE=%#x, MBA=%#x, MBS=%#x\n", __func__, mble, mba, mbs));
+#endif
if ((mble & __BIT(40)) != 0)
RMIXL_PCIXREG_WRITE(RMIXL_PCIX_ECFG_XLR_MBLE, 0);
diff -r cac41e887f65 -r 9e5624708d10 sys/arch/mips/rmi/rmixlvar.h
--- a/sys/arch/mips/rmi/rmixlvar.h Tue Mar 11 07:52:37 2014 +0000
+++ b/sys/arch/mips/rmi/rmixlvar.h Tue Mar 11 08:19:45 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rmixlvar.h,v 1.6 2011/07/01 19:01:31 dyoung Exp $ */
+/* $NetBSD: rmixlvar.h,v 1.7 2014/03/11 08:19:45 mrg Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -208,14 +208,13 @@
static inline int
rmixl_probe_4(volatile uint32_t *va)
{
- uint32_t tmp;
uint32_t r;
int err;
int s;
s = splhigh();
r = rmixl_cache_err_dis();
- tmp = *va; /* probe */
+ (void)*va; /* probe */
err = rmixl_cache_err_check();
rmixl_cache_err_restore(r);
splx(s);
diff -r cac41e887f65 -r 9e5624708d10 sys/dev/pci/voyager/voyagerfb.c
--- a/sys/dev/pci/voyager/voyagerfb.c Tue Mar 11 07:52:37 2014 +0000
+++ b/sys/dev/pci/voyager/voyagerfb.c Tue Mar 11 08:19:45 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: voyagerfb.c,v 1.26 2013/07/30 19:21:50 macallan Exp $ */
+/* $NetBSD: voyagerfb.c,v 1.27 2014/03/11 08:19:45 mrg Exp $ */
/*
* Copyright (c) 2009, 2011 Michael Lorenz
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.26 2013/07/30 19:21:50 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.27 2014/03/11 08:19:45 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1065,7 +1065,7 @@
struct vcons_screen *scr = ri->ri_hw;
struct voyagerfb_softc *sc = scr->scr_cookie;
uint32_t cmd;
- int fg, bg;
+ int bg;
uint8_t *data;
int x, y, wi, he;
int i, j, r, g, b, aval, pad;
@@ -1083,7 +1083,6 @@
he = font->fontheight;
bg = ri->ri_devcmap[(attr >> 16) & 0x0f];
- fg = ri->ri_devcmap[(attr >> 24) & 0x0f];
x = ri->ri_xorigin + col * wi;
y = ri->ri_yorigin + row * he;
if (c == 0x20) {
Home |
Main Index |
Thread Index |
Old Index