Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Remove unused variables



details:   https://anonhg.NetBSD.org/src/rev/20b7396a2a06
branches:  trunk
changeset: 790045:20b7396a2a06
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 15 14:04:04 2013 +0000

description:
Remove unused variables

diffstat:

 sys/dev/sbus/spif.c      |  14 +++++---------
 sys/dev/stbi/stb_image.c |   5 ++---
 2 files changed, 7 insertions(+), 12 deletions(-)

diffs (104 lines):

diff -r ddb658e6236b -r 20b7396a2a06 sys/dev/sbus/spif.c
--- a/sys/dev/sbus/spif.c       Sun Sep 15 13:56:27 2013 +0000
+++ b/sys/dev/sbus/spif.c       Sun Sep 15 14:04:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spif.c,v 1.28 2011/07/18 00:58:52 mrg Exp $    */
+/*     $NetBSD: spif.c,v 1.29 2013/09/15 14:04:04 martin Exp $ */
 /*     $OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $  */
 
 /*
@@ -41,7 +41,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.28 2011/07/18 00:58:52 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.29 2013/09/15 14:04:04 martin Exp $");
 
 #include "spif.h"
 #if NSPIF > 0
@@ -742,7 +742,7 @@
 spif_stcintr_rx(struct spif_softc *sc, int *needsoftp)
 {
        struct stty_port *sp;
-       uint8_t channel, *ptr, cnt, rcsr;
+       uint8_t channel, *ptr, cnt;
        int i;
 
        channel = CD180_GSCR_CHANNEL(STC_READ(sc, STC_GSCR1));
@@ -751,7 +751,7 @@
        cnt = STC_READ(sc, STC_RDCR);
        for (i = 0; i < cnt; i++) {
                *ptr++ = 0;
-               rcsr = STC_READ(sc, STC_RCSR);
+               (void)STC_READ(sc, STC_RCSR);
                *ptr++ = STC_READ(sc, STC_RDR);
                if (ptr == sp->sp_rend)
                        ptr = sp->sp_rbuf;
@@ -877,7 +877,7 @@
 {
        struct spif_softc *sc = (struct spif_softc *)vsc;
        struct stty_softc *stc = sc->sc_ttys;
-       int r = 0, i, data, s, flags;
+       int i, data, s, flags;
        uint8_t stat, msvr;
        struct stty_port *sp;
        struct tty *tp;
@@ -904,7 +904,6 @@
                                        data |= TTY_PE;
 
                                (*tp->t_linesw->l_rint)(data, tp);
-                               r = 1;
                        }
 
                        s = splhigh();
@@ -922,13 +921,11 @@
                                sp->sp_carrier = msvr & CD180_MSVR_CD;
                                (*tp->t_linesw->l_modem)(tp,
                                    sp->sp_carrier);
-                               r = 1;
                        }
 
                        if (ISSET(flags, STTYF_RING_OVERFLOW)) {
                                log(LOG_WARNING, "%s-%x: ring overflow\n",
                                        device_xname(stc->sc_dev), i);
-                               r = 1;
                        }
 
                        if (ISSET(flags, STTYF_DONE)) {
@@ -936,7 +933,6 @@
                                    sp->sp_txp - tp->t_outq.c_cf);
                                CLR(tp->t_state, TS_BUSY);
                                (*tp->t_linesw->l_start)(tp);
-                               r = 1;
                        }
                }
        }
diff -r ddb658e6236b -r 20b7396a2a06 sys/dev/stbi/stb_image.c
--- a/sys/dev/stbi/stb_image.c  Sun Sep 15 13:56:27 2013 +0000
+++ b/sys/dev/stbi/stb_image.c  Sun Sep 15 14:04:04 2013 +0000
@@ -430,7 +430,7 @@
 #endif
 #ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: stb_image.c,v 1.5 2013/01/27 14:47:37 mbalmer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stb_image.c,v 1.6 2013/09/15 14:06:10 martin Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -3221,7 +3221,7 @@
 static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 {
    uint8 *out;
-   unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0;
+   unsigned int mr=0,mg=0,mb=0,ma=0;
    stbi_uc pal[256][4];
    int psize=0,i,j,compress=0,width;
    int bpp, flip_vertically, pad, target, offset, hsz;
@@ -3270,7 +3270,6 @@
                   mg = 0xffu <<  8;
                   mb = 0xffu <<  0;
                   ma = 0xffu << 24;
-                  fake_a = 1; // @TODO: check for cases like alpha value is all 0 and switch it to 255
                } else {
                   mr = 31u << 10;
                   mg = 31u <<  5;



Home | Main Index | Thread Index | Old Index