Module Name: src Committed By: christos Date: Thu Oct 17 21:24:25 UTC 2013
Modified Files: src/sys/dev/ic: aic79xx.c aic79xx_osm.c arn5008.c arn9003.c arn9285.c arn9287.c athn.c atw.c bwi.c ciss.c mfi.c mtd803.c rtw.c sl811hs.c spic.c tpm.c Log Message: - remove unused variables - move variables inside ifdef sections - ifdef notdef unused code - use __USE for debugging variables To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/dev/ic/aic79xx.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ic/aic79xx_osm.c src/sys/dev/ic/ciss.c cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/arn5008.c src/sys/dev/ic/arn9003.c cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/arn9285.c src/sys/dev/ic/arn9287.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/athn.c cvs rdiff -u -r1.154 -r1.155 src/sys/dev/ic/atw.c cvs rdiff -u -r1.22 -r1.23 src/sys/dev/ic/bwi.c cvs rdiff -u -r1.49 -r1.50 src/sys/dev/ic/mfi.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/mtd803.c cvs rdiff -u -r1.119 -r1.120 src/sys/dev/ic/rtw.c cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/sl811hs.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/spic.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/tpm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/aic79xx.c diff -u src/sys/dev/ic/aic79xx.c:1.45 src/sys/dev/ic/aic79xx.c:1.46 --- src/sys/dev/ic/aic79xx.c:1.45 Sat Jul 2 09:12:44 2011 +++ src/sys/dev/ic/aic79xx.c Thu Oct 17 17:24:24 2013 @@ -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 @@ ahd_handle_seqint(struct ahd_softc *ahd, { 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 @@ ahd_handle_seqint(struct ahd_softc *ahd, 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 @@ ahd_handle_transmission_error(struct ahd 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 @@ ahd_handle_transmission_error(struct ahd 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 @@ ahd_dump_sglist(struct scb *scb) 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 @@ ahd_update_pending_scbs(struct ahd_softc 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 @@ ahd_search_qinfifo(struct ahd_softc *ahd int found; int targets; int pending_cmds; - int qincount; /* Must be in CCHAN mode */ saved_modes = ahd_save_modes(ahd); @@ -7155,7 +7152,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd 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 @@ ahd_handle_scsi_status(struct ahd_softc 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 @@ ahd_handle_scsi_status(struct ahd_softc devinfo.our_scsiid, devinfo.target, &tstate); - tinfo = &targ_info->curr; sg = scb->sg_list; sc = (struct scsi_request_sense *)hscb->shared_data.idata.cdb; /* Index: src/sys/dev/ic/aic79xx_osm.c diff -u src/sys/dev/ic/aic79xx_osm.c:1.31 src/sys/dev/ic/aic79xx_osm.c:1.32 --- src/sys/dev/ic/aic79xx_osm.c:1.31 Wed Feb 24 17:37:57 2010 +++ src/sys/dev/ic/aic79xx_osm.c Thu Oct 17 17:24:24 2013 @@ -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 @@ ahd_timeout(void *arg) { struct scb *scb; struct ahd_softc *ahd; - ahd_mode_state saved_modes; int s; scb = arg; @@ -750,7 +749,7 @@ ahd_timeout(void *arg) 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); Index: src/sys/dev/ic/ciss.c diff -u src/sys/dev/ic/ciss.c:1.31 src/sys/dev/ic/ciss.c:1.32 --- src/sys/dev/ic/ciss.c:1.31 Sun Oct 13 00:24:21 2013 +++ src/sys/dev/ic/ciss.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ciss.c,v 1.31 2013/10/13 04:24:21 christos Exp $ */ +/* $NetBSD: ciss.c,v 1.32 2013/10/17 21:24:24 christos Exp $ */ /* $OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $ */ /* @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.31 2013/10/13 04:24:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.32 2013/10/17 21:24:24 christos Exp $"); #include "bio.h" @@ -1067,7 +1067,6 @@ ciss_scsi_cmd(struct scsipi_channel *cha u_int8_t target; struct ciss_ccb *ccb; struct ciss_cmd *cmd; - int error; CISS_DPRINTF(CISS_D_CMD, ("ciss_scsi_cmd ")); @@ -1087,7 +1086,6 @@ ciss_scsi_cmd(struct scsipi_channel *cha break; } - error = 0; xs->error = XS_NOERROR; /* XXX emulate SYNCHRONIZE_CACHE ??? */ Index: src/sys/dev/ic/arn5008.c diff -u src/sys/dev/ic/arn5008.c:1.3 src/sys/dev/ic/arn5008.c:1.4 --- src/sys/dev/ic/arn5008.c:1.3 Sat Apr 6 10:57:38 2013 +++ src/sys/dev/ic/arn5008.c Thu Oct 17 17:24:24 2013 @@ -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 @@ ar5008_swba_intr(struct athn_softc *sc) 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 @@ ar5008_intr(struct athn_softc *sc) 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); Index: src/sys/dev/ic/arn9003.c diff -u src/sys/dev/ic/arn9003.c:1.3 src/sys/dev/ic/arn9003.c:1.4 --- src/sys/dev/ic/arn9003.c:1.3 Sat Apr 6 10:57:38 2013 +++ src/sys/dev/ic/arn9003.c Thu Oct 17 17:24:24 2013 @@ -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 @@ ar9003_swba_intr(struct athn_softc *sc) 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 @@ ar9003_intr(struct athn_softc *sc) 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 @@ ar9003_intr(struct athn_softc *sc) /* 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_intr(struct athn_softc *sc) 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) { Index: src/sys/dev/ic/arn9285.c diff -u src/sys/dev/ic/arn9285.c:1.2 src/sys/dev/ic/arn9285.c:1.3 --- src/sys/dev/ic/arn9285.c:1.2 Wed Apr 3 10:20:02 2013 +++ src/sys/dev/ic/arn9285.c Thu Oct 17 17:24:24 2013 @@ -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 @@ ar9285_set_txpower(struct athn_softc *sc 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); +#ifdef notyet /* Compute transmit power reduction due to antenna gain. */ - max_ant_gain = modal->antennaGain; + uint16_t max_ant_gain = modal->antennaGain; /* XXX */ +#endif /* Get CCK target powers. */ ar5008_get_lg_tpow(sc, c, AR_CTL_11B, eep->calTargetPowerCck, Index: src/sys/dev/ic/arn9287.c diff -u src/sys/dev/ic/arn9287.c:1.2 src/sys/dev/ic/arn9287.c:1.3 --- src/sys/dev/ic/arn9287.c:1.2 Wed Apr 3 10:20:02 2013 +++ src/sys/dev/ic/arn9287.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: arn9287.c,v 1.2 2013/04/03 14:20:02 christos Exp $ */ +/* $NetBSD: arn9287.c,v 1.3 2013/10/17 21:24:24 christos Exp $ */ /* $OpenBSD: ar9287.c,v 1.17 2012/06/10 21:23:36 kettenis Exp $ */ /*- @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: arn9287.c,v 1.2 2013/04/03 14:20:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arn9287.c,v 1.3 2013/10/17 21:24:24 christos Exp $"); #include <sys/param.h> #include <sys/sockio.h> @@ -433,21 +433,25 @@ ar9287_set_txpower(struct athn_softc *sc struct ieee80211_channel *extc) { const struct ar9287_eeprom *eep = sc->sc_eep; +#ifdef notyet const struct ar9287_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 pwr = 0, max_ant_gain, power[ATHN_POWER_COUNT]; + int16_t pwr = 0, power[ATHN_POWER_COUNT]; int i; ar9287_set_power_calib(sc, c); +#ifdef notyet /* Compute transmit power reduction due to antenna gain. */ - max_ant_gain = MAX(modal->antennaGainCh[0], modal->antennaGainCh[1]); + uint16_t max_ant_gain = MAX(modal->antennaGainCh[0], modal->antennaGainCh[1]); /* XXX */ +#endif /* * Reduce scaled power by number of active chains to get per-chain Index: src/sys/dev/ic/athn.c diff -u src/sys/dev/ic/athn.c:1.6 src/sys/dev/ic/athn.c:1.7 --- src/sys/dev/ic/athn.c:1.6 Mon Jun 24 15:43:58 2013 +++ src/sys/dev/ic/athn.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: athn.c,v 1.6 2013/06/24 19:43:58 martin Exp $ */ +/* $NetBSD: athn.c,v 1.7 2013/10/17 21:24:24 christos Exp $ */ /* $OpenBSD: athn.c,v 1.75 2013/01/14 09:50:31 jsing Exp $ */ /*- @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.6 2013/06/24 19:43:58 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.7 2013/10/17 21:24:24 christos Exp $"); #ifndef _MODULE #include "athn_usb.h" /* for NATHN_USB */ @@ -1941,7 +1941,7 @@ athn_set_sta_timers(struct athn_softc *s struct ieee80211com *ic = &sc->sc_ic; uint32_t tsfhi, tsflo, tsftu, reg; uint32_t intval, next_tbtt, next_dtim; - int dtim_period, dtim_count, rem_dtim_count; + int dtim_period, rem_dtim_count; tsfhi = AR_READ(sc, AR_TSF_U32); tsflo = AR_READ(sc, AR_TSF_L32); @@ -1958,10 +1958,10 @@ athn_set_sta_timers(struct athn_softc *s dtim_period = 1; /* Assume all TIMs are DTIMs. */ #ifdef notyet - dtim_count = ic->ic_dtim_count; + int dtim_count = ic->ic_dtim_count; if (dtim_count >= dtim_period) /* Should not happen. */ -#endif dtim_count = 0; /* Assume last TIM was a DTIM. */ +#endif /* Compute number of remaining TIMs until next DTIM. */ rem_dtim_count = 0; /* XXX */ Index: src/sys/dev/ic/atw.c diff -u src/sys/dev/ic/atw.c:1.154 src/sys/dev/ic/atw.c:1.155 --- src/sys/dev/ic/atw.c:1.154 Sat Sep 14 09:10:25 2013 +++ src/sys/dev/ic/atw.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: atw.c,v 1.154 2013/09/14 13:10:25 joerg Exp $ */ +/* $NetBSD: atw.c,v 1.155 2013/10/17 21:24:24 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.154 2013/09/14 13:10:25 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.155 2013/10/17 21:24:24 christos Exp $"); #include <sys/param.h> @@ -902,7 +902,6 @@ void atw_reset(struct atw_softc *sc) { int i; - uint32_t lpc; ATW_WRITE(sc, ATW_NAR, 0x0); DELAY(atw_nar_delay); @@ -949,7 +948,7 @@ atw_reset(struct atw_softc *sc) DELAY(atw_magic_delay4); - lpc = ATW_READ(sc, ATW_LPC); + (void)ATW_READ(sc, ATW_LPC); DPRINTF(sc, ("%s: ATW_LPC %#08x\n", __func__, lpc)); @@ -2474,10 +2473,8 @@ atw_newstate(struct ieee80211com *ic, en { struct ifnet *ifp = ic->ic_ifp; struct atw_softc *sc = ifp->if_softc; - enum ieee80211_state ostate; int error = 0; - ostate = ic->ic_state; callout_stop(&sc->sc_scan_ch); switch (nstate) { @@ -3452,7 +3449,7 @@ atw_start(struct ifnet *ifp) struct atw_frame *hh; uint16_t hdrctl; struct mbuf *m0, *m; - struct atw_txsoft *txs, *last_txs; + struct atw_txsoft *txs; struct atw_txdesc *txd; int npkt, rate; bus_dmamap_t dmamap; @@ -3805,8 +3802,6 @@ atw_start(struct ifnet *ifp) SIMPLEQ_REMOVE_HEAD(&sc->sc_txfreeq, txs_q); SIMPLEQ_INSERT_TAIL(&sc->sc_txdirtyq, txs, txs_q); - - last_txs = txs; } if (sc->sc_txfree != ofree) { Index: src/sys/dev/ic/bwi.c diff -u src/sys/dev/ic/bwi.c:1.22 src/sys/dev/ic/bwi.c:1.23 --- src/sys/dev/ic/bwi.c:1.22 Wed Apr 25 01:14:05 2012 +++ src/sys/dev/ic/bwi.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bwi.c,v 1.22 2012/04/25 05:14:05 nakayama Exp $ */ +/* $NetBSD: bwi.c,v 1.23 2013/10/17 21:24:24 christos Exp $ */ /* $OpenBSD: bwi.c,v 1.74 2008/02/25 21:13:30 mglocker Exp $ */ /* @@ -48,7 +48,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.22 2012/04/25 05:14:05 nakayama Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.23 2013/10/17 21:24:24 christos Exp $"); #include <sys/param.h> #include <sys/callout.h> @@ -5320,7 +5320,7 @@ bwi_rf_calc_nrssi_slope_11b(struct bwi_m struct bwi_phy *phy = &mac->mac_phy; uint16_t save_rf[SAVE_RF_MAX]; uint16_t save_phy[SAVE_PHY_MAX]; - uint16_t ant_div, bbp_atten, chan_ex; + uint16_t ant_div, chan_ex; int16_t nrssi[2]; int i; @@ -5333,7 +5333,7 @@ bwi_rf_calc_nrssi_slope_11b(struct bwi_m save_phy[i] = PHY_READ(mac, save_phy_regs[i]); ant_div = CSR_READ_2(sc, BWI_RF_ANTDIV); - bbp_atten = CSR_READ_2(sc, BWI_BBP_ATTEN); + (void)CSR_READ_2(sc, BWI_BBP_ATTEN); chan_ex = CSR_READ_2(sc, BWI_RF_CHAN_EX); /* @@ -9338,13 +9338,13 @@ bwi_txeof(struct bwi_softc *sc) struct ifnet *ifp = &sc->sc_if; for (;;) { - uint32_t tx_status0, tx_status1; + uint32_t tx_status0; uint16_t tx_id, tx_info; tx_status0 = CSR_READ_4(sc, BWI_TXSTATUS_0); if ((tx_status0 & BWI_TXSTATUS_0_MORE) == 0) break; - tx_status1 = CSR_READ_4(sc, BWI_TXSTATUS_1); + (void)CSR_READ_4(sc, BWI_TXSTATUS_1); tx_id = __SHIFTOUT(tx_status0, BWI_TXSTATUS_0_TXID_MASK); tx_info = BWI_TXSTATUS_0_INFO(tx_status0); Index: src/sys/dev/ic/mfi.c diff -u src/sys/dev/ic/mfi.c:1.49 src/sys/dev/ic/mfi.c:1.50 --- src/sys/dev/ic/mfi.c:1.49 Fri Jun 28 10:46:44 2013 +++ src/sys/dev/ic/mfi.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: mfi.c,v 1.49 2013/06/28 14:46:44 christos Exp $ */ +/* $NetBSD: mfi.c,v 1.50 2013/10/17 21:24:24 christos Exp $ */ /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */ /* @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.49 2013/06/28 14:46:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.50 2013/10/17 21:24:24 christos Exp $"); #include "bio.h" @@ -2340,7 +2340,6 @@ mfi_ioctl_setstate(struct mfi_softc *sc, struct mfi_pd_list *pd; int i, found, rv = EINVAL; uint8_t mbox[MFI_MBOX_SIZE]; - uint32_t cmd; DNPRINTF(MFI_D_IOCTL, "%s: mfi_ioctl_setstate %x\n", DEVNAME(sc), bs->bs_status); @@ -2368,21 +2367,17 @@ mfi_ioctl_setstate(struct mfi_softc *sc, switch (bs->bs_status) { case BIOC_SSONLINE: mbox[2] = MFI_PD_ONLINE; - cmd = MD_DCMD_PD_SET_STATE; break; case BIOC_SSOFFLINE: mbox[2] = MFI_PD_OFFLINE; - cmd = MD_DCMD_PD_SET_STATE; break; case BIOC_SSHOTSPARE: mbox[2] = MFI_PD_HOTSPARE; - cmd = MD_DCMD_PD_SET_STATE; break; /* case BIOC_SSREBUILD: - cmd = MD_DCMD_PD_REBUILD; break; */ default: @@ -3501,9 +3496,6 @@ mfifopen(dev_t dev, int flag, int mode, static int mfifclose(dev_t dev, int flag, int mode, struct lwp *l) { - struct mfi_softc *sc; - - sc = device_lookup_private(&mfi_cd, minor(dev)); return (0); } Index: src/sys/dev/ic/mtd803.c diff -u src/sys/dev/ic/mtd803.c:1.27 src/sys/dev/ic/mtd803.c:1.28 --- src/sys/dev/ic/mtd803.c:1.27 Sat Oct 27 13:18:22 2012 +++ src/sys/dev/ic/mtd803.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: mtd803.c,v 1.27 2012/10/27 17:18:22 chs Exp $ */ +/* $NetBSD: mtd803.c,v 1.28 2013/10/17 21:24:24 christos Exp $ */ /*- * @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.27 2012/10/27 17:18:22 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.28 2013/10/17 21:24:24 christos Exp $"); #include <sys/param.h> @@ -460,7 +460,6 @@ mtd_start(struct ifnet *ifp) { struct mtd_softc *sc = ifp->if_softc; struct mbuf *m; - int len; int first_tx = sc->cur_tx; /* Don't transmit when the interface is busy or inactive */ @@ -476,7 +475,7 @@ mtd_start(struct ifnet *ifp) bpf_mtap(ifp, m); /* Copy mbuf chain into tx buffer */ - len = mtd_put(sc, sc->cur_tx, m); + (void)mtd_put(sc, sc->cur_tx, m); if (sc->cur_tx != first_tx) sc->desc[MTD_NUM_RXD + sc->cur_tx].stat = MTD_TXD_OWNER; Index: src/sys/dev/ic/rtw.c diff -u src/sys/dev/ic/rtw.c:1.119 src/sys/dev/ic/rtw.c:1.120 --- src/sys/dev/ic/rtw.c:1.119 Mon Jul 4 12:06:17 2011 +++ src/sys/dev/ic/rtw.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rtw.c,v 1.119 2011/07/04 16:06:17 joerg Exp $ */ +/* $NetBSD: rtw.c,v 1.120 2013/10/17 21:24:24 christos Exp $ */ /*- * Copyright (c) 2004, 2005, 2006, 2007 David Young. All rights * reserved. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.119 2011/07/04 16:06:17 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.120 2013/10/17 21:24:24 christos Exp $"); #include <sys/param.h> @@ -830,7 +830,6 @@ rtw_srom_parse(struct rtw_srom *sr, uint const char *rfname, *paname; char scratch[sizeof("unknown 0xXX")]; uint16_t srom_version; - uint8_t mac[IEEE80211_ADDR_LEN]; *flags &= ~(RTW_F_DIGPHY|RTW_F_DFLANTB|RTW_F_ANTDIV); *rcr &= ~(RTW_RCR_ENCS1 | RTW_RCR_ENCS2); @@ -849,8 +848,10 @@ rtw_srom_parse(struct rtw_srom *sr, uint srom_version >> 8, srom_version & 0xff); } + uint8_t mac[IEEE80211_ADDR_LEN]; for (i = 0; i < IEEE80211_ADDR_LEN; i++) mac[i] = RTW_SR_GET(sr, RTW_SR_MAC + i); + __USE(mac); RTW_DPRINTF(RTW_DEBUG_ATTACH, ("%s: EEPROM MAC %s\n", device_xname(dev), ether_sprintf(mac))); @@ -1054,9 +1055,13 @@ rtw_set_rfprog(struct rtw_regs *regs, en RTW_WBR(regs, RTW_CONFIG4, RTW_CONFIG4); +#ifdef RTW_DEBUG RTW_DPRINTF(RTW_DEBUG_INIT, ("%s: %s RF programming method, %#02x\n", device_xname(dev), method, RTW_READ8(regs, RTW_CONFIG4))); +#else + __USE(method); +#endif } static inline void @@ -1375,12 +1380,17 @@ rtw_rxdesc_init(struct rtw_rxdesc_blk *r octl = rd->rd_ctl; rd->rd_ctl = htole32(ctl); +#ifdef RTW_DEBUG RTW_DPRINTF( kick ? (RTW_DEBUG_RECV_DESC | RTW_DEBUG_IO_KICK) : RTW_DEBUG_RECV_DESC, ("%s: rd %p buf %08x -> %08x ctl %08x -> %08x\n", __func__, rd, le32toh(obuf), le32toh(rd->rd_buf), le32toh(octl), le32toh(rd->rd_ctl))); +#else + __USE(octl); + __USE(obuf); +#endif /* sync the descriptor */ bus_dmamap_sync(rdb->rdb_dmat, rdb->rdb_dmamap, @@ -1392,11 +1402,9 @@ static void rtw_rxdesc_init_all(struct rtw_rxdesc_blk *rdb, struct rtw_rxsoft *ctl, int kick) { int i; - struct rtw_rxdesc *rd; struct rtw_rxsoft *rs; for (i = 0; i < rdb->rdb_ndesc; i++) { - rd = &rdb->rdb_desc[i]; rs = &ctl[i]; rtw_rxdesc_init(rdb, rs, i, kick); } @@ -1730,10 +1738,14 @@ rtw_collect_txpkt(struct rtw_softc *sc, condstring = "error"; } +#ifdef RTW_DEBUG DPRINTF(sc, RTW_DEBUG_XMIT_DESC, ("%s: ts %p txdesc[%d, %d] %s tries rts %u data %u\n", device_xname(sc->sc_dev), ts, ts->ts_first, ts->ts_last, condstring, rts_retry, data_retry)); +#else + __USE(condstring); +#endif } static void @@ -1864,11 +1876,17 @@ rtw_intr_beacon(struct rtw_softc *sc, ui if ((isr & (RTW_INTR_TBDOK|RTW_INTR_TBDER)) != 0) { next = rtw_txring_next(&sc->sc_regs, tdb); +#ifdef RTW_DEBUG RTW_DPRINTF(RTW_DEBUG_BEACON, ("%s: beacon ring %sprocessed, isr = %#04" PRIx16 ", next %u expected %u, %" PRIu64 "\n", __func__, (next == tdb->tdb_next) ? "" : "un", isr, next, tdb->tdb_next, (uint64_t)tsfth << 32 | tsftl)); +#else + __USE(next); + __USE(tsfth); + __USE(tsftl); +#endif if ((RTW_READ8(&sc->sc_regs, RTW_TPPOLL) & RTW_TPPOLL_BQ) == 0) rtw_collect_txring(sc, tsb, tdb, 1); } @@ -2104,9 +2122,13 @@ rtw_resume_ticks(struct rtw_softc *sc) sc->sc_do_tick = 1; +#ifdef RTW_DEBUG RTW_DPRINTF(RTW_DEBUG_TIMEOUT, ("%s: resume ticks delta %#08x now %#08x next %#08x\n", device_xname(sc->sc_dev), tsftrl1 - tsftrl0, tsftrl1, next_tint)); +#else + __USE(tsftrl0); +#endif } static void Index: src/sys/dev/ic/sl811hs.c diff -u src/sys/dev/ic/sl811hs.c:1.46 src/sys/dev/ic/sl811hs.c:1.47 --- src/sys/dev/ic/sl811hs.c:1.46 Fri Oct 4 17:10:18 2013 +++ src/sys/dev/ic/sl811hs.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sl811hs.c,v 1.46 2013/10/04 21:10:18 joerg Exp $ */ +/* $NetBSD: sl811hs.c,v 1.47 2013/10/17 21:24:24 christos Exp $ */ /* * Not (c) 2007 Matthew Orgass @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.46 2013/10/04 21:10:18 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.47 2013/10/17 21:24:24 christos Exp $"); #include "opt_slhci.h" @@ -1365,11 +1365,9 @@ slhci_close(struct usbd_pipe *pipe) { struct slhci_softc *sc; struct slhci_pipe *spipe; - struct slhci_transfers *t; sc = pipe->device->bus->hci_private; spipe = (struct slhci_pipe *)pipe; - t = &sc->sc_transfers; DLOG(D_TRACE, "%s close spipe %p spipe->xfer %p", pnames(spipe->ptype), spipe, spipe->xfer, 0); @@ -1597,7 +1595,7 @@ waitcheck: #define BSB(a, b, c, d, e) bus_space_barrier(a, b, c, d, BUS_SPACE_BARRIER_ # e) #define BSB_SYNC(a, b, c, d) bus_space_barrier(a, b, c, d, BUS_SPACE_BARRIER_SYNC) #else /* now !SLHCI_BUS_SPACE_BARRIERS */ -#define BSB(a, b, c, d, e) +#define BSB(a, b, c, d, e) __USE(d) #define BSB_SYNC(a, b, c, d) #endif /* SLHCI_BUS_SPACE_BARRIERS */ @@ -2621,10 +2619,8 @@ static usbd_status slhci_close_pipe(struct slhci_softc *sc, struct slhci_pipe *spipe, struct usbd_xfer *xfer) { - struct slhci_transfers *t; struct usbd_pipe *pipe; - t = &sc->sc_transfers; pipe = &spipe->pipe; if (pipe->interval && spipe->ptype != PT_ROOT_INTR) Index: src/sys/dev/ic/spic.c diff -u src/sys/dev/ic/spic.c:1.18 src/sys/dev/ic/spic.c:1.19 --- src/sys/dev/ic/spic.c:1.18 Wed Apr 21 17:49:53 2010 +++ src/sys/dev/ic/spic.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: spic.c,v 1.18 2010/04/21 21:49:53 dyoung Exp $ */ +/* $NetBSD: spic.c,v 1.19 2013/10/17 21:24:24 christos Exp $ */ /* * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -49,7 +49,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spic.c,v 1.18 2010/04/21 21:49:53 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spic.c,v 1.19 2013/10/17 21:24:24 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -113,11 +113,11 @@ static const struct wsmouse_accessops sp static u_int8_t spic_call1(struct spic_softc *sc, u_int8_t dev) { - u_int8_t v1, v2; + u_int8_t v2; SPIC_COMMAND(0, INB(sc, SPIC_PORT2) & 2); OUTB(sc, dev, SPIC_PORT2); - v1 = INB(sc, SPIC_PORT2); + (void)INB(sc, SPIC_PORT2); v2 = INB(sc, SPIC_PORT1); return v2; } Index: src/sys/dev/ic/tpm.c diff -u src/sys/dev/ic/tpm.c:1.8 src/sys/dev/ic/tpm.c:1.9 --- src/sys/dev/ic/tpm.c:1.8 Sat Sep 14 09:09:55 2013 +++ src/sys/dev/ic/tpm.c Thu Oct 17 17:24:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: tpm.c,v 1.8 2013/09/14 13:09:55 joerg Exp $ */ +/* $NetBSD: tpm.c,v 1.9 2013/10/17 21:24:24 christos Exp $ */ /* * Copyright (c) 2008, 2009 Michael Shalayeff * Copyright (c) 2009, 2010 Hans-Jörg Höxer @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.8 2013/09/14 13:09:55 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.9 2013/10/17 21:24:24 christos Exp $"); #if 0 #define TPM_DEBUG @@ -855,7 +855,6 @@ int tpm_legacy_init(struct tpm_softc *sc, int irq, const char *name) { char id[8]; - uint8_t ioh, iol; int i; if ((i = bus_space_map(sc->sc_batm, tpm_enabled, 2, 0, &sc->sc_bahm))) { @@ -870,8 +869,6 @@ tpm_legacy_init(struct tpm_softc *sc, in aprint_debug_dev(sc->sc_dev, "%.4s %d.%d @0x%x\n", &id[4], id[0], id[1], tpm_enabled); - iol = tpm_enabled & 0xff; - ioh = tpm_enabled >> 16; tpm_enabled = 0; return 0;