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

[PATCH] sparse: x25 annotation

parent 6e3a9a7f
...@@ -196,7 +196,7 @@ extern void x25_transmit_restart_confirmation(struct x25_neigh *); ...@@ -196,7 +196,7 @@ extern void x25_transmit_restart_confirmation(struct x25_neigh *);
extern void x25_transmit_diagnostic(struct x25_neigh *, unsigned char); extern void x25_transmit_diagnostic(struct x25_neigh *, unsigned char);
extern void x25_transmit_clear_request(struct x25_neigh *, unsigned int, unsigned char); extern void x25_transmit_clear_request(struct x25_neigh *, unsigned int, unsigned char);
extern void x25_transmit_link(struct sk_buff *, struct x25_neigh *); extern void x25_transmit_link(struct sk_buff *, struct x25_neigh *);
extern int x25_subscr_ioctl(unsigned int, void *); extern int x25_subscr_ioctl(unsigned int, void __user *);
extern struct x25_neigh *x25_get_neigh(struct net_device *); extern struct x25_neigh *x25_get_neigh(struct net_device *);
extern void x25_link_free(void); extern void x25_link_free(void);
...@@ -221,7 +221,7 @@ extern void x25_enquiry_response(struct sock *); ...@@ -221,7 +221,7 @@ extern void x25_enquiry_response(struct sock *);
extern struct x25_route *x25_get_route(struct x25_address *addr); extern struct x25_route *x25_get_route(struct x25_address *addr);
extern struct net_device *x25_dev_get(char *); extern struct net_device *x25_dev_get(char *);
extern void x25_route_device_down(struct net_device *dev); extern void x25_route_device_down(struct net_device *dev);
extern int x25_route_ioctl(unsigned int, void *); extern int x25_route_ioctl(unsigned int, void __user *);
extern void x25_route_free(void); extern void x25_route_free(void);
static __inline__ void x25_route_hold(struct x25_route *rt) static __inline__ void x25_route_hold(struct x25_route *rt)
......
...@@ -1180,6 +1180,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1180,6 +1180,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct x25_opt *x25 = x25_sk(sk); struct x25_opt *x25 = x25_sk(sk);
void __user *argp = (void __user *)arg;
int rc; int rc;
switch (cmd) { switch (cmd) {
...@@ -1188,7 +1189,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1188,7 +1189,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
atomic_read(&sk->sk_wmem_alloc); atomic_read(&sk->sk_wmem_alloc);
if (amount < 0) if (amount < 0)
amount = 0; amount = 0;
rc = put_user(amount, (unsigned int *)arg); rc = put_user(amount, (unsigned int __user *)argp);
break; break;
} }
...@@ -1201,7 +1202,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1201,7 +1202,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
*/ */
if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
amount = skb->len; amount = skb->len;
rc = put_user(amount, (unsigned int *)arg); rc = put_user(amount, (unsigned int __user *)argp);
break; break;
} }
...@@ -1209,7 +1210,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1209,7 +1210,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
rc = -EINVAL; rc = -EINVAL;
if (sk) if (sk)
rc = sock_get_timestamp(sk, rc = sock_get_timestamp(sk,
(struct timeval __user *)arg); (struct timeval __user *)argp);
break; break;
case SIOCGIFADDR: case SIOCGIFADDR:
case SIOCSIFADDR: case SIOCSIFADDR:
...@@ -1228,20 +1229,20 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1228,20 +1229,20 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
rc = -EPERM; rc = -EPERM;
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
break; break;
rc = x25_route_ioctl(cmd, (void *)arg); rc = x25_route_ioctl(cmd, argp);
break; break;
case SIOCX25GSUBSCRIP: case SIOCX25GSUBSCRIP:
rc = x25_subscr_ioctl(cmd, (void *)arg); rc = x25_subscr_ioctl(cmd, argp);
break; break;
case SIOCX25SSUBSCRIP: case SIOCX25SSUBSCRIP:
rc = -EPERM; rc = -EPERM;
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
break; break;
rc = x25_subscr_ioctl(cmd, (void *)arg); rc = x25_subscr_ioctl(cmd, argp);
break; break;
case SIOCX25GFACILITIES: { case SIOCX25GFACILITIES: {
struct x25_facilities fac = x25->facilities; struct x25_facilities fac = x25->facilities;
rc = copy_to_user((void *)arg, &fac, rc = copy_to_user(argp, &fac,
sizeof(fac)) ? -EFAULT : 0; sizeof(fac)) ? -EFAULT : 0;
break; break;
} }
...@@ -1249,7 +1250,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1249,7 +1250,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCX25SFACILITIES: { case SIOCX25SFACILITIES: {
struct x25_facilities facilities; struct x25_facilities facilities;
rc = -EFAULT; rc = -EFAULT;
if (copy_from_user(&facilities, (void *)arg, if (copy_from_user(&facilities, argp,
sizeof(facilities))) sizeof(facilities)))
break; break;
rc = -EINVAL; rc = -EINVAL;
...@@ -1277,7 +1278,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1277,7 +1278,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCX25GCALLUSERDATA: { case SIOCX25GCALLUSERDATA: {
struct x25_calluserdata cud = x25->calluserdata; struct x25_calluserdata cud = x25->calluserdata;
rc = copy_to_user((void *)arg, &cud, rc = copy_to_user(argp, &cud,
sizeof(cud)) ? -EFAULT : 0; sizeof(cud)) ? -EFAULT : 0;
break; break;
} }
...@@ -1286,7 +1287,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1286,7 +1287,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
struct x25_calluserdata calluserdata; struct x25_calluserdata calluserdata;
rc = -EFAULT; rc = -EFAULT;
if (copy_from_user(&calluserdata, (void *)arg, if (copy_from_user(&calluserdata, argp,
sizeof(calluserdata))) sizeof(calluserdata)))
break; break;
rc = -EINVAL; rc = -EINVAL;
...@@ -1300,13 +1301,13 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1300,13 +1301,13 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCX25GCAUSEDIAG: { case SIOCX25GCAUSEDIAG: {
struct x25_causediag causediag; struct x25_causediag causediag;
causediag = x25->causediag; causediag = x25->causediag;
rc = copy_to_user((void *)arg, &causediag, rc = copy_to_user(argp, &causediag,
sizeof(causediag)) ? -EFAULT : 0; sizeof(causediag)) ? -EFAULT : 0;
break; break;
} }
default: default:
rc = dev_ioctl(cmd, (void __user *)arg); rc = dev_ioctl(cmd, argp);
break; break;
} }
......
...@@ -374,7 +374,7 @@ struct x25_neigh *x25_get_neigh(struct net_device *dev) ...@@ -374,7 +374,7 @@ struct x25_neigh *x25_get_neigh(struct net_device *dev)
/* /*
* Handle the ioctls that control the subscription functions. * Handle the ioctls that control the subscription functions.
*/ */
int x25_subscr_ioctl(unsigned int cmd, void *arg) int x25_subscr_ioctl(unsigned int cmd, void __user *arg)
{ {
struct x25_subscrip_struct x25_subscr; struct x25_subscrip_struct x25_subscr;
struct x25_neigh *nb; struct x25_neigh *nb;
......
...@@ -174,7 +174,7 @@ struct x25_route *x25_get_route(struct x25_address *addr) ...@@ -174,7 +174,7 @@ struct x25_route *x25_get_route(struct x25_address *addr)
/* /*
* Handle the ioctls that control the routing functions. * Handle the ioctls that control the routing functions.
*/ */
int x25_route_ioctl(unsigned int cmd, void *arg) int x25_route_ioctl(unsigned int cmd, void __user *arg)
{ {
struct x25_route_struct rt; struct x25_route_struct rt;
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