Commit a247c9ec authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: atm annotation - drivers

The rest of ATM annotation: drivers.
parent ad1dc395
...@@ -152,7 +152,7 @@ static void atmtcp_v_close(struct atm_vcc *vcc) ...@@ -152,7 +152,7 @@ static void atmtcp_v_close(struct atm_vcc *vcc)
} }
static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
{ {
struct atm_cirange ci; struct atm_cirange ci;
struct atm_vcc *vcc; struct atm_vcc *vcc;
...@@ -161,7 +161,7 @@ static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -161,7 +161,7 @@ static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
int i; int i;
if (cmd != ATM_SETCIRANGE) return -ENOIOCTLCMD; if (cmd != ATM_SETCIRANGE) return -ENOIOCTLCMD;
if (copy_from_user(&ci,(void *) arg,sizeof(ci))) return -EFAULT; if (copy_from_user(&ci, arg,sizeof(ci))) return -EFAULT;
if (ci.vpi_bits == ATM_CI_MAX) ci.vpi_bits = MAX_VPI_BITS; if (ci.vpi_bits == ATM_CI_MAX) ci.vpi_bits = MAX_VPI_BITS;
if (ci.vci_bits == ATM_CI_MAX) ci.vci_bits = MAX_VCI_BITS; if (ci.vci_bits == ATM_CI_MAX) ci.vci_bits = MAX_VCI_BITS;
if (ci.vpi_bits > MAX_VPI_BITS || ci.vpi_bits < 0 || if (ci.vpi_bits > MAX_VPI_BITS || ci.vpi_bits < 0 ||
......
...@@ -1968,7 +1968,7 @@ static int eni_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flgs) ...@@ -1968,7 +1968,7 @@ static int eni_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flgs)
} }
static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
{ {
struct eni_dev *eni_dev = ENI_DEV(dev); struct eni_dev *eni_dev = ENI_DEV(dev);
...@@ -1983,7 +1983,7 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -1983,7 +1983,7 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
struct eni_multipliers mult; struct eni_multipliers mult;
if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!capable(CAP_NET_ADMIN)) return -EPERM;
if (copy_from_user(&mult,(void *) arg, if (copy_from_user(&mult, arg,
sizeof(struct eni_multipliers))) sizeof(struct eni_multipliers)))
return -EFAULT; return -EFAULT;
if ((mult.tx && mult.tx <= 100) || (mult.rx &&mult.rx <= 100) || if ((mult.tx && mult.tx <= 100) || (mult.rx &&mult.rx <= 100) ||
...@@ -1996,7 +1996,7 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -1996,7 +1996,7 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
if (cmd == ATM_SETCIRANGE) { if (cmd == ATM_SETCIRANGE) {
struct atm_cirange ci; struct atm_cirange ci;
if (copy_from_user(&ci,(void *) arg,sizeof(struct atm_cirange))) if (copy_from_user(&ci, arg,sizeof(struct atm_cirange)))
return -EFAULT; return -EFAULT;
if ((ci.vpi_bits == 0 || ci.vpi_bits == ATM_CI_MAX) && if ((ci.vpi_bits == 0 || ci.vpi_bits == ATM_CI_MAX) &&
(ci.vci_bits == NR_VCI_LD || ci.vpi_bits == ATM_CI_MAX)) (ci.vci_bits == NR_VCI_LD || ci.vpi_bits == ATM_CI_MAX))
...@@ -2009,14 +2009,14 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -2009,14 +2009,14 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
static int eni_getsockopt(struct atm_vcc *vcc,int level,int optname, static int eni_getsockopt(struct atm_vcc *vcc,int level,int optname,
void *optval,int optlen) void __user *optval,int optlen)
{ {
return -EINVAL; return -EINVAL;
} }
static int eni_setsockopt(struct atm_vcc *vcc,int level,int optname, static int eni_setsockopt(struct atm_vcc *vcc,int level,int optname,
void *optval,int optlen) void __user *optval,int optlen)
{ {
return -EINVAL; return -EINVAL;
} }
......
...@@ -1220,7 +1220,7 @@ static int fs_send (struct atm_vcc *atm_vcc, struct sk_buff *skb) ...@@ -1220,7 +1220,7 @@ static int fs_send (struct atm_vcc *atm_vcc, struct sk_buff *skb)
/* Some function placeholders for functions we don't yet support. */ /* Some function placeholders for functions we don't yet support. */
#if 0 #if 0
static int fs_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) static int fs_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
{ {
func_enter (); func_enter ();
func_exit (); func_exit ();
...@@ -1229,7 +1229,7 @@ static int fs_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -1229,7 +1229,7 @@ static int fs_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
static int fs_getsockopt(struct atm_vcc *vcc,int level,int optname, static int fs_getsockopt(struct atm_vcc *vcc,int level,int optname,
void *optval,int optlen) void __user *optval,int optlen)
{ {
func_enter (); func_enter ();
func_exit (); func_exit ();
...@@ -1238,7 +1238,7 @@ static int fs_getsockopt(struct atm_vcc *vcc,int level,int optname, ...@@ -1238,7 +1238,7 @@ static int fs_getsockopt(struct atm_vcc *vcc,int level,int optname,
static int fs_setsockopt(struct atm_vcc *vcc,int level,int optname, static int fs_setsockopt(struct atm_vcc *vcc,int level,int optname,
void *optval,int optlen) void __user *optval,int optlen)
{ {
func_enter (); func_enter ();
func_exit (); func_exit ();
......
...@@ -1911,7 +1911,7 @@ fore200e_getstats(struct fore200e* fore200e) ...@@ -1911,7 +1911,7 @@ fore200e_getstats(struct fore200e* fore200e)
static int static int
fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void* optval, int optlen) fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void __user *optval, int optlen)
{ {
/* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */ /* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */
...@@ -1923,7 +1923,7 @@ fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void* optval, i ...@@ -1923,7 +1923,7 @@ fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void* optval, i
static int static int
fore200e_setsockopt(struct atm_vcc* vcc, int level, int optname, void* optval, int optlen) fore200e_setsockopt(struct atm_vcc* vcc, int level, int optname, void __user *optval, int optlen)
{ {
/* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */ /* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */
...@@ -2059,7 +2059,7 @@ fore200e_swap(unsigned int in) ...@@ -2059,7 +2059,7 @@ fore200e_swap(unsigned int in)
static int static int
fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats* arg) fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg)
{ {
struct sonet_stats tmp; struct sonet_stats tmp;
...@@ -2088,7 +2088,7 @@ fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats* arg) ...@@ -2088,7 +2088,7 @@ fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats* arg)
static int static int
fore200e_ioctl(struct atm_dev* dev, unsigned int cmd, void* arg) fore200e_ioctl(struct atm_dev* dev, unsigned int cmd, void __user * arg)
{ {
struct fore200e* fore200e = FORE200E_DEV(dev); struct fore200e* fore200e = FORE200E_DEV(dev);
...@@ -2097,19 +2097,19 @@ fore200e_ioctl(struct atm_dev* dev, unsigned int cmd, void* arg) ...@@ -2097,19 +2097,19 @@ fore200e_ioctl(struct atm_dev* dev, unsigned int cmd, void* arg)
switch (cmd) { switch (cmd) {
case SONET_GETSTAT: case SONET_GETSTAT:
return fore200e_fetch_stats(fore200e, (struct sonet_stats*)arg); return fore200e_fetch_stats(fore200e, (struct sonet_stats __user *)arg);
case SONET_GETDIAG: case SONET_GETDIAG:
return put_user(0, (int*)arg) ? -EFAULT : 0; return put_user(0, (int __user *)arg) ? -EFAULT : 0;
case ATM_SETLOOP: case ATM_SETLOOP:
return fore200e_setloop(fore200e, (int)(unsigned long)arg); return fore200e_setloop(fore200e, (int)(unsigned long)arg);
case ATM_GETLOOP: case ATM_GETLOOP:
return put_user(fore200e->loop_mode, (int*)arg) ? -EFAULT : 0; return put_user(fore200e->loop_mode, (int __user *)arg) ? -EFAULT : 0;
case ATM_QUERYLOOP: case ATM_QUERYLOOP:
return put_user(ATM_LM_LOC_PHY | ATM_LM_RMT_PHY, (int*)arg) ? -EFAULT : 0; return put_user(ATM_LM_LOC_PHY | ATM_LM_RMT_PHY, (int __user *)arg) ? -EFAULT : 0;
} }
return -ENOSYS; /* not implemented */ return -ENOSYS; /* not implemented */
......
...@@ -556,7 +556,7 @@ typedef struct host_bsq_entry { ...@@ -556,7 +556,7 @@ typedef struct host_bsq_entry {
typedef struct host_cmdq_entry { typedef struct host_cmdq_entry {
struct cp_cmdq_entry* cp_entry; /* addr of cp resident cmd queue entry */ struct cp_cmdq_entry* cp_entry; /* addr of cp resident cmd queue entry */
enum status* status; /* addr of host resident status */ enum status *status; /* addr of host resident status */
} host_cmdq_entry_t; } host_cmdq_entry_t;
......
...@@ -134,7 +134,7 @@ static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $"; ...@@ -134,7 +134,7 @@ static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
static int he_open(struct atm_vcc *vcc); static int he_open(struct atm_vcc *vcc);
static void he_close(struct atm_vcc *vcc); static void he_close(struct atm_vcc *vcc);
static int he_send(struct atm_vcc *vcc, struct sk_buff *skb); static int he_send(struct atm_vcc *vcc, struct sk_buff *skb);
static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg); static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg);
static irqreturn_t he_irq_handler(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t he_irq_handler(int irq, void *dev_id, struct pt_regs *regs);
static void he_tasklet(unsigned long data); static void he_tasklet(unsigned long data);
static int he_proc_read(struct atm_dev *dev,loff_t *pos,char *page); static int he_proc_read(struct atm_dev *dev,loff_t *pos,char *page);
...@@ -2809,7 +2809,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) ...@@ -2809,7 +2809,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
} }
static int static int
he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg) he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg)
{ {
unsigned long flags; unsigned long flags;
struct he_dev *he_dev = HE_DEV(atm_dev); struct he_dev *he_dev = HE_DEV(atm_dev);
...@@ -2821,7 +2821,7 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg) ...@@ -2821,7 +2821,7 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&reg, (struct he_ioctl_reg *) arg, if (copy_from_user(&reg, arg,
sizeof(struct he_ioctl_reg))) sizeof(struct he_ioctl_reg)))
return -EFAULT; return -EFAULT;
...@@ -2848,7 +2848,7 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg) ...@@ -2848,7 +2848,7 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
} }
spin_unlock_irqrestore(&he_dev->global_lock, flags); spin_unlock_irqrestore(&he_dev->global_lock, flags);
if (err == 0) if (err == 0)
if (copy_to_user((struct he_ioctl_reg *) arg, &reg, if (copy_to_user(arg, &reg,
sizeof(struct he_ioctl_reg))) sizeof(struct he_ioctl_reg)))
return -EFAULT; return -EFAULT;
break; break;
......
...@@ -141,7 +141,7 @@ static void idt77105_restart_timer_func(unsigned long dummy) ...@@ -141,7 +141,7 @@ static void idt77105_restart_timer_func(unsigned long dummy)
} }
static int fetch_stats(struct atm_dev *dev,struct idt77105_stats *arg,int zero) static int fetch_stats(struct atm_dev *dev,struct idt77105_stats __user *arg,int zero)
{ {
unsigned long flags; unsigned long flags;
struct idt77105_stats stats; struct idt77105_stats stats;
...@@ -188,7 +188,7 @@ static int set_loopback(struct atm_dev *dev,int mode) ...@@ -188,7 +188,7 @@ static int set_loopback(struct atm_dev *dev,int mode)
} }
static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
{ {
printk(KERN_NOTICE "%s(%d) idt77105_ioctl() called\n",dev->type,dev->number); printk(KERN_NOTICE "%s(%d) idt77105_ioctl() called\n",dev->type,dev->number);
switch (cmd) { switch (cmd) {
...@@ -196,16 +196,15 @@ static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -196,16 +196,15 @@ static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!capable(CAP_NET_ADMIN)) return -EPERM;
/* fall through */ /* fall through */
case IDT77105_GETSTAT: case IDT77105_GETSTAT:
return fetch_stats(dev,(struct idt77105_stats *) arg, return fetch_stats(dev, arg, cmd == IDT77105_GETSTATZ);
cmd == IDT77105_GETSTATZ);
case ATM_SETLOOP: case ATM_SETLOOP:
return set_loopback(dev,(int) (long) arg); return set_loopback(dev,(int) (long) arg);
case ATM_GETLOOP: case ATM_GETLOOP:
return put_user(PRIV(dev)->loop_mode,(int *) arg) ? return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
-EFAULT : 0; -EFAULT : 0;
case ATM_QUERYLOOP: case ATM_QUERYLOOP:
return put_user(ATM_LM_LOC_ATM | ATM_LM_RMT_ATM, return put_user(ATM_LM_LOC_ATM | ATM_LM_RMT_ATM,
(int *) arg) ? -EFAULT : 0; (int __user *) arg) ? -EFAULT : 0;
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
......
...@@ -2738,12 +2738,12 @@ static int ia_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, int flags) ...@@ -2738,12 +2738,12 @@ static int ia_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, int flags)
return 0; return 0;
} }
static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
{ {
IA_CMDBUF ia_cmds; IA_CMDBUF ia_cmds;
IADEV *iadev; IADEV *iadev;
int i, board; int i, board;
u16 *tmps; u16 __user *tmps;
IF_EVENT(printk(">ia_ioctl\n");) IF_EVENT(printk(">ia_ioctl\n");)
if (cmd != IA_CMD) { if (cmd != IA_CMD) {
if (!dev->phy->ioctl) return -EINVAL; if (!dev->phy->ioctl) return -EINVAL;
...@@ -2766,7 +2766,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) ...@@ -2766,7 +2766,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
break; break;
case MEMDUMP_SEGREG: case MEMDUMP_SEGREG:
if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!capable(CAP_NET_ADMIN)) return -EPERM;
tmps = (u16 *)ia_cmds.buf; tmps = (u16 __user *)ia_cmds.buf;
for(i=0; i<0x80; i+=2, tmps++) for(i=0; i<0x80; i+=2, tmps++)
if(put_user((u16)(readl(iadev->seg_reg+i) & 0xffff), tmps)) return -EFAULT; if(put_user((u16)(readl(iadev->seg_reg+i) & 0xffff), tmps)) return -EFAULT;
ia_cmds.status = 0; ia_cmds.status = 0;
...@@ -2774,7 +2774,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) ...@@ -2774,7 +2774,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
break; break;
case MEMDUMP_REASSREG: case MEMDUMP_REASSREG:
if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!capable(CAP_NET_ADMIN)) return -EPERM;
tmps = (u16 *)ia_cmds.buf; tmps = (u16 __user *)ia_cmds.buf;
for(i=0; i<0x80; i+=2, tmps++) for(i=0; i<0x80; i+=2, tmps++)
if(put_user((u16)(readl(iadev->reass_reg+i) & 0xffff), tmps)) return -EFAULT; if(put_user((u16)(readl(iadev->reass_reg+i) & 0xffff), tmps)) return -EFAULT;
ia_cmds.status = 0; ia_cmds.status = 0;
...@@ -2874,14 +2874,14 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) ...@@ -2874,14 +2874,14 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
} }
static int ia_getsockopt(struct atm_vcc *vcc, int level, int optname, static int ia_getsockopt(struct atm_vcc *vcc, int level, int optname,
void *optval, int optlen) void __user *optval, int optlen)
{ {
IF_EVENT(printk(">ia_getsockopt\n");) IF_EVENT(printk(">ia_getsockopt\n");)
return -EINVAL; return -EINVAL;
} }
static int ia_setsockopt(struct atm_vcc *vcc, int level, int optname, static int ia_setsockopt(struct atm_vcc *vcc, int level, int optname,
void *optval, int optlen) void __user *optval, int optlen)
{ {
IF_EVENT(printk(">ia_setsockopt\n");) IF_EVENT(printk(">ia_setsockopt\n");)
return -EINVAL; return -EINVAL;
......
...@@ -141,7 +141,7 @@ typedef struct { ...@@ -141,7 +141,7 @@ typedef struct {
int len; int len;
u32 maddr; u32 maddr;
int status; int status;
void *buf; void __user *buf;
} IA_CMDBUF, *PIA_CMDBUF; } IA_CMDBUF, *PIA_CMDBUF;
/* cmds */ /* cmds */
......
...@@ -2435,7 +2435,7 @@ static int lanai_open(struct atm_vcc *atmvcc) ...@@ -2435,7 +2435,7 @@ static int lanai_open(struct atm_vcc *atmvcc)
#if 0 #if 0
/* ioctl operations for card */ /* ioctl operations for card */
/* NOTE: these are all DEBUGGING ONLY currently */ /* NOTE: these are all DEBUGGING ONLY currently */
static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void *arg) static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void __user *arg)
{ {
int result = 0; int result = 0;
struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
......
...@@ -239,7 +239,7 @@ static void recycle_iov_buf(ns_dev *card, struct sk_buff *iovb); ...@@ -239,7 +239,7 @@ static void recycle_iov_buf(ns_dev *card, struct sk_buff *iovb);
static void dequeue_sm_buf(ns_dev *card, struct sk_buff *sb); static void dequeue_sm_buf(ns_dev *card, struct sk_buff *sb);
static void dequeue_lg_buf(ns_dev *card, struct sk_buff *lb); static void dequeue_lg_buf(ns_dev *card, struct sk_buff *lb);
static int ns_proc_read(struct atm_dev *dev, loff_t *pos, char *page); static int ns_proc_read(struct atm_dev *dev, loff_t *pos, char *page);
static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg); static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg);
static void which_list(ns_dev *card, struct sk_buff *skb); static void which_list(ns_dev *card, struct sk_buff *skb);
static void ns_poll(unsigned long arg); static void ns_poll(unsigned long arg);
static int ns_parse_mac(char *mac, unsigned char *esi); static int ns_parse_mac(char *mac, unsigned char *esi);
...@@ -2765,7 +2765,7 @@ static int ns_proc_read(struct atm_dev *dev, loff_t *pos, char *page) ...@@ -2765,7 +2765,7 @@ static int ns_proc_read(struct atm_dev *dev, loff_t *pos, char *page)
static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
{ {
ns_dev *card; ns_dev *card;
pool_levels pl; pool_levels pl;
...@@ -2776,7 +2776,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) ...@@ -2776,7 +2776,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
switch (cmd) switch (cmd)
{ {
case NS_GETPSTAT: case NS_GETPSTAT:
if (get_user(pl.buftype, &((pool_levels *) arg)->buftype)) if (get_user(pl.buftype, &((pool_levels __user *) arg)->buftype))
return -EFAULT; return -EFAULT;
switch (pl.buftype) switch (pl.buftype)
{ {
...@@ -2812,7 +2812,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) ...@@ -2812,7 +2812,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
if (!copy_to_user((pool_levels *) arg, &pl, sizeof(pl))) if (!copy_to_user((pool_levels __user *) arg, &pl, sizeof(pl)))
return (sizeof(pl)); return (sizeof(pl));
else else
return -EFAULT; return -EFAULT;
...@@ -2820,7 +2820,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) ...@@ -2820,7 +2820,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
case NS_SETBUFLEV: case NS_SETBUFLEV:
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&pl, (pool_levels *) arg, sizeof(pl))) if (copy_from_user(&pl, (pool_levels __user *) arg, sizeof(pl)))
return -EFAULT; return -EFAULT;
if (pl.level.min >= pl.level.init || pl.level.init >= pl.level.max) if (pl.level.min >= pl.level.init || pl.level.init >= pl.level.max)
return -EINVAL; return -EINVAL;
......
...@@ -95,7 +95,7 @@ static void suni_hz(unsigned long from_timer) ...@@ -95,7 +95,7 @@ static void suni_hz(unsigned long from_timer)
#undef ADD_LIMITED #undef ADD_LIMITED
static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero) static int fetch_stats(struct atm_dev *dev,struct sonet_stats __user *arg,int zero)
{ {
struct sonet_stats tmp; struct sonet_stats tmp;
int error = 0; int error = 0;
...@@ -115,11 +115,11 @@ static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero) ...@@ -115,11 +115,11 @@ static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero)
} }
static int change_diag(struct atm_dev *dev,void *arg,int set) static int change_diag(struct atm_dev *dev,void __user *arg,int set)
{ {
int todo; int todo;
if (get_user(todo,(int *) arg)) return -EFAULT; if (get_user(todo,(int __user *)arg)) return -EFAULT;
HANDLE_FLAG(SONET_INS_SBIP,TSOP_DIAG,SUNI_TSOP_DIAG_DBIP8); HANDLE_FLAG(SONET_INS_SBIP,TSOP_DIAG,SUNI_TSOP_DIAG_DBIP8);
HANDLE_FLAG(SONET_INS_LBIP,TLOP_DIAG,SUNI_TLOP_DIAG_DBIP); HANDLE_FLAG(SONET_INS_LBIP,TLOP_DIAG,SUNI_TLOP_DIAG_DBIP);
HANDLE_FLAG(SONET_INS_PBIP,TPOP_CD,SUNI_TPOP_DIAG_DB3); HANDLE_FLAG(SONET_INS_PBIP,TPOP_CD,SUNI_TPOP_DIAG_DB3);
...@@ -128,14 +128,14 @@ static int change_diag(struct atm_dev *dev,void *arg,int set) ...@@ -128,14 +128,14 @@ static int change_diag(struct atm_dev *dev,void *arg,int set)
HANDLE_FLAG(SONET_INS_PAIS,TPOP_CD,SUNI_TPOP_DIAG_PAIS); HANDLE_FLAG(SONET_INS_PAIS,TPOP_CD,SUNI_TPOP_DIAG_PAIS);
HANDLE_FLAG(SONET_INS_LOS,TSOP_DIAG,SUNI_TSOP_DIAG_DLOS); HANDLE_FLAG(SONET_INS_LOS,TSOP_DIAG,SUNI_TSOP_DIAG_DLOS);
HANDLE_FLAG(SONET_INS_HCS,TACP_CS,SUNI_TACP_CS_DHCS); HANDLE_FLAG(SONET_INS_HCS,TACP_CS,SUNI_TACP_CS_DHCS);
return put_user(todo,(int *) arg) ? -EFAULT : 0; return put_user(todo,(int __user *)arg) ? -EFAULT : 0;
} }
#undef HANDLE_FLAG #undef HANDLE_FLAG
static int get_diag(struct atm_dev *dev,void *arg) static int get_diag(struct atm_dev *dev,void __user *arg)
{ {
int set; int set;
...@@ -148,7 +148,7 @@ static int get_diag(struct atm_dev *dev,void *arg) ...@@ -148,7 +148,7 @@ static int get_diag(struct atm_dev *dev,void *arg)
if (GET(TPOP_CD) & SUNI_TPOP_DIAG_PAIS) set |= SONET_INS_PAIS; if (GET(TPOP_CD) & SUNI_TPOP_DIAG_PAIS) set |= SONET_INS_PAIS;
if (GET(TSOP_DIAG) & SUNI_TSOP_DIAG_DLOS) set |= SONET_INS_LOS; if (GET(TSOP_DIAG) & SUNI_TSOP_DIAG_DLOS) set |= SONET_INS_LOS;
if (GET(TACP_CS) & SUNI_TACP_CS_DHCS) set |= SONET_INS_HCS; if (GET(TACP_CS) & SUNI_TACP_CS_DHCS) set |= SONET_INS_HCS;
return put_user(set,(int *) arg) ? -EFAULT : 0; return put_user(set,(int __user *)arg) ? -EFAULT : 0;
} }
...@@ -175,13 +175,12 @@ static int set_loopback(struct atm_dev *dev,int mode) ...@@ -175,13 +175,12 @@ static int set_loopback(struct atm_dev *dev,int mode)
} }
static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
{ {
switch (cmd) { switch (cmd) {
case SONET_GETSTATZ: case SONET_GETSTATZ:
case SONET_GETSTAT: case SONET_GETSTAT:
return fetch_stats(dev,(struct sonet_stats *) arg, return fetch_stats(dev, arg, cmd == SONET_GETSTATZ);
cmd == SONET_GETSTATZ);
case SONET_SETDIAG: case SONET_SETDIAG:
return change_diag(dev,arg,1); return change_diag(dev,arg,1);
case SONET_CLRDIAG: case SONET_CLRDIAG:
...@@ -192,18 +191,18 @@ static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -192,18 +191,18 @@ static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
if (arg != SONET_FRAME_SONET) return -EINVAL; if (arg != SONET_FRAME_SONET) return -EINVAL;
return 0; return 0;
case SONET_GETFRAMING: case SONET_GETFRAMING:
return put_user(SONET_FRAME_SONET,(int *) arg) ? return put_user(SONET_FRAME_SONET,(int __user *)arg) ?
-EFAULT : 0; -EFAULT : 0;
case SONET_GETFRSENSE: case SONET_GETFRSENSE:
return -EINVAL; return -EINVAL;
case ATM_SETLOOP: case ATM_SETLOOP:
return set_loopback(dev,(int) (long) arg); return set_loopback(dev,(int) (long) arg);
case ATM_GETLOOP: case ATM_GETLOOP:
return put_user(PRIV(dev)->loop_mode,(int *) arg) ? return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
-EFAULT : 0; -EFAULT : 0;
case ATM_QUERYLOOP: case ATM_QUERYLOOP:
return put_user(ATM_LM_LOC_PHY | ATM_LM_RMT_PHY, return put_user(ATM_LM_LOC_PHY | ATM_LM_RMT_PHY,
(int *) arg) ? -EFAULT : 0; (int __user *) arg) ? -EFAULT : 0;
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
......
...@@ -37,7 +37,7 @@ struct uPD98402_priv { ...@@ -37,7 +37,7 @@ struct uPD98402_priv {
#define GET(reg) dev->ops->phy_get(dev,uPD98402_##reg) #define GET(reg) dev->ops->phy_get(dev,uPD98402_##reg)
static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero) static int fetch_stats(struct atm_dev *dev,struct sonet_stats __user *arg,int zero)
{ {
struct sonet_stats tmp; struct sonet_stats tmp;
int error = 0; int error = 0;
...@@ -83,7 +83,7 @@ static int set_framing(struct atm_dev *dev,unsigned char framing) ...@@ -83,7 +83,7 @@ static int set_framing(struct atm_dev *dev,unsigned char framing)
} }
static int get_sense(struct atm_dev *dev,u8 *arg) static int get_sense(struct atm_dev *dev,u8 __user *arg)
{ {
unsigned long flags; unsigned long flags;
unsigned char s[3]; unsigned char s[3];
...@@ -132,29 +132,28 @@ static int set_loopback(struct atm_dev *dev,int mode) ...@@ -132,29 +132,28 @@ static int set_loopback(struct atm_dev *dev,int mode)
} }
static int uPD98402_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) static int uPD98402_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
{ {
switch (cmd) { switch (cmd) {
case SONET_GETSTATZ: case SONET_GETSTATZ:
case SONET_GETSTAT: case SONET_GETSTAT:
return fetch_stats(dev,(struct sonet_stats *) arg, return fetch_stats(dev,arg, cmd == SONET_GETSTATZ);
cmd == SONET_GETSTATZ);
case SONET_SETFRAMING: case SONET_SETFRAMING:
return set_framing(dev,(int) (long) arg); return set_framing(dev,(int) (long) arg);
case SONET_GETFRAMING: case SONET_GETFRAMING:
return put_user(PRIV(dev)->framing,(int *) arg) ? return put_user(PRIV(dev)->framing,(int __user *)arg) ?
-EFAULT : 0; -EFAULT : 0;
case SONET_GETFRSENSE: case SONET_GETFRSENSE:
return get_sense(dev,arg); return get_sense(dev,arg);
case ATM_SETLOOP: case ATM_SETLOOP:
return set_loopback(dev,(int) (long) arg); return set_loopback(dev,(int) (long) arg);
case ATM_GETLOOP: case ATM_GETLOOP:
return put_user(PRIV(dev)->loop_mode,(int *) arg) ? return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
-EFAULT : 0; -EFAULT : 0;
case ATM_QUERYLOOP: case ATM_QUERYLOOP:
return put_user(ATM_LM_LOC_PHY | ATM_LM_LOC_ATM | return put_user(ATM_LM_LOC_PHY | ATM_LM_LOC_ATM |
ATM_LM_RMT_PHY,(int *) arg) ? -EFAULT : 0; ATM_LM_RMT_PHY,(int __user *)arg) ? -EFAULT : 0;
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
......
...@@ -1429,7 +1429,7 @@ static int zatm_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flags) ...@@ -1429,7 +1429,7 @@ static int zatm_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flags)
} }
static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
{ {
struct zatm_dev *zatm_dev; struct zatm_dev *zatm_dev;
unsigned long flags; unsigned long flags;
...@@ -1445,7 +1445,7 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -1445,7 +1445,7 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
int pool; int pool;
if (get_user(pool, if (get_user(pool,
&((struct zatm_pool_req *) arg)->pool_num)) &((struct zatm_pool_req __user *) arg)->pool_num))
return -EFAULT; return -EFAULT;
if (pool < 0 || pool > ZATM_LAST_POOL) if (pool < 0 || pool > ZATM_LAST_POOL)
return -EINVAL; return -EINVAL;
...@@ -1457,7 +1457,7 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -1457,7 +1457,7 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
} }
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
return copy_to_user( return copy_to_user(
&((struct zatm_pool_req *) arg)->info, &((struct zatm_pool_req __user *) arg)->info,
&info,sizeof(info)) ? -EFAULT : 0; &info,sizeof(info)) ? -EFAULT : 0;
} }
case ZATM_SETPOOL: case ZATM_SETPOOL:
...@@ -1467,12 +1467,12 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -1467,12 +1467,12 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!capable(CAP_NET_ADMIN)) return -EPERM;
if (get_user(pool, if (get_user(pool,
&((struct zatm_pool_req *) arg)->pool_num)) &((struct zatm_pool_req __user *) arg)->pool_num))
return -EFAULT; return -EFAULT;
if (pool < 0 || pool > ZATM_LAST_POOL) if (pool < 0 || pool > ZATM_LAST_POOL)
return -EINVAL; return -EINVAL;
if (copy_from_user(&info, if (copy_from_user(&info,
&((struct zatm_pool_req *) arg)->info, &((struct zatm_pool_req __user *) arg)->info,
sizeof(info))) return -EFAULT; sizeof(info))) return -EFAULT;
if (!info.low_water) if (!info.low_water)
info.low_water = zatm_dev-> info.low_water = zatm_dev->
...@@ -1504,14 +1504,14 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) ...@@ -1504,14 +1504,14 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
static int zatm_getsockopt(struct atm_vcc *vcc,int level,int optname, static int zatm_getsockopt(struct atm_vcc *vcc,int level,int optname,
void *optval,int optlen) void __user *optval,int optlen)
{ {
return -EINVAL; return -EINVAL;
} }
static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname, static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname,
void *optval,int optlen) void __user *optval,int optlen)
{ {
return -EINVAL; return -EINVAL;
} }
......
...@@ -269,7 +269,7 @@ struct udsl_instance_data { ...@@ -269,7 +269,7 @@ struct udsl_instance_data {
static void udsl_atm_dev_close (struct atm_dev *dev); static void udsl_atm_dev_close (struct atm_dev *dev);
static int udsl_atm_open (struct atm_vcc *vcc); static int udsl_atm_open (struct atm_vcc *vcc);
static void udsl_atm_close (struct atm_vcc *vcc); static void udsl_atm_close (struct atm_vcc *vcc);
static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void *arg); static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void __user *arg);
static int udsl_atm_send (struct atm_vcc *vcc, struct sk_buff *skb); static int udsl_atm_send (struct atm_vcc *vcc, struct sk_buff *skb);
static int udsl_atm_proc_read (struct atm_dev *atm_dev, loff_t *pos, char *page); static int udsl_atm_proc_read (struct atm_dev *atm_dev, loff_t *pos, char *page);
...@@ -991,11 +991,11 @@ static void udsl_atm_close (struct atm_vcc *vcc) ...@@ -991,11 +991,11 @@ static void udsl_atm_close (struct atm_vcc *vcc)
dbg ("udsl_atm_close successful"); dbg ("udsl_atm_close successful");
} }
static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void *arg) static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void __user *arg)
{ {
switch (cmd) { switch (cmd) {
case ATM_QUERYLOOP: case ATM_QUERYLOOP:
return put_user (ATM_LM_NONE, (int *) arg) ? -EFAULT : 0; return put_user (ATM_LM_NONE, (int __user *)arg) ? -EFAULT : 0;
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment