diff --git a/sys/dev/ic/aic79xx.c b/sys/dev/ic/aic79xx.c index a66da031a0cb..4c4afc2f43e1 100644 --- a/sys/dev/ic/aic79xx.c +++ b/sys/dev/ic/aic79xx.c @@ -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 -__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 #include @@ -1025,9 +1025,10 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) { 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, u_int intstat) 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_softc *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_softc *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 *ahd) 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 target, char channel, 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, int target, char channel, 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 *ahd, struct scb *scb) 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 *ahd, struct scb *scb) 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 --git a/sys/dev/ic/aic79xx_osm.c b/sys/dev/ic/aic79xx_osm.c index 72dd90e3123b..db535e4616d0 100644 --- a/sys/dev/ic/aic79xx_osm.c +++ b/sys/dev/ic/aic79xx_osm.c @@ -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 -__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 #include @@ -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); diff --git a/sys/dev/ic/arn5008.c b/sys/dev/ic/arn5008.c index da4477c2d933..2bff5181f7b5 100644 --- a/sys/dev/ic/arn5008.c +++ b/sys/dev/ic/arn5008.c @@ -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 -__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 #include @@ -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); diff --git a/sys/dev/ic/arn9003.c b/sys/dev/ic/arn9003.c index 6fcbea4fbbc7..fdb9b40f61b8 100644 --- a/sys/dev/ic/arn9003.c +++ b/sys/dev/ic/arn9003.c @@ -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 -__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 #include @@ -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) { diff --git a/sys/dev/ic/arn9285.c b/sys/dev/ic/arn9285.c index 7b4662eb5e95..69790ae74487 100644 --- a/sys/dev/ic/arn9285.c +++ b/sys/dev/ic/arn9285.c @@ -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 -__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 *c, 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, diff --git a/sys/dev/ic/arn9287.c b/sys/dev/ic/arn9287.c index 5a168d0536a3..477fab29db1e 100644 --- a/sys/dev/ic/arn9287.c +++ b/sys/dev/ic/arn9287.c @@ -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 -__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 #include @@ -433,21 +433,25 @@ ar9287_set_txpower(struct athn_softc *sc, struct ieee80211_channel *c, 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 diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c index 5974fd1da139..71dfe7f5bd70 100644 --- a/sys/dev/ic/athn.c +++ b/sys/dev/ic/athn.c @@ -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 -__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 *sc) 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 *sc) 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 */ diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index 76941d9bd0a0..bb778e9161e1 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -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 -__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 @@ -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, enum ieee80211_state nstate, int arg) { 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) { diff --git a/sys/dev/ic/bwi.c b/sys/dev/ic/bwi.c index d9a751e8472c..634c5d38caf2 100644 --- a/sys/dev/ic/bwi.c +++ b/sys/dev/ic/bwi.c @@ -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 -__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 #include @@ -5320,7 +5320,7 @@ bwi_rf_calc_nrssi_slope_11b(struct bwi_mac *mac) 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_mac *mac) 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); diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 0d69d7f3635c..1ed754ffea20 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -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 -__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 *chan, scsipi_adapter_req_t req, 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 *chan, scsipi_adapter_req_t req, break; } - error = 0; xs->error = XS_NOERROR; /* XXX emulate SYNCHRONIZE_CACHE ??? */ diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index 3673d26ad1a1..8bf8819fc59d 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -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 -__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 bioc_setstate *bs) 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, struct bioc_setstate *bs) 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, struct lwp *l) 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); } diff --git a/sys/dev/ic/mtd803.c b/sys/dev/ic/mtd803.c index d7f2e750af31..267198ac7a58 100644 --- a/sys/dev/ic/mtd803.c +++ b/sys/dev/ic/mtd803.c @@ -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 -__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 @@ -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; diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c index 9ebe8a77f49c..9844dc41f514 100644 --- a/sys/dev/ic/rtw.c +++ b/sys/dev/ic/rtw.c @@ -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 -__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 @@ -830,7 +830,6 @@ rtw_srom_parse(struct rtw_srom *sr, uint32_t *flags, uint8_t *cs_threshold, 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, uint32_t *flags, uint8_t *cs_threshold, 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, enum rtw_rfchipid rfchipid, 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 *rdb, struct rtw_rxsoft *rs, 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, struct rtw_txdesc_blk *tdb, 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, uint16_t isr) 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 diff --git a/sys/dev/ic/sl811hs.c b/sys/dev/ic/sl811hs.c index 4e967a60ebfd..12f2de58129f 100644 --- a/sys/dev/ic/sl811hs.c +++ b/sys/dev/ic/sl811hs.c @@ -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 -__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) diff --git a/sys/dev/ic/spic.c b/sys/dev/ic/spic.c index 2f911a887274..68e3a9f3f1d4 100644 --- a/sys/dev/ic/spic.c +++ b/sys/dev/ic/spic.c @@ -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 -__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 #include @@ -113,11 +113,11 @@ static const struct wsmouse_accessops spic_accessops = { 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; } diff --git a/sys/dev/ic/tpm.c b/sys/dev/ic/tpm.c index e15f174c8fab..d8fea740e272 100644 --- a/sys/dev/ic/tpm.c +++ b/sys/dev/ic/tpm.c @@ -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 -__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, int irq, const char *name) 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;