- remove unused variables

- move ifdef variables inside ifdef sections
This commit is contained in:
christos 2013-10-17 21:07:37 +00:00
parent c26593e016
commit 415c6c7ed0
3 changed files with 19 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_otus.c,v 1.24 2013/03/30 14:14:31 christos Exp $ */
/* $NetBSD: if_otus.c,v 1.25 2013/10/17 21:07:37 christos Exp $ */
/* $OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $ */
/*-
@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.24 2013/03/30 14:14:31 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.25 2013/10/17 21:07:37 christos Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@ -889,14 +889,15 @@ Static void
otus_get_chanlist(struct otus_softc *sc)
{
struct ieee80211com *ic;
uint16_t domain;
uint8_t chan;
int i;
#ifdef OTUS_DEBUG
/* XXX regulatory domain. */
domain = le16toh(sc->sc_eeprom.baseEepHeader.regDmn[0]);
uint16_t domain = le16toh(sc->sc_eeprom.baseEepHeader.regDmn[0]);
DPRINTFN(DBG_FN|DBG_INIT, sc, "regdomain=0x%04x\n", domain);
#endif
ic = &sc->sc_ic;
if (sc->sc_eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11G) {
@ -1335,19 +1336,20 @@ otus_newstate_cb(struct otus_softc *sc, void *arg)
struct otus_cmd_newstate *cmd;
struct ieee80211com *ic;
struct ieee80211_node *ni;
enum ieee80211_state ostate;
enum ieee80211_state nstate;
int s;
cmd = arg;
ic = &sc->sc_ic;
ni = ic->ic_bss;
ostate = ic->ic_state;
nstate = cmd->state;
#ifdef OTUS_DEBUG
enum ieee80211_state ostate = ostate = ic->ic_state;
DPRINTFN(DBG_FN|DBG_STM, sc, "%s(%d)->%s(%d)\n",
ieee80211_state_name[ostate], ostate,
ieee80211_state_name[nstate], nstate);
#endif
s = splnet();
@ -2195,7 +2197,6 @@ otus_ioctl(struct ifnet *ifp, u_long cmd, void *data)
{
struct otus_softc *sc;
struct ieee80211com *ic;
struct ifaddr *ifa;
int s, error = 0;
sc = ifp->if_softc;
@ -2208,9 +2209,9 @@ otus_ioctl(struct ifnet *ifp, u_long cmd, void *data)
switch (cmd) {
case SIOCSIFADDR:
ifa = (void *)data;
ifp->if_flags |= IFF_UP;
#ifdef INET
struct ifaddr *ifa = data;
if (ifa->ifa_addr->sa_family == AF_INET)
arp_ifinit(&ic->ic_ac, ifa);
#endif
@ -2788,21 +2789,23 @@ otus_get_delta_slope(uint32_t coeff, uint32_t *exponent, uint32_t *mantissa)
Static int
otus_set_chan(struct otus_softc *sc, struct ieee80211_channel *c, int assoc)
{
struct ieee80211com *ic;
struct ar_cmd_frequency cmd;
struct ar_rsp_frequency rsp;
const uint32_t *vals;
uint32_t coeff, exp, man, tmp;
uint8_t code;
int error, chan, i;
int error, i;
DPRINTFN(DBG_FN, sc, "\n");
ic = &sc->sc_ic;
chan = ieee80211_chan2ieee(ic, c);
#ifdef OTUS_DEBUG
struct ieee80211com *ic = &sc->sc_ic;
int chan = ieee80211_chan2ieee(ic, c);
DPRINTFN(DBG_CHAN, sc, "setting channel %d (%dMHz)\n",
chan, c->ic_freq);
#endif
tmp = IEEE80211_IS_CHAN_2GHZ(c) ? 0x105 : 0x104;
otus_write(sc, AR_MAC_REG_DYNAMIC_SIFS_ACK, tmp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_urndis.c,v 1.5 2013/03/30 03:15:53 christos Exp $ */
/* $NetBSD: if_urndis.c,v 1.6 2013/10/17 21:07:37 christos Exp $ */
/* $OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */
/*
@ -21,7 +21,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.5 2013/03/30 03:15:53 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.6 2013/10/17 21:07:37 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -968,11 +968,9 @@ static int
urndis_ioctl(struct ifnet *ifp, unsigned long command, void *data)
{
struct urndis_softc *sc;
struct ifaddr *ifa;
int s, error;
sc = ifp->if_softc;
ifa = (struct ifaddr *)data;
error = 0;
if (sc->sc_dying)

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvideo.c,v 1.38 2013/01/05 01:30:18 christos Exp $ */
/* $NetBSD: uvideo.c,v 1.39 2013/10/17 21:07:37 christos Exp $ */
/*
* Copyright (c) 2008 Patrick Mahoney
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.38 2013/01/05 01:30:18 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.39 2013/10/17 21:07:37 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_uvideo.h"
@ -880,10 +880,8 @@ uvideo_unit_init(struct uvideo_unit *vu, const uvideo_descriptor_t *desc)
{
struct uvideo_camera_terminal *ct;
struct uvideo_processing_unit *pu;
struct uvideo_extension_unit *xu;
const uvideo_input_terminal_descriptor_t *input;
const uvideo_output_terminal_descriptor_t *output;
const uvideo_camera_terminal_descriptor_t *camera;
const uvideo_selector_unit_descriptor_t *selector;
const uvideo_processing_unit_descriptor_t *processing;
@ -918,7 +916,6 @@ uvideo_unit_init(struct uvideo_unit *vu, const uvideo_descriptor_t *desc)
}
break;
case UDESC_OUTPUT_TERMINAL:
output = (const uvideo_output_terminal_descriptor_t *)desc;
break;
case UDESC_SELECTOR_UNIT:
selector = (const uvideo_selector_unit_descriptor_t *)desc;
@ -939,7 +936,6 @@ uvideo_unit_init(struct uvideo_unit *vu, const uvideo_descriptor_t *desc)
break;
case UDESC_EXTENSION_UNIT:
extension = (const uvideo_extension_unit_descriptor_t *)desc;
xu = &vu->u.vu_extension;
/* TODO: copy guid */
uvideo_unit_alloc_sources(vu, extension->bNrInPins,
@ -1803,7 +1799,6 @@ uvideo_stream_recv_isoc_complete(usbd_xfer_handle xfer,
struct uvideo_isoc *isoc;
int i;
uint32_t count;
const uvideo_payload_header_t *hdr;
uint8_t *buf;
isoc = priv;
@ -1826,7 +1821,6 @@ uvideo_stream_recv_isoc_complete(usbd_xfer_handle xfer,
goto next;
}
hdr = (const uvideo_payload_header_t *)isoc->i_buf;
for (i = 0, buf = isoc->i_buf;
i < ix->ix_nframes;
@ -1980,7 +1974,6 @@ uvideo_set_format(void *addr, struct video_format *format)
struct uvideo_stream *vs;
struct uvideo_format *uvfmt;
uvideo_probe_and_commit_data_t probe, maxprobe;
uint8_t ifaceno;
usbd_status err;
sc = addr;
@ -1990,7 +1983,6 @@ uvideo_set_format(void *addr, struct video_format *format)
return EIO;
vs = sc->sc_stream_in;
ifaceno = vs->vs_ifaceno;
uvfmt = uvideo_stream_guess_format(vs, format->pixel_format,
format->width, format->height);