Commit 2a55713c authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: decnet annotation

parent 158f9d76
...@@ -155,7 +155,7 @@ struct rtnode_hello_message ...@@ -155,7 +155,7 @@ struct rtnode_hello_message
extern void dn_dev_init(void); extern void dn_dev_init(void);
extern void dn_dev_cleanup(void); extern void dn_dev_cleanup(void);
extern int dn_dev_ioctl(unsigned int cmd, void *arg); extern int dn_dev_ioctl(unsigned int cmd, void __user *arg);
extern void dn_dev_devices_off(void); extern void dn_dev_devices_off(void);
extern void dn_dev_devices_on(void); extern void dn_dev_devices_on(void);
......
...@@ -1212,7 +1212,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1212,7 +1212,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{ {
case SIOCGIFADDR: case SIOCGIFADDR:
case SIOCSIFADDR: case SIOCSIFADDR:
return dn_dev_ioctl(cmd, (void *)arg); return dn_dev_ioctl(cmd, (void __user *)arg);
case SIOCATMARK: case SIOCATMARK:
lock_sock(sk); lock_sock(sk);
...@@ -1226,7 +1226,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1226,7 +1226,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
if (amount < 0) if (amount < 0)
amount = 0; amount = 0;
err = put_user(amount, (int *)arg); err = put_user(amount, (int __user *)arg);
break; break;
case TIOCINQ: case TIOCINQ:
...@@ -1244,7 +1244,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1244,7 +1244,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
} }
} }
release_sock(sk); release_sock(sk);
err = put_user(amount, (int *)arg); err = put_user(amount, (int __user *)arg);
break; break;
default: default:
...@@ -1325,7 +1325,7 @@ static int dn_setsockopt(struct socket *sock, int level, int optname, char __use ...@@ -1325,7 +1325,7 @@ static int dn_setsockopt(struct socket *sock, int level, int optname, char __use
return err; return err;
} }
static int __dn_setsockopt(struct socket *sock, int level,int optname, char __user __user *optval, int optlen, int flags) static int __dn_setsockopt(struct socket *sock, int level,int optname, char __user *optval, int optlen, int flags)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct dn_scp *scp = DN_SK(sk); struct dn_scp *scp = DN_SK(sk);
......
...@@ -161,10 +161,10 @@ static int min_priority[1]; ...@@ -161,10 +161,10 @@ static int min_priority[1];
static int max_priority[] = { 127 }; /* From DECnet spec */ static int max_priority[] = { 127 }; /* From DECnet spec */
static int dn_forwarding_proc(ctl_table *, int, struct file *, static int dn_forwarding_proc(ctl_table *, int, struct file *,
void *, size_t *); void __user *, size_t *);
static int dn_forwarding_sysctl(ctl_table *table, int *name, int nlen, static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
void *oldval, size_t *oldlenp, void __user *oldval, size_t __user *oldlenp,
void *newval, size_t newlen, void __user *newval, size_t newlen,
void **context); void **context);
static struct dn_dev_sysctl_table { static struct dn_dev_sysctl_table {
...@@ -362,7 +362,7 @@ static void dn_dev_check_default(struct net_device *dev) ...@@ -362,7 +362,7 @@ static void dn_dev_check_default(struct net_device *dev)
static int dn_forwarding_proc(ctl_table *table, int write, static int dn_forwarding_proc(ctl_table *table, int write,
struct file *filep, struct file *filep,
void *buffer, size_t *lenp) void __user *buffer, size_t *lenp)
{ {
#ifdef CONFIG_DECNET_ROUTER #ifdef CONFIG_DECNET_ROUTER
struct net_device *dev = table->extra1; struct net_device *dev = table->extra1;
...@@ -404,9 +404,9 @@ static int dn_forwarding_proc(ctl_table *table, int write, ...@@ -404,9 +404,9 @@ static int dn_forwarding_proc(ctl_table *table, int write,
#endif #endif
} }
static int dn_forwarding_sysctl(ctl_table *table, int *name, int nlen, static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
void *oldval, size_t *oldlenp, void __user *oldval, size_t __user *oldlenp,
void *newval, size_t newlen, void __user *newval, size_t newlen,
void **context) void **context)
{ {
#ifdef CONFIG_DECNET_ROUTER #ifdef CONFIG_DECNET_ROUTER
...@@ -423,7 +423,7 @@ static int dn_forwarding_sysctl(ctl_table *table, int *name, int nlen, ...@@ -423,7 +423,7 @@ static int dn_forwarding_sysctl(ctl_table *table, int *name, int nlen,
if (newlen != sizeof(int)) if (newlen != sizeof(int))
return -EINVAL; return -EINVAL;
if (get_user(value, (int *)newval)) if (get_user(value, (int __user *)newval))
return -EFAULT; return -EFAULT;
if (value < 0) if (value < 0)
return -EINVAL; return -EINVAL;
...@@ -553,7 +553,7 @@ static int dn_dev_set_ifa(struct net_device *dev, struct dn_ifaddr *ifa) ...@@ -553,7 +553,7 @@ static int dn_dev_set_ifa(struct net_device *dev, struct dn_ifaddr *ifa)
} }
int dn_dev_ioctl(unsigned int cmd, void *arg) int dn_dev_ioctl(unsigned int cmd, void __user *arg)
{ {
char buffer[DN_IFREQ_SIZE]; char buffer[DN_IFREQ_SIZE];
struct ifreq *ifr = (struct ifreq *)buffer; struct ifreq *ifr = (struct ifreq *)buffer;
......
...@@ -127,9 +127,9 @@ static int parse_addr(dn_address *addr, char *str) ...@@ -127,9 +127,9 @@ static int parse_addr(dn_address *addr, char *str)
} }
static int dn_node_address_strategy(ctl_table *table, int *name, int nlen, static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen,
void *oldval, size_t *oldlenp, void __user *oldval, size_t __user *oldlenp,
void *newval, size_t newlen, void __user *newval, size_t newlen,
void **context) void **context)
{ {
size_t len; size_t len;
...@@ -141,14 +141,14 @@ static int dn_node_address_strategy(ctl_table *table, int *name, int nlen, ...@@ -141,14 +141,14 @@ static int dn_node_address_strategy(ctl_table *table, int *name, int nlen,
if (len) { if (len) {
if (len != sizeof(unsigned short)) if (len != sizeof(unsigned short))
return -EINVAL; return -EINVAL;
if (put_user(decnet_address, (unsigned short *)oldval)) if (put_user(decnet_address, (unsigned short __user *)oldval))
return -EFAULT; return -EFAULT;
} }
} }
if (newval && newlen) { if (newval && newlen) {
if (newlen != sizeof(unsigned short)) if (newlen != sizeof(unsigned short))
return -EINVAL; return -EINVAL;
if (get_user(addr, (unsigned short *)newval)) if (get_user(addr, (unsigned short __user *)newval))
return -EFAULT; return -EFAULT;
dn_dev_devices_off(); dn_dev_devices_off();
...@@ -162,7 +162,7 @@ static int dn_node_address_strategy(ctl_table *table, int *name, int nlen, ...@@ -162,7 +162,7 @@ static int dn_node_address_strategy(ctl_table *table, int *name, int nlen,
static int dn_node_address_handler(ctl_table *table, int write, static int dn_node_address_handler(ctl_table *table, int write,
struct file *filp, struct file *filp,
void *buffer, size_t *lenp) void __user *buffer, size_t *lenp)
{ {
char addr[DN_ASCBUF_LEN]; char addr[DN_ASCBUF_LEN];
size_t len; size_t len;
...@@ -212,9 +212,9 @@ static int dn_node_address_handler(ctl_table *table, int write, ...@@ -212,9 +212,9 @@ static int dn_node_address_handler(ctl_table *table, int write,
} }
static int dn_def_dev_strategy(ctl_table *table, int *name, int nlen, static int dn_def_dev_strategy(ctl_table *table, int __user *name, int nlen,
void *oldval, size_t *oldlenp, void __user *oldval, size_t __user *oldlenp,
void *newval, size_t newlen, void __user *newval, size_t newlen,
void **context) void **context)
{ {
size_t len; size_t len;
...@@ -273,7 +273,7 @@ static int dn_def_dev_strategy(ctl_table *table, int *name, int nlen, ...@@ -273,7 +273,7 @@ static int dn_def_dev_strategy(ctl_table *table, int *name, int nlen,
static int dn_def_dev_handler(ctl_table *table, int write, static int dn_def_dev_handler(ctl_table *table, int write,
struct file * filp, struct file * filp,
void *buffer, size_t *lenp) void __user *buffer, size_t *lenp)
{ {
size_t len; size_t len;
struct net_device *dev; struct net_device *dev;
......
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