Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb - remove unused variables
details: https://anonhg.NetBSD.org/src/rev/bb485496545c
branches: trunk
changeset: 790576:bb485496545c
user: christos <christos%NetBSD.org@localhost>
date: Thu Oct 17 21:07:37 2013 +0000
description:
- remove unused variables
- move ifdef variables inside ifdef sections
diffstat:
sys/dev/usb/if_otus.c | 27 +++++++++++++++------------
sys/dev/usb/if_urndis.c | 6 ++----
sys/dev/usb/uvideo.c | 12 ++----------
3 files changed, 19 insertions(+), 26 deletions(-)
diffs (213 lines):
diff -r f29a076be8f3 -r bb485496545c sys/dev/usb/if_otus.c
--- a/sys/dev/usb/if_otus.c Thu Oct 17 21:06:47 2013 +0000
+++ b/sys/dev/usb/if_otus.c Thu Oct 17 21:07:37 2013 +0000
@@ -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 @@
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 @@
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 @@
{
struct otus_softc *sc;
struct ieee80211com *ic;
- struct ifaddr *ifa;
int s, error = 0;
sc = ifp->if_softc;
@@ -2208,9 +2209,9 @@
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 @@
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);
diff -r f29a076be8f3 -r bb485496545c sys/dev/usb/if_urndis.c
--- a/sys/dev/usb/if_urndis.c Thu Oct 17 21:06:47 2013 +0000
+++ b/sys/dev/usb/if_urndis.c Thu Oct 17 21:07:37 2013 +0000
@@ -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 @@
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)
diff -r f29a076be8f3 -r bb485496545c sys/dev/usb/uvideo.c
--- a/sys/dev/usb/uvideo.c Thu Oct 17 21:06:47 2013 +0000
+++ b/sys/dev/usb/uvideo.c Thu Oct 17 21:07:37 2013 +0000
@@ -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 @@
{
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 @@
}
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 @@
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 @@
struct uvideo_isoc *isoc;
int i;
uint32_t count;
- const uvideo_payload_header_t *hdr;
uint8_t *buf;
isoc = priv;
@@ -1826,7 +1821,6 @@
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 @@
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 @@
return EIO;
vs = sc->sc_stream_in;
- ifaceno = vs->vs_ifaceno;
uvfmt = uvideo_stream_guess_format(vs, format->pixel_format,
format->width, format->height);
Home |
Main Index |
Thread Index |
Old Index