Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic - remove unused variables



details:   https://anonhg.NetBSD.org/src/rev/4961ba841780
branches:  trunk
changeset: 790591:4961ba841780
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Oct 17 21:24:24 2013 +0000

description:
- remove unused variables
- move variables inside ifdef sections
- ifdef notdef unused code
- use __USE for debugging variables

diffstat:

 sys/dev/ic/aic79xx.c     |  27 +++++++++++----------------
 sys/dev/ic/aic79xx_osm.c |   7 +++----
 sys/dev/ic/arn5008.c     |  10 ++++++----
 sys/dev/ic/arn9003.c     |  16 +++++++++++-----
 sys/dev/ic/arn9285.c     |  12 ++++++++----
 sys/dev/ic/arn9287.c     |  12 ++++++++----
 sys/dev/ic/athn.c        |  10 +++++-----
 sys/dev/ic/atw.c         |  13 ++++---------
 sys/dev/ic/bwi.c         |  12 ++++++------
 sys/dev/ic/ciss.c        |   6 ++----
 sys/dev/ic/mfi.c         |  12 ++----------
 sys/dev/ic/mtd803.c      |   7 +++----
 sys/dev/ic/rtw.c         |  32 +++++++++++++++++++++++++++-----
 sys/dev/ic/sl811hs.c     |  10 +++-------
 sys/dev/ic/spic.c        |   8 ++++----
 sys/dev/ic/tpm.c         |   7 ++-----
 16 files changed, 105 insertions(+), 96 deletions(-)

diffs (truncated from 883 to 300 lines):

diff -r c9bed3441db7 -r 4961ba841780 sys/dev/ic/aic79xx.c
--- a/sys/dev/ic/aic79xx.c      Thu Oct 17 21:23:05 2013 +0000
+++ b/sys/dev/ic/aic79xx.c      Thu Oct 17 21:24:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic79xx.c,v 1.45 2011/07/02 13:12:44 mrg Exp $ */
+/*     $NetBSD: aic79xx.c,v 1.46 2013/10/17 21:24:24 christos Exp $    */
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.45 2011/07/02 13:12:44 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.46 2013/10/17 21:24:24 christos Exp $");
 
 #include <dev/ic/aic79xx_osm.h>
 #include <dev/ic/aic79xx_inline.h>
