]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sparse: x25 annotation
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Thu, 3 Jun 2004 14:27:41 +0000 (07:27 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 3 Jun 2004 14:27:41 +0000 (07:27 -0700)
include/net/x25.h
net/x25/af_x25.c
net/x25/x25_link.c
net/x25/x25_route.c

index c6153ea9eea0d01dd24da862e41cfaac5f0a6c86..0db97e75853f0b5e2ae495f827e31d763a5b500d 100644 (file)
@@ -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_clear_request(struct x25_neigh *, unsigned int, unsigned char);
 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 void x25_link_free(void);
 
@@ -221,7 +221,7 @@ extern void x25_enquiry_response(struct sock *);
 extern struct x25_route *x25_get_route(struct x25_address *addr);
 extern struct net_device *x25_dev_get(char *);
 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);
 
 static __inline__ void x25_route_hold(struct x25_route *rt)
index 9863ccd84de4024b9fbb24241983a98f66aa0496..857dc981b9817d41159e95632a9e494573565f6d 100644 (file)
@@ -1180,6 +1180,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
        struct sock *sk = sock->sk;
        struct x25_opt *x25 = x25_sk(sk);
+       void __user *argp = (void __user *)arg;
        int rc;
 
        switch (cmd) {
@@ -1188,7 +1189,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                                     atomic_read(&sk->sk_wmem_alloc);
                        if (amount < 0)
                                amount = 0;
-                       rc = put_user(amount, (unsigned int *)arg);
+                       rc = put_user(amount, (unsigned int __user *)argp);
                        break;
                }
 
@@ -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)
                                amount = skb->len;
-                       rc = put_user(amount, (unsigned int *)arg);
+                       rc = put_user(amount, (unsigned int __user *)argp);
                        break;
                }
 
@@ -1209,7 +1210,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        rc = -EINVAL;
                        if (sk)
                                rc = sock_get_timestamp(sk, 
-                                               (struct timeval __user *)arg); 
+                                               (struct timeval __user *)argp); 
                        break;
                case SIOCGIFADDR:
                case SIOCSIFADDR:
@@ -1228,20 +1229,20 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        rc = -EPERM;
                        if (!capable(CAP_NET_ADMIN))
                                break;
-                       rc = x25_route_ioctl(cmd, (void *)arg);
+                       rc = x25_route_ioctl(cmd, argp);
                        break;
                case SIOCX25GSUBSCRIP:
-                       rc = x25_subscr_ioctl(cmd, (void *)arg);
+                       rc = x25_subscr_ioctl(cmd, argp);
                        break;
                case SIOCX25SSUBSCRIP:
                        rc = -EPERM;
                        if (!capable(CAP_NET_ADMIN))
                                break;
-                       rc = x25_subscr_ioctl(cmd, (void *)arg);
+                       rc = x25_subscr_ioctl(cmd, argp);
                        break;
                case SIOCX25GFACILITIES: {
                        struct x25_facilities fac = x25->facilities;
-                       rc = copy_to_user((void *)arg, &fac,
+                       rc = copy_to_user(argp, &fac,
                                          sizeof(fac)) ? -EFAULT : 0;
                        break;
                }
@@ -1249,7 +1250,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                case SIOCX25SFACILITIES: {
                        struct x25_facilities facilities;
                        rc = -EFAULT;
-                       if (copy_from_user(&facilities, (void *)arg,
+                       if (copy_from_user(&facilities, argp,
                                           sizeof(facilities)))
                                break;
                        rc = -EINVAL;
@@ -1277,7 +1278,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 
                case SIOCX25GCALLUSERDATA: {
                        struct x25_calluserdata cud = x25->calluserdata;
-                       rc = copy_to_user((void *)arg, &cud,
+                       rc = copy_to_user(argp, &cud,
                                          sizeof(cud)) ? -EFAULT : 0;
                        break;
                }
@@ -1286,7 +1287,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        struct x25_calluserdata calluserdata;
 
                        rc = -EFAULT;
-                       if (copy_from_user(&calluserdata, (void *)arg,
+                       if (copy_from_user(&calluserdata, argp,
                                           sizeof(calluserdata)))
                                break;
                        rc = -EINVAL;
@@ -1300,13 +1301,13 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                case SIOCX25GCAUSEDIAG: {
                        struct x25_causediag causediag;
                        causediag = x25->causediag;
-                       rc = copy_to_user((void *)arg, &causediag,
+                       rc = copy_to_user(argp, &causediag,
                                          sizeof(causediag)) ? -EFAULT : 0;
                        break;
                }
 
                default:
-                       rc = dev_ioctl(cmd, (void __user *)arg);
+                       rc = dev_ioctl(cmd, argp);
                        break;
        }
 
index c5df945f3aad4549159b68cdf27c0a520b72d77c..118146629c3a7eb658d87ec87b732452f7952a43 100644 (file)
@@ -374,7 +374,7 @@ struct x25_neigh *x25_get_neigh(struct net_device *dev)
 /*
  *     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_neigh *nb;
index 07ae9d9e204ab4721da75709aa1820b1c1e8a7a5..4697d55bb253acdd80cb153651821d55006f3200 100644 (file)
@@ -174,7 +174,7 @@ struct x25_route *x25_get_route(struct x25_address *addr)
 /*
  *     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 net_device *dev;