summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-10-28 21:49:02 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-10-28 21:49:02 +0000
commitcb2fd65e3da7a68ef11d458e9ca99463f90b32a0 (patch)
tree8acd0b016433ced01fd64876a031381c822c30aa /drivers
parent8b0e06e5f588d24af0666b1d605084a83c7c8c25 (diff)
fix a large number of warnings found by sparse, the kernel code sanity checking tool. some of these fixes are non-optimal (casting 'unsigned long' to '__user void *'), but are unavoidable in many cases. started from tzafrir's patch, did most of the work myself.
(closes issue #13763) Reported by: tzafrir Patches: sparse_fixes_1.diff uploaded by tzafrir (license 46) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5162 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dahdi/dahdi-base.c14
-rw-r--r--drivers/dahdi/dahdi_dummy.c2
-rw-r--r--drivers/dahdi/dahdi_dynamic.c12
-rw-r--r--drivers/dahdi/dahdi_dynamic_eth.c10
-rw-r--r--drivers/dahdi/dahdi_dynamic_loc.c11
-rw-r--r--drivers/dahdi/dahdi_echocan_mg2.c6
-rw-r--r--drivers/dahdi/dahdi_transcode.c31
-rw-r--r--drivers/dahdi/pciradio.c39
-rw-r--r--drivers/dahdi/tor2.c52
-rw-r--r--drivers/dahdi/voicebus.c4
-rw-r--r--drivers/dahdi/wcb4xxp/base.c24
-rw-r--r--drivers/dahdi/wcfxo.c8
-rw-r--r--drivers/dahdi/wct1xxp.c14
-rw-r--r--drivers/dahdi/wct4xxp/base.c19
-rw-r--r--drivers/dahdi/wctc4xxp/base.c42
-rw-r--r--drivers/dahdi/wctdm.c28
-rw-r--r--drivers/dahdi/wctdm24xxp/GpakApi.c2
-rw-r--r--drivers/dahdi/wctdm24xxp/GpakCust.c16
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c39
-rw-r--r--drivers/dahdi/wcte11xp.c14
-rw-r--r--drivers/dahdi/wcte12xp/GpakApi.c2
-rw-r--r--drivers/dahdi/wcte12xp/base.c14
-rw-r--r--drivers/dahdi/wcte12xp/vpmadt032.c31
-rw-r--r--drivers/dahdi/wcte12xp/vpmadt032.h4
24 files changed, 211 insertions, 227 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 3b39dde..d322142 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -317,7 +317,7 @@ struct dahdi_timer {
wait_queue_head_t sel;
};
-LIST_HEAD(zaptimers);
+static LIST_HEAD(zaptimers);
#ifdef DEFINE_SPINLOCK
static DEFINE_SPINLOCK(zaptimerlock);
@@ -384,7 +384,7 @@ static DEFINE_RWLOCK(echocan_list_lock);
static rwlock_t echocan_list_lock = RW_LOCK_UNLOCKED;
#endif
-LIST_HEAD(echocan_list);
+static LIST_HEAD(echocan_list);
struct echocan {
const struct dahdi_echocan *ec;
@@ -4823,8 +4823,6 @@ static int ioctl_echocancel(struct dahdi_chan *chan, struct dahdi_echocanparams
}
if ((ret == -ENODEV) && chan->ec_factory) {
- const struct dahdi_echocan *ec_current;
-
switch (ecp->tap_length) {
case 32:
case 64:
@@ -7128,7 +7126,7 @@ static void __dahdi_hdlc_abort(struct dahdi_chan *ss, int event)
__qevent(ss->master, event);
}
-extern void dahdi_hdlc_abort(struct dahdi_chan *ss, int event)
+void dahdi_hdlc_abort(struct dahdi_chan *ss, int event)
{
unsigned long flags;
spin_lock_irqsave(&ss->lock, flags);
@@ -7136,7 +7134,7 @@ extern void dahdi_hdlc_abort(struct dahdi_chan *ss, int event)
spin_unlock_irqrestore(&ss->lock, flags);
}
-extern void dahdi_hdlc_putbuf(struct dahdi_chan *ss, unsigned char *rxb, int bytes)
+void dahdi_hdlc_putbuf(struct dahdi_chan *ss, unsigned char *rxb, int bytes)
{
unsigned long flags;
int res;
@@ -7171,7 +7169,7 @@ extern void dahdi_hdlc_putbuf(struct dahdi_chan *ss, unsigned char *rxb, int byt
spin_unlock_irqrestore(&ss->lock, flags);
}
-extern void dahdi_hdlc_finish(struct dahdi_chan *ss)
+void dahdi_hdlc_finish(struct dahdi_chan *ss)
{
int oldreadbuf;
unsigned long flags;
@@ -7217,7 +7215,7 @@ extern void dahdi_hdlc_finish(struct dahdi_chan *ss)
}
/* Returns 1 if EOF, 0 if data is still in frame, -1 if EOF and no buffers left */
-extern int dahdi_hdlc_getbuf(struct dahdi_chan *ss, unsigned char *bufptr, unsigned int *size)
+int dahdi_hdlc_getbuf(struct dahdi_chan *ss, unsigned char *bufptr, unsigned int *size)
{
unsigned char *buf;
unsigned long flags;
diff --git a/drivers/dahdi/dahdi_dummy.c b/drivers/dahdi/dahdi_dummy.c
index b207fcb..532dbe3 100644
--- a/drivers/dahdi/dahdi_dummy.c
+++ b/drivers/dahdi/dahdi_dummy.c
@@ -106,7 +106,7 @@ static int debug = 0;
#ifdef USE_HIGHRESTIMER
#define CLOCK_SRC "HRtimer"
-struct hrtimer zaptimer;
+static struct hrtimer zaptimer;
#elif defined(USE_RTC)
#define CLOCK_SRC "RTC"
static int rtc_rate = 0;
diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c
index c1f09eb..4a52983 100644
--- a/drivers/dahdi/dahdi_dynamic.c
+++ b/drivers/dahdi/dahdi_dynamic.c
@@ -705,7 +705,7 @@ static int ztdynamic_ioctl(unsigned int cmd, unsigned long data)
ztdynamic_run();
return 0;
case DAHDI_DYNAMIC_CREATE:
- if (copy_from_user(&zds, (struct dahdi_dynamic_span *)data, sizeof(zds)))
+ if (copy_from_user(&zds, (__user const void *) data, sizeof(zds)))
return -EFAULT;
if (debug)
printk(KERN_DEBUG "Dynamic Create\n");
@@ -714,11 +714,11 @@ static int ztdynamic_ioctl(unsigned int cmd, unsigned long data)
return res;
zds.spanno = res;
/* Let them know the new span number */
- if (copy_to_user((struct dahdi_dynamic_span *)data, &zds, sizeof(zds)))
+ if (copy_to_user((__user void *) data, &zds, sizeof(zds)))
return -EFAULT;
return 0;
case DAHDI_DYNAMIC_DESTROY:
- if (copy_from_user(&zds, (struct dahdi_dynamic_span *)data, sizeof(zds)))
+ if (copy_from_user(&zds, (__user const void *) data, sizeof(zds)))
return -EFAULT;
if (debug)
printk(KERN_DEBUG "Dynamic Destroy\n");
@@ -785,7 +785,7 @@ void dahdi_dynamic_unregister(struct dahdi_dynamic_driver *dri)
spin_unlock_irqrestore(&dlock, flags);
}
-struct timer_list alarmcheck;
+static struct timer_list alarmcheck;
static void check_for_red_alarm(unsigned long ignored)
{
@@ -817,7 +817,7 @@ static void check_for_red_alarm(unsigned long ignored)
}
-int ztdynamic_init(void)
+static int ztdynamic_init(void)
{
dahdi_set_dynamic_ioctl(ztdynamic_ioctl);
/* Start process to check for RED ALARM */
@@ -834,7 +834,7 @@ int ztdynamic_init(void)
return 0;
}
-void ztdynamic_cleanup(void)
+static void ztdynamic_cleanup(void)
{
#ifdef ENABLE_TASKLETS
if (taskletpending) {
diff --git a/drivers/dahdi/dahdi_dynamic_eth.c b/drivers/dahdi/dahdi_dynamic_eth.c
index 7017f75..ff26420 100644
--- a/drivers/dahdi/dahdi_dynamic_eth.c
+++ b/drivers/dahdi/dahdi_dynamic_eth.c
@@ -59,7 +59,7 @@ static struct ztdeth {
struct ztdeth *next;
} *zdevs = NULL;
-struct dahdi_span *ztdeth_getspan(unsigned char *addr, unsigned short subaddr)
+static struct dahdi_span *ztdeth_getspan(unsigned char *addr, unsigned short subaddr)
{
unsigned long flags;
struct ztdeth *z;
@@ -207,9 +207,9 @@ static int ztdeth_flush(void)
}
static struct packet_type ztdeth_ptype = {
- type: __constant_htons(ETH_P_DAHDI_DETH), /* Protocol */
- dev: NULL, /* Device (NULL = wildcard) */
- func: ztdeth_rcv, /* Receiver */
+ .type = __constant_htons(ETH_P_DAHDI_DETH), /* Protocol */
+ .dev = NULL, /* Device (NULL = wildcard) */
+ .func = ztdeth_rcv, /* Receiver */
};
static int digit2int(char d)
@@ -409,7 +409,7 @@ static struct dahdi_dynamic_driver ztd_eth = {
};
static struct notifier_block ztdeth_nblock = {
- notifier_call: ztdeth_notifier,
+ .notifier_call = ztdeth_notifier,
};
static int __init ztdeth_init(void)
diff --git a/drivers/dahdi/dahdi_dynamic_loc.c b/drivers/dahdi/dahdi_dynamic_loc.c
index 36b9c9e..010fe85 100644
--- a/drivers/dahdi/dahdi_dynamic_loc.c
+++ b/drivers/dahdi/dahdi_dynamic_loc.c
@@ -72,7 +72,7 @@ static struct ztdlocal {
struct ztdlocal *next;
} *zdevs = NULL;
-/*static*/ int ztdlocal_transmit(void *pvt, unsigned char *msg, int msglen)
+static int ztdlocal_transmit(void *pvt, unsigned char *msg, int msglen)
{
struct ztdlocal *z;
unsigned long flags;
@@ -121,7 +121,7 @@ static int digit2int(char d)
return -1;
}
-/*static*/ void ztdlocal_destroy(void *pvt)
+static void ztdlocal_destroy(void *pvt)
{
struct ztdlocal *z = pvt;
unsigned long flags;
@@ -156,7 +156,7 @@ static int digit2int(char d)
}
}
-/*static*/ void *ztdlocal_create(struct dahdi_span *span, char *address)
+static void *ztdlocal_create(struct dahdi_span *span, char *address)
{
struct ztdlocal *z, *l;
unsigned long flags;
@@ -231,6 +231,7 @@ CLEAR_AND_DEL_FROM_PEERS:
l->monitor_rx_peer = NULL;
}
kfree (z);
+ spin_unlock_irqrestore(&zlock, flags);
return NULL;
INVALID_ADDRESS:
@@ -247,13 +248,13 @@ static struct dahdi_dynamic_driver ztd_local = {
NULL /* flush */
};
-/*static*/ int __init ztdlocal_init(void)
+static int __init ztdlocal_init(void)
{
dahdi_dynamic_register(&ztd_local);
return 0;
}
-/*static*/ void __exit ztdlocal_exit(void)
+static void __exit ztdlocal_exit(void)
{
dahdi_dynamic_unregister(&ztd_local);
}
diff --git a/drivers/dahdi/dahdi_echocan_mg2.c b/drivers/dahdi/dahdi_echocan_mg2.c
index b365f78..6ca0860 100644
--- a/drivers/dahdi/dahdi_echocan_mg2.c
+++ b/drivers/dahdi/dahdi_echocan_mg2.c
@@ -425,6 +425,8 @@ static inline short sample_update(struct echo_can_state *ec, short iref, short i
* we should pass it through uncancelled, as we are likely on hold */
u = isig;
} else {
+ int sign_error;
+
if (rs < -32768) {
rs = -32768;
ec->HCNTR_d = DEFAULT_HANGT;
@@ -435,7 +437,9 @@ static inline short sample_update(struct echo_can_state *ec, short iref, short i
RESTORE_COEFFS;
}
- if (ABS(ABS(rs)-ABS(isig)) > MAX_SIGN_ERROR)
+ sign_error = ABS(rs) - ABS(isig);
+
+ if (ABS(sign_error) > MAX_SIGN_ERROR)
{
rs = 0;
RESTORE_COEFFS;
diff --git a/drivers/dahdi/dahdi_transcode.c b/drivers/dahdi/dahdi_transcode.c
index 9ce07c9..940ab3d 100644
--- a/drivers/dahdi/dahdi_transcode.c
+++ b/drivers/dahdi/dahdi_transcode.c
@@ -39,7 +39,7 @@
#include <dahdi/kernel.h>
static int debug;
-LIST_HEAD(trans);
+static LIST_HEAD(trans);
static spinlock_t translock = SPIN_LOCK_UNLOCKED;
EXPORT_SYMBOL(dahdi_transcoder_register);
@@ -235,8 +235,7 @@ static long dahdi_tc_allocate(struct file *file, unsigned long data)
struct dahdi_transcoder_channel *chan = NULL;
struct dahdi_transcoder_formats fmts;
- if (copy_from_user(&fmts,
- (struct dahdi_transcoder_formats*) data, sizeof(fmts))) {
+ if (copy_from_user(&fmts, (__user const void *) data, sizeof(fmts))) {
return -EFAULT;
}
@@ -292,7 +291,7 @@ static long dahdi_tc_getinfo(unsigned long data)
struct dahdi_transcoder *cur;
struct dahdi_transcoder *tc = NULL;
- if (copy_from_user(&info, (const void *) data, sizeof(info))) {
+ if (copy_from_user(&info, (__user const void *) data, sizeof(info))) {
return -EFAULT;
}
@@ -314,7 +313,7 @@ static long dahdi_tc_getinfo(unsigned long data)
info.srcfmts = tc->srcfmts;
info.dstfmts = tc->dstfmts;
- return copy_to_user((void *) data, &info, sizeof(info)) ? -EFAULT : 0;
+ return copy_to_user((__user void *) data, &info, sizeof(info)) ? -EFAULT : 0;
}
static ssize_t dahdi_tc_write(struct file *file, __user const char *usrbuf, size_t count, loff_t *ppos)
@@ -408,16 +407,16 @@ static unsigned int dahdi_tc_poll(struct file *file, struct poll_table_struct *w
}
static struct file_operations __dahdi_transcode_fops = {
- owner: THIS_MODULE,
- open: dahdi_tc_open,
- release: dahdi_tc_release,
- ioctl: dahdi_tc_ioctl,
- read: dahdi_tc_read,
- write: dahdi_tc_write,
- poll: dahdi_tc_poll,
- mmap: dahdi_tc_mmap,
+ .owner = THIS_MODULE,
+ .open = dahdi_tc_open,
+ .release = dahdi_tc_release,
+ .ioctl = dahdi_tc_ioctl,
+ .read = dahdi_tc_read,
+ .write = dahdi_tc_write,
+ .poll = dahdi_tc_poll,
+ .mmap = dahdi_tc_mmap,
#if HAVE_UNLOCKED_IOCTL
- unlocked_ioctl: dahdi_tc_unlocked_ioctl,
+ .unlocked_ioctl = dahdi_tc_unlocked_ioctl,
#endif
};
@@ -426,7 +425,7 @@ static struct dahdi_chardev transcode_chardev = {
.minor = 250,
};
-int dahdi_transcode_init(void)
+static int dahdi_transcode_init(void)
{
int res;
@@ -444,7 +443,7 @@ int dahdi_transcode_init(void)
return 0;
}
-void dahdi_transcode_cleanup(void)
+static void dahdi_transcode_cleanup(void)
{
dahdi_unregister_chardev(&transcode_chardev);
diff --git a/drivers/dahdi/pciradio.c b/drivers/dahdi/pciradio.c
index db43d3a..6b64e7e 100644
--- a/drivers/dahdi/pciradio.c
+++ b/drivers/dahdi/pciradio.c
@@ -465,18 +465,17 @@ int i;
}
-void __pciradio_setcreg(struct pciradio *rad, unsigned char reg, unsigned char val)
+static void __pciradio_setcreg(struct pciradio *rad, unsigned char reg, unsigned char val)
{
outb(val, rad->ioaddr + RAD_REGBASE + ((reg & 0xf) << 2));
}
-unsigned char __pciradio_getcreg(struct pciradio *rad, unsigned char reg)
+static unsigned char __pciradio_getcreg(struct pciradio *rad, unsigned char reg)
{
return inb(rad->ioaddr + RAD_REGBASE + ((reg & 0xf) << 2));
}
-
-void rbi_out(struct pciradio *rad, int n, unsigned char *rbicmd)
+static void rbi_out(struct pciradio *rad, int n, unsigned char *rbicmd)
{
unsigned long flags;
int x;
@@ -510,7 +509,7 @@ DECLARE_WAIT_QUEUE_HEAD(mywait);
*/
-void mx828_command(struct pciradio *rad,int channel, unsigned char command, unsigned char *byte1, unsigned char *byte2)
+static void mx828_command(struct pciradio *rad,int channel, unsigned char command, unsigned char *byte1, unsigned char *byte2)
{
if(channel > 3)
@@ -524,7 +523,7 @@ void mx828_command(struct pciradio *rad,int channel, unsigned char command, unsi
}
-void mx828_command_wait(struct pciradio *rad,int channel, unsigned char command, unsigned char *byte1, unsigned char *byte2)
+static void mx828_command_wait(struct pciradio *rad,int channel, unsigned char command, unsigned char *byte1, unsigned char *byte2)
{
DECLARE_WAIT_QUEUE_HEAD(mywait);
unsigned long flags;
@@ -880,8 +879,6 @@ DAHDI_IRQ_HANDLER(pciradio_interrupt)
/* if just getting to zero */
if (!(--rad->bursttimer[x]))
{
- unsigned char mask = 1 << x;
-
rad->pasave &= ~mask;
__pciradio_setcreg(rad, 0xa, rad->pasave);
}
@@ -893,8 +890,6 @@ DAHDI_IRQ_HANDLER(pciradio_interrupt)
/* if just getting to zero */
if (!(--rad->gotrxtimer[x]))
{
- unsigned char mask;
-
mask = 1 << (x + 4);
rad->pasave &= ~mask;
if (gotctcss) rad->pasave |= mask;
@@ -974,7 +969,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
switch (cmd) {
case DAHDI_RADIO_GETPARAM:
- if (copy_from_user(&stack.p,(struct dahdi_radio_param *)data,sizeof(struct dahdi_radio_param))) return -EFAULT;
+ if (copy_from_user(&stack.p, (__user void *) data, sizeof(stack.p))) return -EFAULT;
spin_lock_irqsave(&rad->lock,flags);
stack.p.data = 0; /* start with 0 value in output */
switch(stack.p.radpar) {
@@ -1070,10 +1065,10 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
return -EINVAL;
}
spin_unlock_irqrestore(&rad->lock,flags);
- if (copy_to_user((struct dahdi_radio_param *)data,&stack.p,sizeof(struct dahdi_radio_param))) return -EFAULT;
+ if (copy_to_user((__user void *) data, &stack.p, sizeof(stack.p))) return -EFAULT;
break;
case DAHDI_RADIO_SETPARAM:
- if (copy_from_user(&stack.p,(struct dahdi_radio_param *)data,sizeof(struct dahdi_radio_param))) return -EFAULT;
+ if (copy_from_user(&stack.p, (__user void *) data, sizeof(stack.p))) return -EFAULT;
spin_lock_irqsave(&rad->lock,flags);
switch(stack.p.radpar) {
case DAHDI_RADPAR_INVERTCOR:
@@ -1349,7 +1344,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
spin_unlock_irqrestore(&rad->lock,flags);
if (rad->remmode[chan->chanpos - 1] == DAHDI_RADPAR_REM_SERIAL_ASCII)
interruptible_sleep_on_timeout(&mywait,100);
- if (copy_to_user((struct dahdi_radio_stat *)data,&stack.p,sizeof(struct dahdi_radio_param))) return -EFAULT;
+ if (copy_to_user((__user void *) data, &stack.p, sizeof(stack.p))) return -EFAULT;
return 0;
default:
spin_unlock_irqrestore(&rad->lock,flags);
@@ -1360,7 +1355,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
case DAHDI_RADIO_GETSTAT:
spin_lock_irqsave(&rad->lock,flags);
/* start with clean object */
- memset(&stack.s,0,sizeof(struct dahdi_radio_stat));
+ memset(&stack.s, 0, sizeof(stack.s));
/* if we have rx */
if (rad->gotrx[chan->chanpos - 1])
{
@@ -1406,7 +1401,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
if (rad->gotct[chan->chanpos - 1])
stack.s.radstat |= DAHDI_RADSTAT_RXCT;
spin_unlock_irqrestore(&rad->lock,flags);
- if (copy_to_user((struct dahdi_radio_stat *)data,&stack.s,sizeof(struct dahdi_radio_stat))) return -EFAULT;
+ if (copy_to_user((__user void *) data, &stack.s, sizeof(stack.s))) return -EFAULT;
break;
default:
return -ENOTTY;
@@ -1767,8 +1762,6 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
pci_set_drvdata(pdev, rad);
if (pciradio_hardware_init(rad)) {
- unsigned char x;
-
/* Set Reset Low */
x=inb(rad->ioaddr + RAD_CNTL);
outb((~0x1)&x, rad->ioaddr + RAD_CNTL);
@@ -1862,12 +1855,10 @@ static struct pci_device_id pciradio_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, pciradio_pci_tbl);
static struct pci_driver pciradio_driver = {
- name: "pciradio",
- probe: pciradio_init_one,
- remove: __devexit_p(pciradio_remove_one),
- suspend: NULL,
- resume: NULL,
- id_table: pciradio_pci_tbl,
+ .name = "pciradio",
+ .probe = pciradio_init_one,
+ .remove = __devexit_p(pciradio_remove_one),
+ .id_table = pciradio_pci_tbl,
};
static int __init pciradio_init(void)
diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c
index 3ddfa79..7492e14 100644
--- a/drivers/dahdi/tor2.c
+++ b/drivers/dahdi/tor2.c
@@ -89,13 +89,13 @@ struct tor2 {
int master; /* Are we master */
unsigned long plx_region; /* phy addr of PCI9030 registers */
unsigned long plx_len; /* length of PLX window */
- volatile unsigned short *plx; /* Virtual representation of local space */
+ __iomem volatile unsigned short *plx; /* Virtual representation of local space */
unsigned long xilinx32_region; /* 32 bit Region allocated to Xilinx */
unsigned long xilinx32_len; /* Length of 32 bit Xilinx region */
- volatile unsigned int *mem32; /* Virtual representation of 32 bit Xilinx memory area */
+ __iomem volatile unsigned int *mem32; /* Virtual representation of 32 bit Xilinx memory area */
unsigned long xilinx8_region; /* 8 bit Region allocated to Xilinx */
unsigned long xilinx8_len; /* Length of 8 bit Xilinx region */
- volatile unsigned char *mem8; /* Virtual representation of 8 bit Xilinx memory area */
+ __iomem volatile unsigned char *mem8; /* Virtual representation of 8 bit Xilinx memory area */
struct dahdi_span spans[SPANS_PER_CARD]; /* Spans */
struct tor2_span tspans[SPANS_PER_CARD]; /* Span data */
struct dahdi_chan **chans[SPANS_PER_CARD]; /* Pointers to blocks of 24(30/31) contiguous dahdi_chans for each span */
@@ -163,7 +163,7 @@ static void tor2_tasklet(unsigned long data);
#define MAX_TOR_CARDS 64
-struct tor2 *cards[MAX_TOR_CARDS];
+static struct tor2 *cards[MAX_TOR_CARDS];
/* signalling bits */
#define TOR_ABIT 8
@@ -184,11 +184,11 @@ static int tor2_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long d
DAHDI_IRQ_HANDLER(tor2_intr);
/* translations of data channels for 24 channels in a 32 bit PCM highway */
-unsigned datxlt_t1[] = {
+static unsigned datxlt_t1[] = {
1 ,2 ,3 ,5 ,6 ,7 ,9 ,10,11,13,14,15,17,18,19,21,22,23,25,26,27,29,30,31 };
/* translations of data channels for 30/31 channels in a 32 bit PCM highway */
-unsigned datxlt_e1[] = {
+static unsigned datxlt_e1[] = {
1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31 };
@@ -359,7 +359,7 @@ static int __devinit tor2_probe(struct pci_dev *pdev, const struct pci_device_id
int res,x,f;
struct tor2 *tor;
unsigned long endjif;
- volatile unsigned long *gpdata_io,*lasdata_io;
+ __iomem volatile unsigned long *gpdata_io, *lasdata_io;
unsigned long gpdata,lasdata;
res = pci_enable_device(pdev);
@@ -436,7 +436,7 @@ static int __devinit tor2_probe(struct pci_dev *pdev, const struct pci_device_id
cards[x] = tor;
/* start programming mode */
- gpdata_io = (unsigned long *)&tor->plx[GPIOC];
+ gpdata_io = (__iomem unsigned long *) &tor->plx[GPIOC];
gpdata = le32_to_cpu(*gpdata_io);
gpdata |= GPIO_WRITE; /* make sure WRITE is not asserted */
@@ -508,13 +508,13 @@ static int __devinit tor2_probe(struct pci_dev *pdev, const struct pci_device_id
/* set the LA2BRD register so that we enable block transfer, read
pre-fetch, and set to maximum read pre-fetch size */
- lasdata_io = (unsigned long *)&tor->plx[LAS2BRD];
+ lasdata_io = (__iomem unsigned long *) &tor->plx[LAS2BRD];
lasdata = *lasdata_io;
lasdata |= 0x39;
*lasdata_io = lasdata;
/* set the LA3BRD register so that we enable block transfer */
- lasdata_io = (unsigned long *)&tor->plx[LAS3BRD];
+ lasdata_io = (__iomem unsigned long *) &tor->plx[LAS3BRD];
lasdata = *lasdata_io;
lasdata |= 1;
*lasdata_io = lasdata;
@@ -585,9 +585,9 @@ err_out_release_all:
err_out_release_plx_region:
release_mem_region(tor->plx_region, tor->plx_len);
err_out_free_tor:
- if (tor->plx) iounmap((void *)tor->plx);
- if (tor->mem8) iounmap((void *)tor->mem8);
- if (tor->mem32) iounmap((void *)tor->mem32);
+ if (tor->plx) iounmap(tor->plx);
+ if (tor->mem8) iounmap(tor->mem8);
+ if (tor->mem32) iounmap(tor->mem32);
if (tor) {
free_tor(tor);
}
@@ -619,20 +619,20 @@ static void __devexit tor2_remove(struct pci_dev *pdev)
release_mem_region(tor->plx_region, tor->plx_len);
release_mem_region(tor->xilinx32_region, tor->xilinx32_len);
release_mem_region(tor->xilinx8_region, tor->xilinx8_len);
- if (tor->plx) iounmap((void *)tor->plx);
- if (tor->mem8) iounmap((void *)tor->mem8);
- if (tor->mem32) iounmap((void *)tor->mem32);
+ if (tor->plx) iounmap(tor->plx);
+ if (tor->mem8) iounmap(tor->mem8);
+ if (tor->mem32) iounmap(tor->mem32);
- cards[tor->num] = 0;
+ cards[tor->num] = NULL;
pci_set_drvdata(pdev, NULL);
free_tor(tor);
}
static struct pci_driver tor2_driver = {
- name: "tormenta2",
- probe: tor2_probe,
- remove: __devexit_p(tor2_remove),
- id_table: tor2_pci_ids,
+ .name = "tormenta2",
+ .probe = tor2_probe,
+ .remove = __devexit_p(tor2_remove),
+ .id_table = tor2_pci_ids,
};
static int __init tor2_init(void) {
@@ -1180,7 +1180,7 @@ found:
DAHDI_IRQ_HANDLER(tor2_intr)
{
- int n, i, j, k, syncsrc;
+ int n, i, j, k, newsyncsrc;
unsigned int rxword,txword;
unsigned char c, rxc;
@@ -1427,7 +1427,7 @@ DAHDI_IRQ_HANDLER(tor2_intr)
if (!timingcable) {
/* re-evaluate active sync src (no cable version) */
tor->syncsrc = 0;
- syncsrc = 0;
+ newsyncsrc = 0;
/* if primary sync specified, see if we can use it */
if (tor->psyncs[0])
{
@@ -1435,7 +1435,7 @@ DAHDI_IRQ_HANDLER(tor2_intr)
if (!(tor->spans[tor->psyncs[0] - 1].alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE |
DAHDI_ALARM_LOOPBACK))) {
tor->syncsrc = tor->psyncs[0];
- syncsrc = tor->syncs[0];
+ newsyncsrc = tor->syncs[0];
}
}
/* if any others specified, see if we can use them */
@@ -1446,12 +1446,12 @@ DAHDI_IRQ_HANDLER(tor2_intr)
if (!(tor->spans[tor->psyncs[i] - 1].alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE |
DAHDI_ALARM_LOOPBACK))) {
tor->syncsrc = tor->psyncs[i];
- syncsrc = tor->syncs[i];
+ newsyncsrc = tor->syncs[i];
}
}
}
/* update sync src info */
- for (i = 0; i < SPANS_PER_CARD; i++) tor->spans[i].syncsrc = syncsrc;
+ for (i = 0; i < SPANS_PER_CARD; i++) tor->spans[i].syncsrc = newsyncsrc;
/* actually set the sync register */
tor->mem8[SYNCREG] = tor->syncsrc;
diff --git a/drivers/dahdi/voicebus.c b/drivers/dahdi/voicebus.c
index 245d7e0..e16cd65 100644
--- a/drivers/dahdi/voicebus.c
+++ b/drivers/dahdi/voicebus.c
@@ -971,7 +971,7 @@ vb_clear_start_receive_bit(struct voicebus *vb)
VBUNLOCK(vb);
}
-unsigned long
+static unsigned long
vb_wait_for_completion_timeout(struct completion *x, unsigned long timeout)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
@@ -1061,7 +1061,7 @@ voicebus_release(struct voicebus *vb)
kfree(vb);
}
-void
+static void
__vb_increase_latency(struct voicebus *vb)
{
static int __warn_once = 1;
diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c
index ff213cf..5eb6a6c 100644
--- a/drivers/dahdi/wcb4xxp/base.c
+++ b/drivers/dahdi/wcb4xxp/base.c
@@ -109,9 +109,10 @@ struct devtype {
static struct devtype wcb4xxp = { "Wildcard B410P", 0 };
-const char *wcb4xxp_rcsdata = "$RCSfile: base.c,v $ $Revision$";
-const char *build_stamp = "" __DATE__ " " __TIME__ "";
-
+#if 0
+static const char *wcb4xxp_rcsdata = "$RCSfile: base.c,v $ $Revision$";
+static const char *build_stamp = "" __DATE__ " " __TIME__ "";
+#endif
/*
* lowlevel PCI access functions
@@ -1582,7 +1583,8 @@ static int hdlc_rx_frame(struct b4xxp_span *bspan)
static int hdlc_tx_frame(struct b4xxp_span *bspan)
{
struct b4xxp *b4 = bspan->parent;
- int res, i, fifo, size=32;
+ int res, i, fifo;
+ unsigned int size = 32;
int z1, z2, zlen;
unsigned char buf[32];
unsigned long irq_flags;
@@ -2286,7 +2288,7 @@ static void b4xxp_bottom_half(unsigned long data)
/********************************************************************************* proc stuff *****/
-int b4xxp_proc_read_one(char *buf, struct b4xxp *b4)
+static int b4xxp_proc_read_one(char *buf, struct b4xxp *b4)
{
struct dahdi_chan *chan;
int len, i, j;
@@ -2332,7 +2334,7 @@ int b4xxp_proc_read_one(char *buf, struct b4xxp *b4)
return len;
}
-int b4xxp_proc_read(char *buf, char **start, off_t offset, int count, int *eof, void *data)
+static int b4xxp_proc_read(char *buf, char **start, off_t offset, int count, int *eof, void *data)
{
struct b4xxp **b4_cards = data;
char sBuf[256];
@@ -2601,12 +2603,10 @@ static struct pci_device_id b4xx_ids[] __devinitdata =
};
static struct pci_driver b4xx_driver = {
- name: "wcb4xxp",
- probe: b4xx_probe,
- remove: __devexit_p(b4xxp_remove),
- suspend: NULL,
- resume: NULL,
- id_table: b4xx_ids,
+ .name = "wcb4xxp",
+ .probe = b4xx_probe,
+ .remove = __devexit_p(b4xxp_remove),
+ .id_table = b4xx_ids,
};
static int __init b4xx_init(void)
diff --git a/drivers/dahdi/wcfxo.c b/drivers/dahdi/wcfxo.c
index fe5eb99..de956af 100644
--- a/drivers/dahdi/wcfxo.c
+++ b/drivers/dahdi/wcfxo.c
@@ -1026,10 +1026,10 @@ static struct pci_device_id wcfxo_pci_tbl[] = {
MODULE_DEVICE_TABLE (pci, wcfxo_pci_tbl);
static struct pci_driver wcfxo_driver = {
- name: "wcfxo",
- probe: wcfxo_init_one,
- remove: __devexit_p(wcfxo_remove_one),
- id_table: wcfxo_pci_tbl,
+ .name = "wcfxo",
+ .probe = wcfxo_init_one,
+ .remove = __devexit_p(wcfxo_remove_one),
+ .id_table = wcfxo_pci_tbl,
};
static int __init wcfxo_init(void)
diff --git a/drivers/dahdi/wct1xxp.c b/drivers/dahdi/wct1xxp.c
index 3b0f5b9..00aa0e3 100644
--- a/drivers/dahdi/wct1xxp.c
+++ b/drivers/dahdi/wct1xxp.c
@@ -165,7 +165,7 @@ struct t1xxp {
#define CANARY 0xca1e
-int debug = 0; /* doesnt do anything */
+static int debug = 0; /* doesnt do anything */
static struct t1xxp *cards[WC_MAX_CARDS];
@@ -1400,12 +1400,12 @@ static struct pci_device_id t1xxp_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci,t1xxp_pci_tbl);
static struct pci_driver t1xxp_driver = {
- name: "t1xxp",
- probe: t1xxp_init_one,
- remove: __devexit_p(t1xxp_remove_one),
- suspend: NULL,
- resume: NULL,
- id_table: t1xxp_pci_tbl,
+ .name = "t1xxp",
+ .probe = t1xxp_init_one,
+ .remove = __devexit_p(t1xxp_remove_one),
+ .suspend = NULL,
+ .resume = NULL,
+ . id_table = t1xxp_pci_tbl,
};
static int __init t1xxp_init(void)
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c
index d3d2577..83dd28d 100644
--- a/drivers/dahdi/wct4xxp/base.c
+++ b/drivers/dahdi/wct4xxp/base.c
@@ -327,7 +327,7 @@ struct t4 {
dma_addr_t writedma;
unsigned long memaddr; /* Base address of card */
unsigned long memlen;
- volatile unsigned int *membase; /* Base address of card */
+ __iomem volatile unsigned int *membase; /* Base address of card */
/* Add this for our softlockup protector */
unsigned int oct_rw_count;
@@ -1155,12 +1155,12 @@ static int t4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long dat
regs.pci[x] = t4_pci_in(wc, x);
for (x=0;x<NUM_REGS;x++)
regs.regs[x] = t4_framer_in(wc, chan->span->offset, x);
- if (copy_to_user((struct t4_regs *)data, &regs, sizeof(regs)))
+ if (copy_to_user((__user void *) data, &regs, sizeof(regs)))
return -EFAULT;
break;
#ifdef VPM_SUPPORT
case DAHDI_TONEDETECT:
- if (get_user(j, (int *)data))
+ if (get_user(j, (__user int *) data))
return -EFAULT;
if (!wc->vpm)
return -ENOSYS;
@@ -1191,7 +1191,8 @@ static int t4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long dat
static void inline t4_hdlc_xmit_fifo(struct t4 *wc, unsigned int span, struct t4_span *ts)
{
- int res, i, size = 32;
+ int res, i;
+ unsigned int size = 32;
unsigned char buf[32];
res = dahdi_hdlc_getbuf(ts->sigchan, buf, &size);
@@ -3796,12 +3797,10 @@ static struct pci_device_id t4_pci_tbl[] __devinitdata =
};
static struct pci_driver t4_driver = {
- name: "wct4xxp",
- probe: t4_init_one,
- remove: __devexit_p(t4_remove_one),
- suspend: NULL,
- resume: NULL,
- id_table: t4_pci_tbl,
+ .name = "wct4xxp",
+ .probe = t4_init_one,
+ .remove = __devexit_p(t4_remove_one),
+ .id_table = t4_pci_tbl,
};
static int __init t4_init(void)
diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c
index 86f9d12..657cabc 100644
--- a/drivers/dahdi/wctc4xxp/base.c
+++ b/drivers/dahdi/wctc4xxp/base.c
@@ -109,8 +109,8 @@
#define DTE_DEBUG_NETWORK_IF (1 << 5) /* 32 */
#define DTE_DEBUG_NETWORK_EARLY (1 << 6) /* 64 */
-int debug;
-char *mode;
+static int debug;
+static char *mode;
static spinlock_t wctc4xxp_list_lock;
static struct list_head wctc4xxp_list;
@@ -366,11 +366,11 @@ initialize_cmd(struct tcb *cmd, unsigned long cmd_flags)
kmem_cache_t *cmd_cache;
#else
/*! Used to allocate commands to submit to the dte. */
-struct kmem_cache *cmd_cache;
+static struct kmem_cache *cmd_cache;
#endif
static inline struct tcb *
-__alloc_cmd(unsigned alloc_flags, unsigned long cmd_flags)
+__alloc_cmd(gfp_t alloc_flags, unsigned long cmd_flags)
{
struct tcb *cmd;
@@ -506,13 +506,13 @@ static inline int wctc4xxp_is_ready(struct wcdte *wc) {
#define wctc4xxp_send_cmd(wc, command) ({ \
int __res; \
u8 _cmd[] = command; \
- struct tcb *cmd; \
- if (!(cmd=__alloc_cmd(GFP_KERNEL, WAIT_FOR_RESPONSE))) \
+ struct tcb *__cmd; \
+ if (!(__cmd=__alloc_cmd(GFP_KERNEL, WAIT_FOR_RESPONSE))) \
return -ENOMEM; \
BUG_ON(sizeof(_cmd) > SFRAME_SIZE); \
- memcpy(cmd->data, _cmd, sizeof(_cmd)); \
- cmd->data_len = sizeof(_cmd); \
- __res = __wctc4xxp_send_cmd(wc, cmd); \
+ memcpy(__cmd->data, _cmd, sizeof(_cmd)); \
+ __cmd->data_len = sizeof(_cmd); \
+ __res = __wctc4xxp_send_cmd(wc, __cmd); \
__res; \
})
#define wctc4xxp_create_cmd(wc, command) ({ \
@@ -582,7 +582,7 @@ tcb_to_skb(struct net_device *netdev, const struct tcb *cmd)
static struct tcb *
wctc4xxp_skb_to_cmd(struct wcdte *wc, const struct sk_buff *skb)
{
- const unsigned long alloc_flags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
+ const gfp_t alloc_flags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
struct tcb *cmd;
/* const static char dev_mac[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55}; */
if ((cmd = __alloc_cmd(alloc_flags, 0))) {
@@ -993,7 +993,7 @@ wctc4xxp_initialize_descriptor_ring(struct pci_dev *pdev, struct wctc4xxp_descri
#define OWNED(_d_) (((_d_)->des0)&OWN_BIT)
#define SET_OWNED(_d_) do { wmb(); (_d_)->des0 |= OWN_BIT; wmb();} while (0)
-const unsigned int BUFFER1_SIZE_MASK = 0x7ff;
+static const unsigned int BUFFER1_SIZE_MASK = 0x7ff;
static int
wctc4xxp_submit(struct wctc4xxp_descriptor_ring* dr, struct tcb *c)
@@ -1158,7 +1158,7 @@ __wctc4xxp_create_channel_cmd(struct wcdte *wc, struct tcb *cmd, u16 timeslot)
cmd->data_len = sizeof(*c);
}
-struct tcb *
+static struct tcb *
wctc4xxp_create_channel_cmd(struct wcdte *wc, u16 timeslot)
{
struct tcb *cmd;
@@ -1169,7 +1169,7 @@ wctc4xxp_create_channel_cmd(struct wcdte *wc, u16 timeslot)
return cmd;
}
-void
+static void
__wctc4xxp_create_set_arm_clk_cmd(struct wcdte *wc, struct tcb *cmd)
{
struct csm_encaps_hdr *hdr = cmd->data;
@@ -1191,7 +1191,7 @@ __wctc4xxp_create_set_arm_clk_cmd(struct wcdte *wc, struct tcb *cmd)
return;
}
-struct tcb *
+static struct tcb *
wctc4xxp_create_rtp_cmd(struct wcdte *wc, struct dahdi_transcoder_channel *dtc, size_t inbytes)
{
const struct channel_pvt *cpvt = dtc->pvt;
@@ -3245,15 +3245,13 @@ static struct pci_device_id wctc4xxp_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, wctc4xxp_pci_tbl);
static struct pci_driver wctc4xxp_driver = {
- name: "wctc4xxp",
- probe: wctc4xxp_init_one,
- remove: __devexit_p(wctc4xxp_remove_one),
- suspend: NULL,
- resume: NULL,
- id_table: wctc4xxp_pci_tbl,
+ .name = "wctc4xxp",
+ .probe = wctc4xxp_init_one,
+ .remove = __devexit_p(wctc4xxp_remove_one),
+ .id_table = wctc4xxp_pci_tbl,
};
-int __init wctc4xxp_init(void)
+static int __init wctc4xxp_init(void)
{
int res;
# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
@@ -3275,7 +3273,7 @@ int __init wctc4xxp_init(void)
return 0;
}
-void __exit wctc4xxp_cleanup(void)
+static void __exit wctc4xxp_cleanup(void)
{
pci_unregister_driver(&wctc4xxp_driver);
kmem_cache_destroy(cmd_cache);
diff --git a/drivers/dahdi/wctdm.c b/drivers/dahdi/wctdm.c
index 09f079c..036f418 100644
--- a/drivers/dahdi/wctdm.c
+++ b/drivers/dahdi/wctdm.c
@@ -1791,7 +1791,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
case DAHDI_ONHOOKTRANSFER:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
return -EINVAL;
- if (get_user(x, (int *)data))
+ if (get_user(x, (__user int *) data))
return -EFAULT;
wc->mod[chan->chanpos - 1].fxs.ohttimer = x << 3;
if (reversepolarity)
@@ -1808,7 +1808,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
}
break;
case DAHDI_SETPOLARITY:
- if (get_user(x, (int *)data))
+ if (get_user(x, (__user int *) data))
return -EFAULT;
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
return -EINVAL;
@@ -1834,7 +1834,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
stats.batvolt = (signed char)wctdm_getreg(wc, chan->chanpos - 1, 29) * 1000;
} else
return -EINVAL;
- if (copy_to_user((struct wctdm_stats *)data, &stats, sizeof(stats)))
+ if (copy_to_user((__user void *)data, &stats, sizeof(stats)))
return -EFAULT;
break;
case WCTDM_GET_REGS:
@@ -1848,11 +1848,11 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
for (x=0;x<NUM_FXO_REGS;x++)
regs.direct[x] = wctdm_getreg(wc, chan->chanpos - 1, x);
}
- if (copy_to_user((struct wctdm_regs *)data, &regs, sizeof(regs)))
+ if (copy_to_user((__user void *)data, &regs, sizeof(regs)))
return -EFAULT;
break;
case WCTDM_SET_REG:
- if (copy_from_user(&regop, (struct wctdm_regop *)data, sizeof(regop)))
+ if (copy_from_user(&regop, (__user void *) data, sizeof(regop)))
return -EFAULT;
if (regop.indirect) {
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
@@ -1867,7 +1867,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
break;
case WCTDM_SET_ECHOTUNE:
printk(KERN_INFO "-- Setting echo registers: \n");
- if (copy_from_user(&echoregs, (struct wctdm_echo_coefs*)data, sizeof(echoregs)))
+ if (copy_from_user(&echoregs, (__user void *)data, sizeof(echoregs)))
return -EFAULT;
if (wc->modtype[chan->chanpos - 1] == MOD_TYPE_FXO) {
@@ -1893,7 +1893,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
}
break;
case DAHDI_SET_HWGAIN:
- if (copy_from_user(&hwgain, (struct dahdi_hwgain*) data, sizeof(hwgain)))
+ if (copy_from_user(&hwgain, (__user void *) data, sizeof(hwgain)))
return -EFAULT;
wctdm_set_hwgain(wc, chan->chanpos-1, hwgain.newgain, hwgain.tx);
@@ -2322,8 +2322,6 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
if (wctdm_hardware_init(wc)) {
- unsigned char x;
-
/* Set Reset Low */
x=inb(wc->ioaddr + WC_CNTL);
outb((~0x1)&x, wc->ioaddr + WC_CNTL);
@@ -2420,12 +2418,12 @@ static struct pci_device_id wctdm_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, wctdm_pci_tbl);
static struct pci_driver wctdm_driver = {
- name: "wctdm",
- probe: wctdm_init_one,
- remove: __devexit_p(wctdm_remove_one),
- suspend: NULL,
- resume: NULL,
- id_table: wctdm_pci_tbl,
+ .name = "wctdm",
+ .probe = wctdm_init_one,
+ .remove =__devexit_p(wctdm_remove_one),
+ .suspend = NULL,
+ .resume = NULL,
+ .id_table = wctdm_pci_tbl,
};
static int __init wctdm_init(void)
diff --git a/drivers/dahdi/wctdm24xxp/GpakApi.c b/drivers/dahdi/wctdm24xxp/GpakApi.c
index 45825fb..1f1bb0b 100644
--- a/drivers/dahdi/wctdm24xxp/GpakApi.c
+++ b/drivers/dahdi/wctdm24xxp/GpakApi.c
@@ -1265,7 +1265,7 @@ gpakReadFramingStatsStatus_t gpakReadFramingStats(
*pFramingError3Count = ReadBuffer[2];
*pDmaStopErrorCount = ReadBuffer[3];
- if(pDmaSlipStatsBuffer != 0)
+ if(pDmaSlipStatsBuffer != NULL)
// If users want to get the DMA slips count
{
pDmaSlipStatsBuffer[0] = ReadBuffer[4];
diff --git a/drivers/dahdi/wctdm24xxp/GpakCust.c b/drivers/dahdi/wctdm24xxp/GpakCust.c
index 95c5f8e..ea77e0d 100644
--- a/drivers/dahdi/wctdm24xxp/GpakCust.c
+++ b/drivers/dahdi/wctdm24xxp/GpakCust.c
@@ -133,8 +133,8 @@ static inline int vpm150m_io_wait(struct wctdm *wc)
return ret;
}
-int wctdm_vpm150m_getreg_full_async(struct wctdm *wc, int pagechange, unsigned int len,
- unsigned short addr, unsigned short *outbuf, struct vpm150m_cmd **hit_p)
+static int wctdm_vpm150m_getreg_full_async(struct wctdm *wc, int pagechange, unsigned int len,
+ unsigned short addr, unsigned short *outbuf, struct vpm150m_cmd **hit_p)
{
int ret=0;
unsigned long flags;
@@ -157,8 +157,8 @@ int wctdm_vpm150m_getreg_full_async(struct wctdm *wc, int pagechange, unsigned i
return ret;
}
-int wctdm_vpm150m_getreg_full_return(struct wctdm *wc, int pagechange, unsigned int len,
- unsigned short addr, unsigned short *outbuf, struct vpm150m_cmd **hit_p)
+static int wctdm_vpm150m_getreg_full_return(struct wctdm *wc, int pagechange, unsigned int len,
+ unsigned short addr, unsigned short *outbuf, struct vpm150m_cmd **hit_p)
{
int ret = 0;
unsigned long flags;
@@ -184,9 +184,9 @@ int wctdm_vpm150m_getreg_full_return(struct wctdm *wc, int pagechange, unsigned
return ret;
}
-int wctdm_vpm150m_getreg_full(struct wctdm *wc, int pagechange, unsigned int len, unsigned short addr, unsigned short *outbuf)
+static int wctdm_vpm150m_getreg_full(struct wctdm *wc, int pagechange, unsigned int len, unsigned short addr, unsigned short *outbuf)
{
- struct vpm150m_cmd *hit = 0;
+ struct vpm150m_cmd *hit = NULL;
int ret = 0;
do {
ret = wctdm_vpm150m_getreg_full_async(wc, pagechange, len, addr, outbuf, &hit);
@@ -202,7 +202,7 @@ int wctdm_vpm150m_getreg_full(struct wctdm *wc, int pagechange, unsigned int len
return ret;
}
-int wctdm_vpm150m_setreg_full(struct wctdm *wc, int pagechange, unsigned int len, unsigned int addr, unsigned short *data)
+static int wctdm_vpm150m_setreg_full(struct wctdm *wc, int pagechange, unsigned int len, unsigned int addr, unsigned short *data)
{
unsigned long flags;
struct vpm150m_cmd *hit;
@@ -293,7 +293,7 @@ void gpakReadDspMemory(
vpm150m_io_wait(wc);
if ( NumWords < VPM150M_MAX_COMMANDS ) {
- struct vpm150m_cmd* cmds[VPM150M_MAX_COMMANDS] = {0};
+ struct vpm150m_cmd* cmds[VPM150M_MAX_COMMANDS] = { NULL };
wctdm_vpm150m_setpage(wc, DspAddress >> 16);
DspAddress &= 0xffff;
for (i=0; i < NumWords; ++i) {
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index d915c54..f157af2 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -1574,14 +1574,14 @@ static inline void wctdm_isr_misc(struct wctdm *wc)
#endif
}
-void handle_receive(void* vbb, void* context)
+static void handle_receive(void* vbb, void* context)
{
struct wctdm *wc = context;
wc->rxints++;
wctdm_receiveprep(wc, vbb);
}
-void handle_transmit(void* vbb, void* context)
+static void handle_transmit(void* vbb, void* context)
{
struct wctdm *wc = context;
memset(vbb, 0, SFRAME_SIZE);
@@ -2408,7 +2408,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
case DAHDI_ONHOOKTRANSFER:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
return -EINVAL;
- if (get_user(x, (int *)data))
+ if (get_user(x, (__user int *) data))
return -EFAULT;
wc->mods[chan->chanpos - 1].fxs.ohttimer = x << 3;
wc->mods[chan->chanpos - 1].fxs.idletxhookstate = 0x2; /* OHT mode when idle */
@@ -2430,7 +2430,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
stats.batvolt = (signed char)wctdm_getreg(wc, chan->chanpos - 1, 29) * 1000;
} else
return -EINVAL;
- if (copy_to_user((struct wctdm_stats *)data, &stats, sizeof(stats)))
+ if (copy_to_user((__user void *) data, &stats, sizeof(stats)))
return -EFAULT;
break;
case WCTDM_GET_REGS:
@@ -2448,11 +2448,11 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
for (x=0;x<NUM_FXO_REGS;x++)
regs.direct[x] = wctdm_getreg(wc, chan->chanpos - 1, x);
}
- if (copy_to_user((struct wctdm_regs *)data, &regs, sizeof(regs)))
+ if (copy_to_user((__user void *)data, &regs, sizeof(regs)))
return -EFAULT;
break;
case WCTDM_SET_REG:
- if (copy_from_user(&regop, (struct wctdm_regop *)data, sizeof(regop)))
+ if (copy_from_user(&regop, (__user void *) data, sizeof(regop)))
return -EFAULT;
if (regop.indirect) {
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
@@ -2470,7 +2470,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
break;
case WCTDM_SET_ECHOTUNE:
printk(KERN_INFO "-- Setting echo registers: \n");
- if (copy_from_user(&echoregs, (struct wctdm_echo_coefs*)data, sizeof(echoregs)))
+ if (copy_from_user(&echoregs, (__user void *) data, sizeof(echoregs)))
return -EFAULT;
if (wc->modtype[chan->chanpos - 1] == MOD_TYPE_FXO) {
@@ -2496,7 +2496,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
}
break;
case DAHDI_SET_HWGAIN:
- if (copy_from_user(&hwgain, (struct dahdi_hwgain*) data, sizeof(hwgain)))
+ if (copy_from_user(&hwgain, (__user void *) data, sizeof(hwgain)))
return -EFAULT;
wctdm_set_hwgain(wc, chan->chanpos-1, hwgain.newgain, hwgain.tx);
@@ -2507,7 +2507,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
break;
#ifdef VPM_SUPPORT
case DAHDI_TONEDETECT:
- if (get_user(x, (int *) data))
+ if (get_user(x, (__user int *) data))
return -EFAULT;
if (!wc->vpm && !wc->vpm150m)
return -ENOSYS;
@@ -2532,7 +2532,8 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
case DAHDI_RADIO_GETPARAM:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_QRV)
return -ENOTTY;
- if (copy_from_user(&stack.p,(struct dahdi_radio_param *)data,sizeof(struct dahdi_radio_param))) return -EFAULT;
+ if (copy_from_user(&stack.p, (__user void *) data, sizeof(stack.p)))
+ return -EFAULT;
stack.p.data = 0; /* start with 0 value in output */
switch(stack.p.radpar) {
case DAHDI_RADPAR_INVERTCOR:
@@ -2584,12 +2585,14 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
default:
return -EINVAL;
}
- if (copy_to_user((struct dahdi_radio_param *)data,&stack.p,sizeof(struct dahdi_radio_param))) return -EFAULT;
+ if (copy_to_user((__user void *) data, &stack.p, sizeof(stack.p)))
+ return -EFAULT;
break;
case DAHDI_RADIO_SETPARAM:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_QRV)
return -ENOTTY;
- if (copy_from_user(&stack.p,(struct dahdi_radio_param *)data,sizeof(struct dahdi_radio_param))) return -EFAULT;
+ if (copy_from_user(&stack.p, (__user void *) data, sizeof(stack.p)))
+ return -EFAULT;
switch(stack.p.radpar) {
case DAHDI_RADPAR_INVERTCOR:
if (stack.p.data)
@@ -2987,7 +2990,7 @@ static void wctdm_post_initialize(struct wctdm *wc)
#ifdef VPM150M_SUPPORT
-void vpm150m_set_chanconfig_from_state(struct adt_lec_params * parms, int channum, GpakChannelConfig_t *chanconfig)
+static void vpm150m_set_chanconfig_from_state(struct adt_lec_params * parms, int channum, GpakChannelConfig_t *chanconfig)
{
chanconfig->PcmInPortA = 3;
chanconfig->PcmInSlotA = channum;
@@ -4032,12 +4035,10 @@ static struct pci_device_id wctdm_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, wctdm_pci_tbl);
static struct pci_driver wctdm_driver = {
- name: "wctdm24xxp",
- probe: wctdm_init_one,
- remove: __devexit_p(wctdm_remove_one),
- suspend: NULL,
- resume: NULL,
- id_table: wctdm_pci_tbl,
+ .name = "wctdm24xxp",
+ .probe = wctdm_init_one,
+ .remove = __devexit_p(wctdm_remove_one),
+ .id_table = wctdm_pci_tbl,
};
static int __init wctdm_init(void)
diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c
index c314167..7c2f76e 100644
--- a/drivers/dahdi/wcte11xp.c
+++ b/drivers/dahdi/wcte11xp.c
@@ -435,7 +435,7 @@ static int t1xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
for (x=0;x<NUM_REGS;x++)
regs.regs[x] = t1_framer_in(wc, x);
- if (copy_to_user((struct t4_regs *)data, &regs, sizeof(regs)))
+ if (copy_to_user((__user void *)data, &regs, sizeof(regs)))
return -EFAULT;
break;
default:
@@ -1592,12 +1592,12 @@ static struct pci_device_id t1xxp_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci,t1xxp_pci_tbl);
static struct pci_driver t1xxp_driver = {
- name: "wcte11xp",
- probe: t1xxp_init_one,
- remove: __devexit_p(t1xxp_remove_one),
- suspend: NULL,
- resume: NULL,
- id_table: t1xxp_pci_tbl,
+ .name = "wcte11xp",
+ .probe = t1xxp_init_one,
+ .remove = __devexit_p(t1xxp_remove_one),
+ .suspend = NULL,
+ .resume = NULL,
+ .id_table = t1xxp_pci_tbl,
};
static int __init t1xxp_init(void)
diff --git a/drivers/dahdi/wcte12xp/GpakApi.c b/drivers/dahdi/wcte12xp/GpakApi.c
index bcba139..748cc94 100644
--- a/drivers/dahdi/wcte12xp/GpakApi.c
+++ b/drivers/dahdi/wcte12xp/GpakApi.c
@@ -1249,7 +1249,7 @@ gpakReadFramingStatsStatus_t gpakReadFramingStats(
*pFramingError3Count = ReadBuffer[2];
*pDmaStopErrorCount = ReadBuffer[3];
- if(pDmaSlipStatsBuffer != 0)
+ if(pDmaSlipStatsBuffer != NULL)
// If users want to get the DMA slips count
{
pDmaSlipStatsBuffer[0] = ReadBuffer[4];
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index ee65acc..6ed6abf 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -91,7 +91,7 @@ static int latency = VOICEBUS_DEFAULT_LATENCY;
#ifdef VPM_SUPPORT
int vpmsupport = 1;
int vpmdtmfsupport = 0;
-int vpmtsisupport = 0;
+static int vpmtsisupport = 0;
int vpmnlptype = 1;
int vpmnlpthresh = 24;
int vpmnlpmaxsupp = 0;
@@ -1018,7 +1018,7 @@ static int t1xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
break;
#ifdef VPM_SUPPORT
case DAHDI_TONEDETECT:
- if (get_user(x, (int *) data))
+ if (get_user(x, (__user int *) data))
return -EFAULT;
if (!wc->vpm150m)
return -ENOSYS;
@@ -1714,12 +1714,10 @@ static struct pci_device_id te12xp_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, te12xp_pci_tbl);
struct pci_driver te12xp_driver = {
- name: "wcte12xp",
- probe: te12xp_init_one,
- remove: __devexit_p(te12xp_remove_one),
- suspend: NULL,
- resume: NULL,
- id_table: te12xp_pci_tbl,
+ .name = "wcte12xp",
+ .probe = te12xp_init_one,
+ .remove = __devexit_p(te12xp_remove_one),
+ .id_table = te12xp_pci_tbl,
};
static int __init te12xp_init(void)
diff --git a/drivers/dahdi/wcte12xp/vpmadt032.c b/drivers/dahdi/wcte12xp/vpmadt032.c
index 9040505..1df5415 100644
--- a/drivers/dahdi/wcte12xp/vpmadt032.c
+++ b/drivers/dahdi/wcte12xp/vpmadt032.c
@@ -46,12 +46,6 @@
#include "vpmadt032.h"
#include "GpakApi.h"
-extern struct t1 *ifaces[WC_MAX_IFACES];
-
-extern int vpmnlptype;
-extern int vpmnlpthresh;
-extern int vpmnlpmaxsupp;
-
#ifdef VPM_SUPPORT
inline void vpm150m_cmd_dequeue(struct t1 *wc, volatile unsigned char *writechunk, int whichframe)
@@ -317,8 +311,8 @@ static inline int vpm150m_io_wait(struct t1 *wc)
return ret;
}
-int t1_vpm150m_getreg_full_async(struct t1 *wc, int pagechange, unsigned int len,
- unsigned short addr, unsigned short *outbuf, struct vpm150m_cmd **hit_p)
+static int t1_vpm150m_getreg_full_async(struct t1 *wc, int pagechange, unsigned int len,
+ unsigned short addr, unsigned short *outbuf, struct vpm150m_cmd **hit_p)
{
int ret=0;
unsigned long flags;
@@ -341,8 +335,8 @@ int t1_vpm150m_getreg_full_async(struct t1 *wc, int pagechange, unsigned int len
return ret;
}
-int t1_vpm150m_getreg_full_return(struct t1 *wc, int pagechange, unsigned int len,
- unsigned short addr, unsigned short *outbuf, struct vpm150m_cmd **hit_p)
+static int t1_vpm150m_getreg_full_return(struct t1 *wc, int pagechange, unsigned int len,
+ unsigned short addr, unsigned short *outbuf, struct vpm150m_cmd **hit_p)
{
int ret = 0;
unsigned long flags;
@@ -368,9 +362,9 @@ int t1_vpm150m_getreg_full_return(struct t1 *wc, int pagechange, unsigned int le
return ret;
}
-int t1_vpm150m_getreg_full(struct t1 *wc, int pagechange, unsigned int len, unsigned short addr, unsigned short *outbuf)
+static int t1_vpm150m_getreg_full(struct t1 *wc, int pagechange, unsigned int len, unsigned short addr, unsigned short *outbuf)
{
- struct vpm150m_cmd *hit = 0;
+ struct vpm150m_cmd *hit = NULL;
int ret = 0;
do {
ret = t1_vpm150m_getreg_full_async(wc, pagechange, len, addr, outbuf, &hit);
@@ -387,7 +381,7 @@ int t1_vpm150m_getreg_full(struct t1 *wc, int pagechange, unsigned int len, unsi
return ret;
}
-int t1_vpm150m_setreg_full(struct t1 *wc, int pagechange, unsigned int len, unsigned int addr, unsigned short *data)
+static int t1_vpm150m_setreg_full(struct t1 *wc, int pagechange, unsigned int len, unsigned int addr, unsigned short *data)
{
unsigned long flags;
struct vpm150m_cmd *hit;
@@ -413,7 +407,7 @@ int t1_vpm150m_setreg_full(struct t1 *wc, int pagechange, unsigned int len, unsi
return (hit) ? 0 : -1;
}
-int t1_vpm150m_setpage(struct t1 *wc, unsigned short addr)
+static int t1_vpm150m_setpage(struct t1 *wc, unsigned short addr)
{
addr &= 0xf;
/* Let's optimize this a little bit */
@@ -426,14 +420,14 @@ int t1_vpm150m_setpage(struct t1 *wc, unsigned short addr)
return t1_vpm150m_setreg_full(wc, 1, 1, 0, &addr);
}
-unsigned char t1_vpm150m_getpage(struct t1 *wc)
+static unsigned char t1_vpm150m_getpage(struct t1 *wc)
{
unsigned short res;
t1_vpm150m_getreg_full(wc, 1, 1, 0, &res);
return res;
}
-int t1_vpm150m_setreg(struct t1 *wc, unsigned int len, unsigned int addr, unsigned short *data)
+static int t1_vpm150m_setreg(struct t1 *wc, unsigned int len, unsigned int addr, unsigned short *data)
{
int res;
t1_vpm150m_setpage(wc, addr >> 16);
@@ -443,7 +437,7 @@ int t1_vpm150m_setreg(struct t1 *wc, unsigned int len, unsigned int addr, unsign
return res;
}
-unsigned short t1_vpm150m_getreg(struct t1 *wc, unsigned int len, unsigned int addr, unsigned short *data)
+static unsigned short t1_vpm150m_getreg(struct t1 *wc, unsigned int len, unsigned int addr, unsigned short *data)
{
unsigned short res;
t1_vpm150m_setpage(wc, addr >> 16);
@@ -780,7 +774,6 @@ void t1_vpm150m_init(struct t1 *wc) {
#define TEST_SIZE 2
if (debug) {
- int i;
unsigned short msg[TEST_SIZE];
set_bit(VPM150M_HPIRESET, &vpm150m->control);
@@ -957,7 +950,7 @@ void gpakReadDspMemory(
vpm150m_io_wait(wc);
if ( NumWords < VPM150M_MAX_COMMANDS ) {
- struct vpm150m_cmd* cmds[VPM150M_MAX_COMMANDS] = {0};
+ struct vpm150m_cmd* cmds[VPM150M_MAX_COMMANDS] = { NULL };
t1_vpm150m_setpage(wc, DspAddress >> 16);
DspAddress &= 0xffff;
for (i=0; i < NumWords; ++i) {
diff --git a/drivers/dahdi/wcte12xp/vpmadt032.h b/drivers/dahdi/wcte12xp/vpmadt032.h
index 77dbd4b..da50d6a 100644
--- a/drivers/dahdi/wcte12xp/vpmadt032.h
+++ b/drivers/dahdi/wcte12xp/vpmadt032.h
@@ -112,6 +112,10 @@ extern int debug;
extern int vpmsupport;
extern int vpmdtmfsupport;
extern struct pci_driver te12xp_driver;
+extern struct t1 *ifaces[WC_MAX_IFACES];
+extern int vpmnlptype;
+extern int vpmnlpthresh;
+extern int vpmnlpmaxsupp;
void t1_vpm150m_init(struct t1 *wc);
void vpm150m_cmd_dequeue(struct t1 *wc, volatile unsigned char *writechunk, int whichframe);