summaryrefslogtreecommitdiff
path: root/drivers/dahdi
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-06-02 20:00:36 +0000
committerShaun Ruffell <sruffell@digium.com>2011-06-02 20:00:36 +0000
commitf6ad12112070dcf07952a04f53f35060fcee5ac9 (patch)
tree3878c6f64274cf0d0cd5eafd5b4b98e050b09d9a /drivers/dahdi
parent92bdc098861b2c8e817bb778afe6de171dc14d8b (diff)
Remove unused variables.
gcc-4.6 now warns about variables that are set but never used. Clean up unused variables everywhere except the oct612x subdirectory. The oct612x should go in a separate patch in case that needs to be pulled out into a separate project again. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9929 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi')
-rw-r--r--drivers/dahdi/dahdi-base.c7
-rw-r--r--drivers/dahdi/tor2.c2
-rw-r--r--drivers/dahdi/wcb4xxp/base.c3
-rw-r--r--drivers/dahdi/wct4xxp/base.c5
-rw-r--r--drivers/dahdi/wct4xxp/vpm450m.c3
-rw-r--r--drivers/dahdi/wctc4xxp/base.c2
-rw-r--r--drivers/dahdi/wctdm.c2
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c3
-rw-r--r--drivers/dahdi/wctdm24xxp/xhfc.c6
-rw-r--r--drivers/dahdi/wcte12xp/base.c3
-rw-r--r--drivers/dahdi/xpp/card_bri.c15
-rw-r--r--drivers/dahdi/xpp/card_fxo.c6
-rw-r--r--drivers/dahdi/xpp/card_fxs.c5
-rw-r--r--drivers/dahdi/xpp/card_pri.c10
-rw-r--r--drivers/dahdi/xpp/xbus-core.c2
-rw-r--r--drivers/dahdi/xpp/xpp_dahdi.c5
-rw-r--r--drivers/dahdi/xpp/xpp_usb.c4
17 files changed, 7 insertions, 76 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index f62d221..e959570 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -5196,7 +5196,6 @@ static int dahdi_ioctl_confdiag(struct file *file, unsigned long data)
{
struct dahdi_chan *chan;
unsigned long flags;
- int rv;
int i;
int j;
int c;
@@ -5240,7 +5239,6 @@ static int dahdi_ioctl_confdiag(struct file *file, unsigned long data)
pseudo->chan.channo, pseudo->chan.confmode);
}
spin_unlock_irqrestore(&chan_lock, flags);
- rv = 0;
if (c)
module_printk(KERN_NOTICE, "\n");
}
@@ -7714,7 +7712,7 @@ static void process_echocan_events(struct dahdi_chan *chan)
static void
__dahdi_ec_chunk(struct dahdi_chan *ss, u8 *rxchunk, const u8 *txchunk)
{
- short rxlin, txlin;
+ short rxlin;
int x;
if (ss->readchunkpreec) {
@@ -7733,7 +7731,6 @@ __dahdi_ec_chunk(struct dahdi_chan *ss, u8 *rxchunk, const u8 *txchunk)
/* Special stuff for training the echo can */
for (x=0;x<DAHDI_CHUNKSIZE;x++) {
rxlin = DAHDI_XLAW(rxchunk[x], ss);
- txlin = DAHDI_XLAW(txchunk[x], ss);
if (ss->ec_state->status.mode == ECHO_MODE_PRETRAINING) {
if (--ss->ec_state->status.pretrain_timer <= 0) {
ss->ec_state->status.pretrain_timer = 0;
@@ -8449,7 +8446,6 @@ void dahdi_hdlc_abort(struct dahdi_chan *ss, int event)
void dahdi_hdlc_putbuf(struct dahdi_chan *ss, unsigned char *rxb, int bytes)
{
unsigned long flags;
- int res;
int left;
spin_lock_irqsave(&ss->lock, flags);
@@ -8477,7 +8473,6 @@ void dahdi_hdlc_putbuf(struct dahdi_chan *ss, unsigned char *rxb, int bytes)
#endif
__dahdi_hdlc_abort(ss, DAHDI_EVENT_OVERRUN);
}
- res = left;
spin_unlock_irqrestore(&ss->lock, flags);
}
diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c
index 1babb4f..fd96f9e 100644
--- a/drivers/dahdi/tor2.c
+++ b/drivers/dahdi/tor2.c
@@ -621,7 +621,7 @@ err_out_free_tor:
if (tor) {
free_tor(tor);
}
- return -ENODEV;
+ return ret;
}
static struct pci_driver tor2_driver;
diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c
index 7ee6238..b8c684b 100644
--- a/drivers/dahdi/wcb4xxp/base.c
+++ b/drivers/dahdi/wcb4xxp/base.c
@@ -2603,13 +2603,12 @@ DAHDI_IRQ_HANDLER(b4xxp_interrupt)
static void b4xxp_bottom_half(unsigned long data)
{
struct b4xxp *b4 = (struct b4xxp *)data;
- int i, j, k, gotrxfifo, fifo, fifo_low, fifo_high;
+ int i, j, k, fifo, fifo_low, fifo_high;
unsigned char b, b2;
if (b4->shutdown)
return;
- gotrxfifo = 0;
/* HFC-4S d-chan fifos 8-11 *** HFC-8S d-chan fifos 16-23 */
if (b4->numspans == 8) {
fifo_low = 16;
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c
index 97a1f3c..78e7d0a 100644
--- a/drivers/dahdi/wct4xxp/base.c
+++ b/drivers/dahdi/wct4xxp/base.c
@@ -4140,7 +4140,6 @@ static int t4_vpm_echotail(void)
static void t4_vpm450_init(struct t4 *wc)
{
- unsigned int check1, check2;
int laws[4] = { 0, };
int x;
unsigned int vpm_capacity;
@@ -4165,8 +4164,8 @@ static void t4_vpm450_init(struct t4 *wc)
t4_gpio_setdir(wc, (1 << 24), (1 << 24));
__t4_raw_oct_out(wc, 0x000a, 0x5678);
__t4_raw_oct_out(wc, 0x0004, 0x1234);
- check1 = __t4_raw_oct_in(wc, 0x0004);
- check2 = __t4_raw_oct_in(wc, 0x000a);
+ __t4_raw_oct_in(wc, 0x0004);
+ __t4_raw_oct_in(wc, 0x000a);
if (debug)
dev_notice(&wc->dev->dev, "OCT Result: %04x/%04x\n",
__t4_raw_oct_in(wc, 0x0004),
diff --git a/drivers/dahdi/wct4xxp/vpm450m.c b/drivers/dahdi/wct4xxp/vpm450m.c
index b72343b..a44597d 100644
--- a/drivers/dahdi/wct4xxp/vpm450m.c
+++ b/drivers/dahdi/wct4xxp/vpm450m.c
@@ -319,12 +319,11 @@ int vpm450m_getdtmf(struct vpm450m *vpm450m, int *channel, int *tone, int *start
{
tOCT6100_TONE_EVENT tonefound;
tOCT6100_EVENT_GET_TONE tonesearch;
- UINT32 ulResult;
Oct6100EventGetToneDef(&tonesearch);
tonesearch.pToneEvent = &tonefound;
tonesearch.ulMaxToneEvent = 1;
- ulResult = Oct6100EventGetTone(vpm450m->pApiInstance, &tonesearch);
+ Oct6100EventGetTone(vpm450m->pApiInstance, &tonesearch);
if (tonesearch.ulNumValidToneEvent) {
if (channel)
*channel = tonefound.ulUserChanId;
diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c
index 7264621..893a104 100644
--- a/drivers/dahdi/wctc4xxp/base.c
+++ b/drivers/dahdi/wctc4xxp/base.c
@@ -2868,7 +2868,6 @@ static int
wctc4xxp_load_firmware(struct wcdte *wc, const struct firmware *firmware)
{
unsigned int byteloc;
- unsigned int last_byteloc;
unsigned int length;
struct tcb *cmd;
@@ -2883,7 +2882,6 @@ wctc4xxp_load_firmware(struct wcdte *wc, const struct firmware *firmware)
#endif
while (byteloc < (firmware->size-20)) {
- last_byteloc = byteloc;
length = (firmware->data[byteloc] << 8) |
firmware->data[byteloc+1];
byteloc += 2;
diff --git a/drivers/dahdi/wctdm.c b/drivers/dahdi/wctdm.c
index 9c56865..01ae73e 100644
--- a/drivers/dahdi/wctdm.c
+++ b/drivers/dahdi/wctdm.c
@@ -619,13 +619,11 @@ static unsigned char wctdm_getreg(struct wctdm *wc, int card, unsigned char reg)
static int __wait_access(struct wctdm *wc, int card)
{
unsigned char data = 0;
- long origjiffies;
int count = 0;
#define MAX 6000 /* attempts */
- origjiffies = jiffies;
/* Wait for indirect access */
while (count++ < MAX)
{
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index aa12865..8f0d88f 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -288,13 +288,10 @@ static void
setchanconfig_from_state(struct vpmadt032 *vpm, int channel,
GpakChannelConfig_t *chanconfig)
{
- const struct vpmadt032_options *options;
GpakEcanParms_t *p;
BUG_ON(!vpm);
- options = &vpm->options;
-
chanconfig->PcmInPortA = 3;
chanconfig->PcmInSlotA = channel;
chanconfig->PcmOutPortA = SerialPortNull;
diff --git a/drivers/dahdi/wctdm24xxp/xhfc.c b/drivers/dahdi/wctdm24xxp/xhfc.c
index afa4b4d..fa63248 100644
--- a/drivers/dahdi/wctdm24xxp/xhfc.c
+++ b/drivers/dahdi/wctdm24xxp/xhfc.c
@@ -1676,11 +1676,9 @@ static void hfc_start_st(struct b400m_span *s)
static int hdlc_start(struct b400m *b4, int fifo);
static void hfc_init_all_st(struct b400m *b4)
{
- int i, gpio;
+ int i;
struct b400m_span *s;
- gpio = 0;
-
for (i = 0; i < 4; i++) {
s = &b4->spans[i];
s->parent = b4;
@@ -2519,7 +2517,6 @@ int wctdm_bri_checkisr(struct wctdm *wc, int modpos, int offset)
/* DAHDI calls this when it has data it wants to send to the HDLC controller */
void wctdm_hdlc_hard_xmit(struct dahdi_chan *chan)
{
- struct wctdm *wc;
struct b400m *b4;
struct b400m_span *bspan;
struct dahdi_span *dspan;
@@ -2528,7 +2525,6 @@ void wctdm_hdlc_hard_xmit(struct dahdi_chan *chan)
dspan = chan->span;
bspan = bspan_from_dspan(dspan);
b4 = bspan->parent;
- wc = b4->wc;
span = bspan->port;
if ((DBG_FOPS || DBG_HDLC) && DBG_SPANFILTER) {
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index e239f2c..4610eac 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -1329,13 +1329,10 @@ static void
setchanconfig_from_state(struct vpmadt032 *vpm, int channel,
GpakChannelConfig_t *chanconfig)
{
- const struct vpmadt032_options *options;
GpakEcanParms_t *p;
BUG_ON(!vpm);
- options = &vpm->options;
-
chanconfig->PcmInPortA = 3;
chanconfig->PcmInSlotA = (channel + 1) * 2;
chanconfig->PcmOutPortA = SerialPortNull;
diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c
index 014ae0a..7e4ae9a 100644
--- a/drivers/dahdi/xpp/card_bri.c
+++ b/drivers/dahdi/xpp/card_bri.c
@@ -344,14 +344,12 @@ static void layer1_state(xpd_t *xpd, bool up)
static void te_activation(xpd_t *xpd, bool on)
{
struct BRI_priv_data *priv;
- xbus_t *xbus;
byte curr_state;
BUG_ON(!xpd);
priv = xpd->priv;
BUG_ON(!priv);
curr_state = priv->state_register.bits.v_su_sta;
- xbus = xpd->xbus;
XPD_DBG(SIGNAL, xpd, "%s\n", (on)?"ON":"OFF");
if(on) {
if(curr_state == ST_TE_DEACTIVATED) {
@@ -389,14 +387,12 @@ static void te_activation(xpd_t *xpd, bool on)
static void nt_activation(xpd_t *xpd, bool on)
{
struct BRI_priv_data *priv;
- xbus_t *xbus;
byte curr_state;
BUG_ON(!xpd);
priv = xpd->priv;
BUG_ON(!priv);
curr_state = priv->state_register.bits.v_su_sta;
- xbus = xpd->xbus;
XPD_DBG(SIGNAL, xpd, "%s\n", (on)?"ON":"OFF");
if(on) {
switch(curr_state) {
@@ -541,7 +537,6 @@ static void bri_hdlc_finish(xpd_t *xpd, struct dahdi_chan *dchan)
#ifdef CONFIG_DAHDI_BRI_DCHANS
static int rx_dchan(xpd_t *xpd, reg_cmd_t *regcmd)
{
- xbus_t *xbus;
struct BRI_priv_data *priv;
byte *src;
byte *dst;
@@ -846,10 +841,7 @@ static int BRI_card_init(xbus_t *xbus, xpd_t *xpd)
static int BRI_card_remove(xbus_t *xbus, xpd_t *xpd)
{
- struct BRI_priv_data *priv;
-
BUG_ON(!xpd);
- priv = xpd->priv;
XPD_DBG(GENERAL, xpd, "\n");
bri_proc_remove(xbus, xpd);
return 0;
@@ -934,11 +926,9 @@ static int BRI_card_dahdi_preregistration(xpd_t *xpd, bool on)
static int BRI_card_dahdi_postregistration(xpd_t *xpd, bool on)
{
xbus_t *xbus;
- struct BRI_priv_data *priv;
BUG_ON(!xpd);
xbus = xpd->xbus;
- priv = xpd->priv;
BUG_ON(!xbus);
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
return(0);
@@ -1139,10 +1129,7 @@ static int BRI_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a
static int BRI_card_open(xpd_t *xpd, lineno_t pos)
{
- struct BRI_priv_data *priv;
-
BUG_ON(!xpd);
- priv = xpd->priv;
if(pos == 2) {
LINE_DBG(SIGNAL, xpd, pos, "OFFHOOK the whole span\n");
BIT_SET(PHONEDEV(xpd).offhook_state, 0);
@@ -1487,14 +1474,12 @@ static int write_state_register(xpd_t *xpd, byte value)
/*---------------- BRI: Astribank Reply Handlers --------------------------*/
static void su_new_state(xpd_t *xpd, byte reg_x30)
{
- xbus_t *xbus;
struct BRI_priv_data *priv;
su_rd_sta_t new_state;
BUG_ON(!xpd);
priv = xpd->priv;
BUG_ON(!priv);
- xbus = xpd->xbus;
if(!priv->initialized) {
XPD_ERR(xpd, "%s called on uninitialized AB\n", __FUNCTION__);
return;
diff --git a/drivers/dahdi/xpp/card_fxo.c b/drivers/dahdi/xpp/card_fxo.c
index 2da9584..f533ac6 100644
--- a/drivers/dahdi/xpp/card_fxo.c
+++ b/drivers/dahdi/xpp/card_fxo.c
@@ -486,10 +486,7 @@ static int FXO_card_init(xbus_t *xbus, xpd_t *xpd)
static int FXO_card_remove(xbus_t *xbus, xpd_t *xpd)
{
- struct FXO_priv_data *priv;
-
BUG_ON(!xpd);
- priv = xpd->priv;
XPD_DBG(GENERAL, xpd, "\n");
fxo_proc_remove(xbus, xpd);
return 0;
@@ -604,10 +601,7 @@ static void dahdi_report_battery(xpd_t *xpd, lineno_t chan)
static int FXO_card_open(xpd_t *xpd, lineno_t chan)
{
- struct FXO_priv_data *priv;
-
BUG_ON(!xpd);
- priv = xpd->priv;
return 0;
}
diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c
index 50814a1..03e3d49 100644
--- a/drivers/dahdi/xpp/card_fxs.c
+++ b/drivers/dahdi/xpp/card_fxs.c
@@ -423,12 +423,10 @@ err:
static int FXS_card_init(xbus_t *xbus, xpd_t *xpd)
{
- struct FXS_priv_data *priv;
int ret = 0;
int i;
BUG_ON(!xpd);
- priv = xpd->priv;
/*
* Setup ring timers
*/
@@ -473,10 +471,7 @@ err:
static int FXS_card_remove(xbus_t *xbus, xpd_t *xpd)
{
- struct FXS_priv_data *priv;
-
BUG_ON(!xpd);
- priv = xpd->priv;
XPD_DBG(GENERAL, xpd, "\n");
fxs_proc_remove(xbus, xpd);
return 0;
diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c
index 8e88b7e..a2f755f 100644
--- a/drivers/dahdi/xpp/card_pri.c
+++ b/drivers/dahdi/xpp/card_pri.c
@@ -747,11 +747,8 @@ static void set_reg_lim0(const char *msg, xpd_t *xpd)
*/
static int set_master_mode(const char *msg, xpd_t *xpd)
{
- struct PRI_priv_data *priv;
-
BUG_ON(!xpd);
XPD_DBG(SIGNAL, xpd, "\n");
- priv = xpd->priv;
set_reg_lim0(__FUNCTION__, xpd);
set_clocking(xpd);
return 0;
@@ -1143,12 +1140,10 @@ static int PRI_card_init(xbus_t *xbus, xpd_t *xpd)
{
struct PRI_priv_data *priv;
int ret = 0;
- xproto_table_t *proto_table;
BUG_ON(!xpd);
XPD_DBG(GENERAL, xpd, "\n");
xpd->type = XPD_TYPE_PRI;
- proto_table = &PROTO_TABLE(PRI);
priv = xpd->priv;
if(priv->pri_protocol == PRI_PROTO_0) {
/*
@@ -1187,10 +1182,7 @@ err:
static int PRI_card_remove(xbus_t *xbus, xpd_t *xpd)
{
- struct PRI_priv_data *priv;
-
BUG_ON(!xpd);
- priv = xpd->priv;
XPD_DBG(GENERAL, xpd, "\n");
return 0;
}
@@ -1278,11 +1270,9 @@ static int PRI_card_dahdi_preregistration(xpd_t *xpd, bool on)
static int PRI_card_dahdi_postregistration(xpd_t *xpd, bool on)
{
xbus_t *xbus;
- struct PRI_priv_data *priv;
BUG_ON(!xpd);
xbus = xpd->xbus;
- priv = xpd->priv;
BUG_ON(!xbus);
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
dahdi_update_syncsrc(xpd);
diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c
index bd4a003..d558a75 100644
--- a/drivers/dahdi/xpp/xbus-core.c
+++ b/drivers/dahdi/xpp/xbus-core.c
@@ -1453,7 +1453,6 @@ static int xbus_fill_proc_queue(char *p, struct xframe_queue *q)
static int xbus_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data)
{
xbus_t *xbus;
- struct xbus_workqueue *worker;
unsigned long flags;
int len = 0;
int i = (int)((unsigned long)data);
@@ -1462,7 +1461,6 @@ static int xbus_read_proc(char *page, char **start, off_t off, int count, int *e
if(!xbus)
goto out;
spin_lock_irqsave(&xbus->lock, flags);
- worker = &xbus->worker;
len += sprintf(page + len, "%s: CONNECTOR=%s LABEL=[%s] STATUS=%s\n",
xbus->busname,
diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c
index ecbaf49..89adf51 100644
--- a/drivers/dahdi/xpp/xpp_dahdi.c
+++ b/drivers/dahdi/xpp/xpp_dahdi.c
@@ -275,13 +275,11 @@ static int xpd_read_proc(char *page, char **start, off_t off, int count, int *eo
{
int len = 0;
xpd_t *xpd = data;
- xbus_t *xbus;
int i;
if(!xpd)
goto out;
- xbus = xpd->xbus;
len += sprintf(page + len, "%s (%s, card %s, span %d)\n"
"timing_priority: %d\n"
"timer_count: %d span->mainttimer=%d\n"
@@ -606,10 +604,7 @@ void xbus_request_removal(xbus_t *xbus)
*/
void xpd_remove(xpd_t *xpd)
{
- xbus_t *xbus;
-
BUG_ON(!xpd);
- xbus = xpd->xbus;
XPD_INFO(xpd, "Remove\n");
dahdi_unregister_xpd(xpd);
CALL_XMETHOD(card_remove, xpd);
diff --git a/drivers/dahdi/xpp/xpp_usb.c b/drivers/dahdi/xpp/xpp_usb.c
index f2eb9ad..119abcb 100644
--- a/drivers/dahdi/xpp/xpp_usb.c
+++ b/drivers/dahdi/xpp/xpp_usb.c
@@ -816,7 +816,6 @@ static void xusb_disconnect(struct usb_interface *interface)
struct usb_host_interface *iface_desc = usb_altnum_to_altsetting(interface, 0);
xusb_t *xusb;
xbus_t *xbus;
- int minor;
int i;
DBG(DEVICES, "CALLED on interface #%d\n", iface_desc->desc.bInterfaceNumber);
@@ -845,7 +844,6 @@ static void xusb_disconnect(struct usb_interface *interface)
xbus_disconnect(xbus); // Blocking until fully deactivated!
down (&xusb->sem);
- minor = xusb->minor;
/* give back our minor */
usb_deregister_dev(interface, &xusb_class);
@@ -924,7 +922,6 @@ static void xpp_receive_callback(USB_PASS_CB(urb))
xbus_t *xbus = xbus_num(xusb->xbus_num);
size_t size;
bool do_resubmit = 1;
- bool is_inuse = 0;
struct timeval now;
do_gettimeofday(&now);
@@ -933,7 +930,6 @@ static void xpp_receive_callback(USB_PASS_CB(urb))
XUSB_ERR(xusb, "Received URB does not belong to a valid xbus anymore...\n");
return;
}
- is_inuse = 1;
if(!xusb->present) {
do_resubmit = 0;
goto err;