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

[PATCH] sparse: trivial drivers/isdn/* annotations

parent f4a4c86b
......@@ -650,7 +650,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
/* -------- file_operations for capidev ----------------------------- */
static ssize_t
capi_read(struct file *file, char *buf, size_t count, loff_t *ppos)
capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
struct capidev *cdev = (struct capidev *)file->private_data;
struct sk_buff *skb;
......@@ -693,7 +693,7 @@ capi_read(struct file *file, char *buf, size_t count, loff_t *ppos)
}
static ssize_t
capi_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
struct capidev *cdev = (struct capidev *)file->private_data;
struct sk_buff *skb;
......@@ -766,6 +766,7 @@ capi_ioctl(struct inode *inode, struct file *file,
struct capi20_appl *ap = &cdev->ap;
capi_ioctl_struct data;
int retval = -EINVAL;
void __user *argp = (void __user *)arg;
switch (cmd) {
case CAPI_REGISTER:
......@@ -773,7 +774,7 @@ capi_ioctl(struct inode *inode, struct file *file,
if (ap->applid)
return -EEXIST;
if (copy_from_user(&cdev->ap.rparam, (void *) arg,
if (copy_from_user(&cdev->ap.rparam, argp,
sizeof(struct capi_register_params)))
return -EFAULT;
......@@ -789,14 +790,13 @@ capi_ioctl(struct inode *inode, struct file *file,
case CAPI_GET_VERSION:
{
if (copy_from_user((void *) &data.contr,
(void *) arg,
if (copy_from_user(&data.contr, argp,
sizeof(data.contr)))
return -EFAULT;
cdev->errcode = capi20_get_version(data.contr, &data.version);
if (cdev->errcode)
return -EIO;
if (copy_to_user((void *)arg, (void *)&data.version,
if (copy_to_user(argp, &data.version,
sizeof(data.version)))
return -EFAULT;
}
......@@ -804,20 +804,20 @@ capi_ioctl(struct inode *inode, struct file *file,
case CAPI_GET_SERIAL:
{
if (copy_from_user((void *)&data.contr, (void *)arg,
if (copy_from_user(&data.contr, argp,
sizeof(data.contr)))
return -EFAULT;
cdev->errcode = capi20_get_serial (data.contr, data.serial);
if (cdev->errcode)
return -EIO;
if (copy_to_user((void *)arg, (void *)data.serial,
if (copy_to_user(argp, data.serial,
sizeof(data.serial)))
return -EFAULT;
}
return 0;
case CAPI_GET_PROFILE:
{
if (copy_from_user((void *)&data.contr, (void *)arg,
if (copy_from_user(&data.contr, argp,
sizeof(data.contr)))
return -EFAULT;
......@@ -826,8 +826,8 @@ capi_ioctl(struct inode *inode, struct file *file,
if (cdev->errcode)
return -EIO;
retval = copy_to_user((void *) arg,
(void *) &data.profile.ncontroller,
retval = copy_to_user(argp,
&data.profile.ncontroller,
sizeof(data.profile.ncontroller));
} else {
......@@ -835,8 +835,7 @@ capi_ioctl(struct inode *inode, struct file *file,
if (cdev->errcode)
return -EIO;
retval = copy_to_user((void *) arg,
(void *) &data.profile,
retval = copy_to_user(argp, &data.profile,
sizeof(data.profile));
}
if (retval)
......@@ -846,14 +845,14 @@ capi_ioctl(struct inode *inode, struct file *file,
case CAPI_GET_MANUFACTURER:
{
if (copy_from_user((void *)&data.contr, (void *)arg,
if (copy_from_user(&data.contr, argp,
sizeof(data.contr)))
return -EFAULT;
cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
if (cdev->errcode)
return -EIO;
if (copy_to_user((void *)arg, (void *)data.manufacturer,
if (copy_to_user(argp, data.manufacturer,
sizeof(data.manufacturer)))
return -EFAULT;
......@@ -863,7 +862,7 @@ capi_ioctl(struct inode *inode, struct file *file,
data.errcode = cdev->errcode;
cdev->errcode = CAPI_NOERROR;
if (arg) {
if (copy_to_user((void *)arg, (void *)&data.errcode,
if (copy_to_user(argp, &data.errcode,
sizeof(data.errcode)))
return -EFAULT;
}
......@@ -879,7 +878,7 @@ capi_ioctl(struct inode *inode, struct file *file,
struct capi_manufacturer_cmd mcmd;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (copy_from_user((void *)&mcmd, (void *)arg,
if (copy_from_user(&mcmd, argp,
sizeof(mcmd)))
return -EFAULT;
return capi20_manufacturer(mcmd.cmd, mcmd.data);
......@@ -890,7 +889,7 @@ capi_ioctl(struct inode *inode, struct file *file,
case CAPI_CLR_FLAGS:
{
unsigned userflags;
if (copy_from_user((void *)&userflags, (void *)arg,
if (copy_from_user(&userflags, argp,
sizeof(userflags)))
return -EFAULT;
if (cmd == CAPI_SET_FLAGS)
......@@ -901,7 +900,7 @@ capi_ioctl(struct inode *inode, struct file *file,
return 0;
case CAPI_GET_FLAGS:
if (copy_to_user((void *)arg, (void *)&cdev->userflags,
if (copy_to_user(argp, &cdev->userflags,
sizeof(cdev->userflags)))
return -EFAULT;
return 0;
......@@ -914,8 +913,7 @@ capi_ioctl(struct inode *inode, struct file *file,
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
unsigned ncci;
int count = 0;
if (copy_from_user((void *)&ncci, (void *)arg,
sizeof(ncci)))
if (copy_from_user(&ncci, argp, sizeof(ncci)))
return -EFAULT;
down(&cdev->ncci_list_sem);
......@@ -940,7 +938,7 @@ capi_ioctl(struct inode *inode, struct file *file,
struct capiminor *mp;
unsigned ncci;
int unit = 0;
if (copy_from_user((void *)&ncci, (void *)arg,
if (copy_from_user(&ncci, argp,
sizeof(ncci)))
return -EFAULT;
down(&cdev->ncci_list_sem);
......
This diff is collapsed.
......@@ -315,7 +315,7 @@ isdn_net_unbind_channel(isdn_net_local * lp)
unsigned long last_jiffies = -HZ;
void
isdn_net_autohup()
isdn_net_autohup(void)
{
isdn_net_dev *p = dev->netdev;
int anymore;
......@@ -1443,15 +1443,14 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
/* get/set keepalive period */
case SIOCGKEEPPERIOD:
len = (unsigned long)sizeof(lp->cisco_keepalive_period);
if (copy_to_user((char *)ifr->ifr_ifru.ifru_data,
(int *)&lp->cisco_keepalive_period, len))
if (copy_to_user(ifr->ifr_data,
&lp->cisco_keepalive_period, len))
rc = -EFAULT;
break;
case SIOCSKEEPPERIOD:
tmp = lp->cisco_keepalive_period;
len = (unsigned long)sizeof(lp->cisco_keepalive_period);
if (copy_from_user((int *)&period,
(char *)ifr->ifr_ifru.ifru_data, len))
if (copy_from_user(&period, ifr->ifr_data, len))
rc = -EFAULT;
if ((period > 0) && (period <= 32767))
lp->cisco_keepalive_period = period;
......@@ -1470,14 +1469,14 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
/* get/set debugging */
case SIOCGDEBSERINT:
len = (unsigned long)sizeof(lp->cisco_debserint);
if (copy_to_user((char *)ifr->ifr_ifru.ifru_data,
(char *)&lp->cisco_debserint, len))
if (copy_to_user(ifr->ifr_data,
&lp->cisco_debserint, len))
rc = -EFAULT;
break;
case SIOCSDEBSERINT:
len = (unsigned long)sizeof(lp->cisco_debserint);
if (copy_from_user((char *)&debserint,
(char *)ifr->ifr_ifru.ifru_data, len))
if (copy_from_user(&debserint,
ifr->ifr_data, len))
rc = -EFAULT;
if ((debserint >= 0) && (debserint <= 64))
lp->cisco_debserint = debserint;
......@@ -2968,7 +2967,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
* This might sleep and must be called with the isdn semaphore down.
*/
int
isdn_net_getphones(isdn_net_ioctl_phone * phone, char *phones)
isdn_net_getphones(isdn_net_ioctl_phone * phone, char __user *phones)
{
isdn_net_dev *p = isdn_net_findif(phone->name);
int inout = phone->outgoing & 1;
......@@ -3001,7 +3000,7 @@ isdn_net_getphones(isdn_net_ioctl_phone * phone, char *phones)
* to user space.
*/
int
isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone *peer)
isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone __user *peer)
{
isdn_net_dev *p = isdn_net_findif(phone->name);
int ch, dv, idx;
......
......@@ -39,8 +39,8 @@ extern int isdn_net_stat_callback(int, isdn_ctrl *);
extern int isdn_net_setcfg(isdn_net_ioctl_cfg *);
extern int isdn_net_getcfg(isdn_net_ioctl_cfg *);
extern int isdn_net_addphone(isdn_net_ioctl_phone *);
extern int isdn_net_getphones(isdn_net_ioctl_phone *, char *);
extern int isdn_net_getpeer(isdn_net_ioctl_phone *, isdn_net_ioctl_phone *);
extern int isdn_net_getphones(isdn_net_ioctl_phone *, char __user *);
extern int isdn_net_getpeer(isdn_net_ioctl_phone *, isdn_net_ioctl_phone __user *);
extern int isdn_net_delphone(isdn_net_ioctl_phone *);
extern int isdn_net_find_icall(int, int, int, setup_parm *);
extern void isdn_net_hangup(struct net_device *);
......
......@@ -1359,14 +1359,14 @@ isdn_tty_unthrottle(struct tty_struct *tty)
* allows RS485 driver to be written in user space.
*/
static int
isdn_tty_get_lsr_info(modem_info * info, uint * value)
isdn_tty_get_lsr_info(modem_info * info, uint __user * value)
{
u_char status;
uint result;
status = info->lsr;
result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);
return put_user(result, (uint *) value);
return put_user(result, value);
}
......@@ -1468,12 +1468,12 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file,
#ifdef ISDN_DEBUG_MODEM_IOCTL
printk(KERN_DEBUG "ttyI%d ioctl TIOCGSOFTCAR\n", info->line);
#endif
return put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
return put_user(C_CLOCAL(tty) ? 1 : 0, (ulong __user *) arg);
case TIOCSSOFTCAR:
#ifdef ISDN_DEBUG_MODEM_IOCTL
printk(KERN_DEBUG "ttyI%d ioctl TIOCSSOFTCAR\n", info->line);
#endif
if (get_user(arg, (ulong *) arg))
if (get_user(arg, (ulong __user *) arg))
return -EFAULT;
tty->termios->c_cflag =
((tty->termios->c_cflag & ~CLOCAL) |
......
......@@ -79,7 +79,7 @@ static int pdata_is_bad( ix25_pdata_t * pda ){
/* create a new x25 interface protocol instance
*/
struct concap_proto * isdn_x25iface_proto_new()
struct concap_proto * isdn_x25iface_proto_new(void)
{
ix25_pdata_t * tmp = kmalloc(sizeof(ix25_pdata_t),GFP_KERNEL);
IX25DEBUG("isdn_x25iface_proto_new\n");
......@@ -275,8 +275,7 @@ int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
{
unsigned char firstbyte = skb->data[0];
unsigned *state =
&( ( (ix25_pdata_t*) (cprot -> proto_data) ) -> state );
enum wan_states *state = &((ix25_pdata_t*)cprot->proto_data)->state;
int ret = 0;
IX25DEBUG( "isdn_x25iface_xmit: %s first=%x state=%d \n", MY_DEVNAME(cprot -> net_dev), firstbyte, *state );
switch ( firstbyte ){
......
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