Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci (hopefully) shut up warnings about set-but-unuse...



details:   https://anonhg.NetBSD.org/src/rev/1707d28d91ea
branches:  trunk
changeset: 791456:1707d28d91ea
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Nov 19 06:37:42 2013 +0000

description:
(hopefully) shut up warnings about set-but-unused variables.

diffstat:

 sys/dev/pci/voodoofb.c |  18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diffs (84 lines):

diff -r cb47dcc85ade -r 1707d28d91ea sys/dev/pci/voodoofb.c
--- a/sys/dev/pci/voodoofb.c    Tue Nov 19 05:07:40 2013 +0000
+++ b/sys/dev/pci/voodoofb.c    Tue Nov 19 06:37:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: voodoofb.c,v 1.46 2013/10/09 17:18:23 macallan Exp $   */
+/*     $NetBSD: voodoofb.c,v 1.47 2013/11/19 06:37:42 macallan Exp $   */
 
 /*
  * Copyright (c) 2005, 2006, 2012 Michael Lorenz
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.46 2013/10/09 17:18:23 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.47 2013/11/19 06:37:42 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -296,10 +296,9 @@
 static inline void
 voodoo3_write_attr(struct voodoofb_softc *sc, uint8_t reg, uint8_t val)
 {
-       volatile uint8_t junk;
        uint8_t index;
        
-       junk = bus_space_read_1(sc->sc_ioregt, sc->sc_ioregh, IS1_R - 0x300);
+       (void)bus_space_read_1(sc->sc_ioregt, sc->sc_ioregh, IS1_R - 0x300);
        index = bus_space_read_1(sc->sc_ioregt, sc->sc_ioregh, ATT_IW - 0x300);
        bus_space_write_1(sc->sc_ioregt, sc->sc_ioregh, ATT_IW - 0x300, reg);
        bus_space_write_1(sc->sc_ioregt, sc->sc_ioregh, ATT_IW - 0x300, val);
@@ -363,7 +362,7 @@
        const char *intrstr;
 #endif
        ulong defattr;
-       int console, width, height, i, j;
+       int console, width, height, i;
        prop_dictionary_t dict;
        int linebytes, depth, flags;
        uint32_t bg, fg, ul;
@@ -479,7 +478,6 @@
        printf("fb: %08lx\n", (ulong)ri->ri_bits);
 #endif
        
-       j = 0;
        if (sc->sc_bits_per_pixel == 8) {
                uint8_t tmp;
                for (i = 0; i < 256; i++) {
@@ -1029,9 +1027,8 @@
 voodoofb_rectfill(struct voodoofb_softc *sc, int x, int y, int width, 
     int height, int colour) 
 {
-       uint32_t fmt, col;
+       uint32_t fmt;
        
-       col = (colour << 24) | (colour << 16) | (colour << 8) | colour;
        fmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel + 
            ((sc->sc_bits_per_pixel == 8) ? 0 : 8)) << 13);
 
@@ -1542,7 +1539,7 @@
 {
        uint32_t miscinit0 = 0;
        int vidpll, fout;
-       uint32_t vp, vidproc = VIDPROCDEFAULT;
+       uint32_t vidproc = VIDPROCDEFAULT;
        uint32_t bpp = 1;       /* for now */
        uint32_t bytes_per_row = vm->hdisplay * bpp;
 
@@ -1552,7 +1549,6 @@
        sc->sc_linebytes = bytes_per_row;
        
        voodoofb_setup_monitor(sc, vm);
-       vp = voodoo3_read32(sc, VIDPROCCFG);
        
        vidproc &= ~(0x1c0000); /* clear bits 18 to 20, bpp in vidproccfg */
        /* enable bits 18 to 20 to the required bpp */
@@ -1561,6 +1557,8 @@
        vidpll = voodoofb_calc_pll(vm->dot_clock, &fout, 0);
 
 #ifdef VOODOOFB_DEBUG
+       uint32_t vp;
+       vp = voodoo3_read32(sc, VIDPROCCFG);
        printf("old vidproc: %08x\n", vp);
        printf("pll: %08x %d\n", vidpll, fout);
 #endif



Home | Main Index | Thread Index | Old Index