@@ -1025,9 +1025,10 @@
                {
                        struct  ahd_devinfo devinfo;
                        struct  scb *scb;
+#ifdef notdef
                        struct  ahd_initiator_tinfo *targ_info;
                        struct  ahd_tmode_tstate *tstate;
-                       struct  ahd_transinfo *tinfo;
+#endif
                        u_int   scbid;
 
                        /*
@@ -1055,12 +1056,13 @@
                                            SCB_GET_LUN(scb),
                                            SCB_GET_CHANNEL(ahd, scb),
                                            ROLE_INITIATOR);
+#ifdef notdef
                        targ_info = ahd_fetch_transinfo(ahd,
                                                        devinfo.channel,
                                                        devinfo.our_scsiid,
                                                        devinfo.target,
                                                        &tstate);
-                       tinfo = &targ_info->curr;
+#endif
                        ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
                                      AHD_TRANS_ACTIVE, /*paused*/TRUE);
                        ahd_set_syncrate(ahd, &devinfo, /*period*/0,
@@ -1747,7 +1749,6 @@
        struct  scb *scb;
        u_int   scbid;
        u_int   lqistat1;
-       u_int   lqistat2;
        u_int   msg_out;
        u_int   curphase;
        u_int   lastphase;
@@ -1758,7 +1759,7 @@
        scb = NULL;
        ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
        lqistat1 = ahd_inb(ahd, LQISTAT1) & ~(LQIPHASE_LQ|LQIPHASE_NLQ);
-       lqistat2 = ahd_inb(ahd, LQISTAT2);
+       (void)ahd_inb(ahd, LQISTAT2);
        if ((lqistat1 & (LQICRCI_NLQ|LQICRCI_LQ)) == 0
         && (ahd->bugs & AHD_NLQICRC_DELAYED_BUG) != 0) {
                u_int lqistate;
@@ -2657,10 +2658,8 @@
                        sg_list = (struct ahd_dma64_seg*)scb->sg_list;
                        for (i = 0; i < scb->sg_count; i++) {
                                uint64_t addr;
-                               uint32_t len;
 
                                addr = ahd_le64toh(sg_list[i].addr);
-                               len = ahd_le32toh(sg_list[i].len);
                                printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
                                       i,
                                       (uint32_t)((addr >> 32) & 0xFFFFFFFF),
@@ -3288,13 +3287,12 @@
        LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
                struct ahd_devinfo devinfo;
                struct hardware_scb *pending_hscb;
-               struct ahd_initiator_tinfo *tinfo;
                struct ahd_tmode_tstate *tstate;
 
                ahd_scb_devinfo(ahd, &devinfo, pending_scb);
-               tinfo = ahd_fetch_transinfo(ahd, devinfo.channel,
-                                           devinfo.our_scsiid,
-                                           devinfo.target, &tstate);
+               (void)ahd_fetch_transinfo(ahd, devinfo.channel,
+                                         devinfo.our_scsiid,
+                                         devinfo.target, &tstate);
                pending_hscb = pending_scb->hscb;
                if ((tstate->auto_negotiate & devinfo.target_mask) == 0
                 && (pending_scb->flags & SCB_AUTO_NEGOTIATE) != 0) {
@@ -7127,7 +7125,6 @@
        int              found;
        int              targets;
        int              pending_cmds;
-       int              qincount;
 
        /* Must be in CCHAN mode */
        saved_modes = ahd_save_modes(ahd);
@@ -7155,7 +7152,7 @@
        LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) {
                pending_cmds++;
        }
-       qincount = ahd_qinfifo_count(ahd);
+       (void)ahd_qinfifo_count(ahd);
 
        if (action == SEARCH_PRINT) {
                printf("qinstart = 0x%x qinfifonext = 0x%x\n",
@@ -7953,7 +7950,6 @@
                struct scsi_request_sense *sc;
                struct ahd_initiator_tinfo *targ_info;
                struct ahd_tmode_tstate *tstate;
-               struct ahd_transinfo *tinfo;
 #ifdef AHD_DEBUG
                if (ahd_debug & AHD_SHOW_SENSE) {
                        ahd_print_path(ahd, scb);
@@ -7975,7 +7971,6 @@
                                                devinfo.our_scsiid,
                                                devinfo.target,
                                                &tstate);
-               tinfo = &targ_info->curr;
                sg = scb->sg_list;
                sc = (struct scsi_request_sense *)hscb->shared_data.idata.cdb;
                /*
diff -r c9bed3441db7 -r 4961ba841780 sys/dev/ic/aic79xx_osm.c
--- a/sys/dev/ic/aic79xx_osm.c  Thu Oct 17 21:23:05 2013 +0000
+++ b/sys/dev/ic/aic79xx_osm.c  Thu Oct 17 21:24:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic79xx_osm.c,v 1.31 2010/02/24 22:37:57 dyoung Exp $  */
+/*     $NetBSD: aic79xx_osm.c,v 1.32 2013/10/17 21:24:24 christos Exp $        */
 
 /*
  * Bus independent NetBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.31 2010/02/24 22:37:57 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.32 2013/10/17 21:24:24 christos Exp $");
 
 #include <dev/ic/aic79xx_osm.h>
 #include <dev/ic/aic79xx_inline.h>
@@ -739,7 +739,6 @@
 {
        struct  scb       *scb;
        struct  ahd_softc *ahd;
-       ahd_mode_state     saved_modes;
        int                s;
 
        scb = arg;
@@ -750,7 +749,7 @@
        ahd_lock(ahd, &s);
 
        ahd_pause_and_flushwork(ahd);
-       saved_modes = ahd_save_modes(ahd);
+       (void)ahd_save_modes(ahd);
 #if 0
        ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
        ahd_outb(ahd, SCSISIGO, ACKO);
diff -r c9bed3441db7 -r 4961ba841780 sys/dev/ic/arn5008.c
--- a/sys/dev/ic/arn5008.c      Thu Oct 17 21:23:05 2013 +0000
+++ b/sys/dev/ic/arn5008.c      Thu Oct 17 21:24:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arn5008.c,v 1.3 2013/04/06 14:57:38 martin Exp $       */
+/*     $NetBSD: arn5008.c,v 1.4 2013/10/17 21:24:24 christos Exp $     */
 /*     $OpenBSD: ar5008.c,v 1.21 2012/08/25 12:14:31 kettenis Exp $    */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.3 2013/04/06 14:57:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.4 2013/10/17 21:24:24 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -1181,7 +1181,7 @@
 Static int
 ar5008_intr(struct athn_softc *sc)
 {
-       uint32_t intr, intr2, intr5, sync;
+       uint32_t intr, intr5, sync;
 
        /* Get pending interrupts. */
        intr = AR_READ(sc, AR_INTR_ASYNC_CAUSE);
@@ -1202,12 +1202,14 @@
 
        if (intr != 0) {
                if (intr & AR_ISR_BCNMISC) {
-                       intr2 = AR_READ(sc, AR_ISR_S2);
+                       uint32_t intr2 = AR_READ(sc, AR_ISR_S2);
 #if notyet
                        if (intr2 & AR_ISR_S2_TIM)
                                /* TBD */;
                        if (intr2 & AR_ISR_S2_TSFOOR)
                                /* TBD */;
+#else
+                       __USE(intr2);
 #endif
                }
                intr = AR_READ(sc, AR_ISR_RAC);
diff -r c9bed3441db7 -r 4961ba841780 sys/dev/ic/arn9003.c
--- a/sys/dev/ic/arn9003.c      Thu Oct 17 21:23:05 2013 +0000
+++ b/sys/dev/ic/arn9003.c      Thu Oct 17 21:24:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arn9003.c,v 1.3 2013/04/06 14:57:38 martin Exp $       */
+/*     $NetBSD: arn9003.c,v 1.4 2013/10/17 21:24:24 christos Exp $     */
 /*     $OpenBSD: ar9003.c,v 1.25 2012/10/20 09:53:32 stsp Exp $        */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.3 2013/04/06 14:57:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.4 2013/10/17 21:24:24 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -1339,7 +1339,7 @@
 Static int
 ar9003_intr(struct athn_softc *sc)
 {
-       uint32_t intr, intr2, intr5, sync;
+       uint32_t intr, sync;
 
        /* Get pending interrupts. */
        intr = AR_READ(sc, AR_INTR_ASYNC_CAUSE);
@@ -1360,7 +1360,7 @@
 
        if (intr != 0) {
                if (intr & AR_ISR_BCNMISC) {
-                       intr2 = AR_READ(sc, AR_ISR_S2);
+                       uint32_t intr2 = AR_READ(sc, AR_ISR_S2);
 #ifdef notyet
                        if (intr2 & AR_ISR_S2_TIM)
                                /* TBD */;
@@ -1368,6 +1368,8 @@
                                /* TBD */;
                        if (intr2 & AR_ISR_S2_BB_WATCHDOG)
                                /* TBD */;
+#else
+                       __USE(intr2);
 #endif
                }
                intr = AR_READ(sc, AR_ISR_RAC);
@@ -1391,11 +1393,15 @@
                        ar9003_tx_intr(sc);
 
                if (intr & AR_ISR_GENTMR) {
-                       intr5 = AR_READ(sc, AR_ISR_S5_S);
+                       uint32_t intr5 = AR_READ(sc, AR_ISR_S5_S);
+#ifdef ATHN_DEBUG
                        DPRINTFN(DBG_INTR, sc,
                            "GENTMR trigger=%d thresh=%d\n",
                            MS(intr5, AR_ISR_S5_GENTIMER_TRIG),
                            MS(intr5, AR_ISR_S5_GENTIMER_THRESH));
+#else
+                       __USE(intr5);
+#endif
                }
        }
        if (sync != 0) {
diff -r c9bed3441db7 -r 4961ba841780 sys/dev/ic/arn9285.c
--- a/sys/dev/ic/arn9285.c      Thu Oct 17 21:23:05 2013 +0000
+++ b/sys/dev/ic/arn9285.c      Thu Oct 17 21:24:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arn9285.c,v 1.2 2013/04/03 14:20:02 christos Exp $     */
+/*     $NetBSD: arn9285.c,v 1.3 2013/10/17 21:24:24 christos Exp $     */
 /*     $OpenBSD: ar9285.c,v 1.19 2012/06/10 21:23:36 kettenis Exp $    */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arn9285.c,v 1.2 2013/04/03 14:20:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn9285.c,v 1.3 2013/10/17 21:24:24 christos Exp $");
 
 #ifndef _MODULE
 #include "athn_usb.h"
@@ -794,21 +794,25 @@
     struct ieee80211_channel *extc)
 {
        const struct ar9285_eeprom *eep = sc->sc_eep;
+#ifdef notyet
        const struct ar9285_modal_eep_header *modal = &eep->modalHeader;
+#endif
        uint8_t tpow_cck[4], tpow_ofdm[4];
 #ifndef IEEE80211_NO_HT
        uint8_t tpow_cck_ext[4], tpow_ofdm_ext[4];
        uint8_t tpow_ht20[8], tpow_ht40[8];
        uint8_t ht40inc;
 #endif
-       int16_t max_ant_gain, power[ATHN_POWER_COUNT];
+       int16_t power[ATHN_POWER_COUNT];
        int i;
 
        ar9285_set_power_calib(sc, c);
 



Home | Main Index | Thread Index | Old Index