]> git.hungrycats.org Git - linux/commitdiff
[NET]: Add some sparse annotations to network driver stack.
authorArjan van de Ven <arjanv@redhat.com>
Fri, 16 Apr 2004 06:56:23 +0000 (23:56 -0700)
committerStephen Hemminger <shemminger@osdl.org>
Fri, 16 Apr 2004 06:56:23 +0000 (23:56 -0700)
drivers/net/b44.c
include/linux/divert.h
include/linux/if.h
include/linux/wireless.h
net/core/dev.c
net/core/dv.c
net/core/ethtool.c

index 5f5ffa68e40ec6bd54b681b460f1c01f17606431..01c18e5aa86e138fcfd76cebd1ef19322e72c177 100644 (file)
@@ -1382,7 +1382,7 @@ static void b44_set_rx_mode(struct net_device *dev)
        spin_unlock_irq(&bp->lock);
 }
 
-static int b44_ethtool_ioctl (struct net_device *dev, void *useraddr)
+static int b44_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
 {
        struct b44 *bp = dev->priv;
        struct pci_dev *pci_dev = bp->pdev;
@@ -1625,13 +1625,13 @@ static int b44_ethtool_ioctl (struct net_device *dev, void *useraddr)
 
 static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-       struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
+       struct mii_ioctl_data __user *data = (struct mii_ioctl_data __user *)&ifr->ifr_data;
        struct b44 *bp = dev->priv;
        int err;
 
        switch (cmd) {
        case SIOCETHTOOL:
-               return b44_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+               return b44_ethtool_ioctl(dev, (void __user*) ifr->ifr_data);
 
        case SIOCGMIIPHY:
                data->phy_id = bp->phy_addr;
index 38497a6436574f88fd46ce1d1ce1003304a18131..e11c909eb7f7091749515e5d2818ef03cb4f74e4 100644 (file)
@@ -46,7 +46,7 @@ typedef union _divert_cf_arg
        u32             uint32;
        s64             int64;
        u64             uint64;
-       void    *ptr;
+       void    __user *ptr;
 } divert_cf_arg;
 
 
@@ -111,7 +111,7 @@ struct divert_cf
 #ifdef CONFIG_NET_DIVERT
 int alloc_divert_blk(struct net_device *);
 void free_divert_blk(struct net_device *);
-int divert_ioctl(unsigned int cmd, struct divert_cf *arg);
+int divert_ioctl(unsigned int cmd, struct divert_cf __user *arg);
 void divert_frame(struct sk_buff *skb);
 static inline void handle_diverter(struct sk_buff *skb)
 {
index a9fdca178d243750a7ece3ea9ff7b104cabce951..0a3fdd8cab138db96ade791e3cc0d355b5a4b8fb 100644 (file)
@@ -144,7 +144,7 @@ struct ifreq
                struct  ifmap ifru_map;
                char    ifru_slave[IFNAMSIZ];   /* Just fits the size */
                char    ifru_newname[IFNAMSIZ];
-               char *  ifru_data;
+               char __user *   ifru_data;
                struct  if_settings ifru_settings;
        } ifr_ifru;
 };
index 965a83b1c31f30a00dd1757277811ba6c4a86c66..8022bf19a95112a5683c2e0f6dd11ab2cc76d2c5 100644 (file)
@@ -438,7 +438,7 @@ struct      iw_param
  */
 struct iw_point
 {
-  caddr_t      pointer;        /* Pointer to the data  (in user space) */
+  void __user  *pointer;       /* Pointer to the data  (in user space) */
   __u16                length;         /* number of fields or size in bytes */
   __u16                flags;          /* Optional params */
 };
index ff9defc681d77b67d1da71bd9730067fff5fb0dd..ef7eb00b09d8e1198cd03133c3e7ada1b7a3f58d 100644 (file)
@@ -1903,7 +1903,7 @@ int register_gifconf(unsigned int family, gifconf_func_t * gifconf)
  *     match.  --pb
  */
 
-static int dev_ifname(struct ifreq *arg)
+static int dev_ifname(struct ifreq __user *arg)
 {
        struct net_device *dev;
        struct ifreq ifr;
@@ -1936,7 +1936,7 @@ static int dev_ifname(struct ifreq *arg)
  *     Thus we will need a 'compatibility mode'.
  */
 
-static int dev_ifconf(char *arg)
+static int dev_ifconf(char __user *arg)
 {
        struct ifconf ifc;
        struct net_device *dev;
@@ -2539,7 +2539,7 @@ static int dev_ifsioc(struct ifreq *ifr, unsigned int cmd)
  *     positive or a negative errno code on error.
  */
 
-int dev_ioctl(unsigned int cmd, void *arg)
+int dev_ioctl(unsigned int cmd, void __user *arg)
 {
        struct ifreq ifr;
        int ret;
@@ -2552,12 +2552,12 @@ int dev_ioctl(unsigned int cmd, void *arg)
 
        if (cmd == SIOCGIFCONF) {
                rtnl_shlock();
-               ret = dev_ifconf((char *) arg);
+               ret = dev_ifconf((char __user *) arg);
                rtnl_shunlock();
                return ret;
        }
        if (cmd == SIOCGIFNAME)
-               return dev_ifname((struct ifreq *)arg);
+               return dev_ifname((struct ifreq __user *)arg);
 
        if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
                return -EFAULT;
index 999eac94d5c13b87564309c9c5410fa332337749..c1340cc53b754ed3e6ab7523fba552e1dcdd79e8 100644 (file)
@@ -195,7 +195,7 @@ out:
 #define        DVDBG(a)        \
        printk(KERN_DEBUG "divert_ioctl() line %d %s\n", __LINE__, (a))
 
-int divert_ioctl(unsigned int cmd, struct divert_cf *arg)
+int divert_ioctl(unsigned int cmd, struct divert_cf __user *arg)
 {
        struct divert_cf        div_cf;
        struct divert_blk       *div_blk;
index c0d4c385cfc00cf40d65d10f3cd7ec093c4d7641..04608e8886316a678af2955949a8a7f63525ab3c 100644 (file)
@@ -74,7 +74,7 @@ int ethtool_op_set_tso(struct net_device *dev, u32 data)
 
 /* Handlers for each ethtool command */
 
-static int ethtool_get_settings(struct net_device *dev, void *useraddr)
+static int ethtool_get_settings(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_cmd cmd = { ETHTOOL_GSET };
        int err;
@@ -91,7 +91,7 @@ static int ethtool_get_settings(struct net_device *dev, void *useraddr)
        return 0;
 }
 
-static int ethtool_set_settings(struct net_device *dev, void *useraddr)
+static int ethtool_set_settings(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_cmd cmd;
 
@@ -104,7 +104,7 @@ static int ethtool_set_settings(struct net_device *dev, void *useraddr)
        return dev->ethtool_ops->set_settings(dev, &cmd);
 }
 
-static int ethtool_get_drvinfo(struct net_device *dev, void *useraddr)
+static int ethtool_get_drvinfo(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_drvinfo info;
        struct ethtool_ops *ops = dev->ethtool_ops;
@@ -130,7 +130,7 @@ static int ethtool_get_drvinfo(struct net_device *dev, void *useraddr)
        return 0;
 }
 
-static int ethtool_get_regs(struct net_device *dev, char *useraddr)
+static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_regs regs;
        struct ethtool_ops *ops = dev->ethtool_ops;
@@ -166,7 +166,7 @@ static int ethtool_get_regs(struct net_device *dev, char *useraddr)
        return ret;
 }
 
-static int ethtool_get_wol(struct net_device *dev, char *useraddr)
+static int ethtool_get_wol(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_wolinfo wol = { ETHTOOL_GWOL };
 
@@ -180,7 +180,7 @@ static int ethtool_get_wol(struct net_device *dev, char *useraddr)
        return 0;
 }
 
-static int ethtool_set_wol(struct net_device *dev, char *useraddr)
+static int ethtool_set_wol(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_wolinfo wol;
 
@@ -193,7 +193,7 @@ static int ethtool_set_wol(struct net_device *dev, char *useraddr)
        return dev->ethtool_ops->set_wol(dev, &wol);
 }
 
-static int ethtool_get_msglevel(struct net_device *dev, char *useraddr)
+static int ethtool_get_msglevel(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata = { ETHTOOL_GMSGLVL };
 
@@ -207,7 +207,7 @@ static int ethtool_get_msglevel(struct net_device *dev, char *useraddr)
        return 0;
 }
 
-static int ethtool_set_msglevel(struct net_device *dev, char *useraddr)
+static int ethtool_set_msglevel(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata;
 
@@ -229,7 +229,7 @@ static int ethtool_nway_reset(struct net_device *dev)
        return dev->ethtool_ops->nway_reset(dev);
 }
 
-static int ethtool_get_link(struct net_device *dev, void *useraddr)
+static int ethtool_get_link(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_value edata = { ETHTOOL_GLINK };
 
@@ -243,7 +243,7 @@ static int ethtool_get_link(struct net_device *dev, void *useraddr)
        return 0;
 }
 
-static int ethtool_get_eeprom(struct net_device *dev, void *useraddr)
+static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_eeprom eeprom;
        struct ethtool_ops *ops = dev->ethtool_ops;
@@ -288,7 +288,7 @@ static int ethtool_get_eeprom(struct net_device *dev, void *useraddr)
        return ret;
 }
 
-static int ethtool_set_eeprom(struct net_device *dev, void *useraddr)
+static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_eeprom eeprom;
        struct ethtool_ops *ops = dev->ethtool_ops;
@@ -329,7 +329,7 @@ static int ethtool_set_eeprom(struct net_device *dev, void *useraddr)
        return ret;
 }
 
-static int ethtool_get_coalesce(struct net_device *dev, void *useraddr)
+static int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_coalesce coalesce = { ETHTOOL_GCOALESCE };
 
@@ -343,7 +343,7 @@ static int ethtool_get_coalesce(struct net_device *dev, void *useraddr)
        return 0;
 }
 
-static int ethtool_set_coalesce(struct net_device *dev, void *useraddr)
+static int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_coalesce coalesce;
 
@@ -356,7 +356,7 @@ static int ethtool_set_coalesce(struct net_device *dev, void *useraddr)
        return dev->ethtool_ops->set_coalesce(dev, &coalesce);
 }
 
-static int ethtool_get_ringparam(struct net_device *dev, void *useraddr)
+static int ethtool_get_ringparam(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_ringparam ringparam = { ETHTOOL_GRINGPARAM };
 
@@ -370,7 +370,7 @@ static int ethtool_get_ringparam(struct net_device *dev, void *useraddr)
        return 0;
 }
 
-static int ethtool_set_ringparam(struct net_device *dev, void *useraddr)
+static int ethtool_set_ringparam(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_ringparam ringparam;
 
@@ -383,7 +383,7 @@ static int ethtool_set_ringparam(struct net_device *dev, void *useraddr)
        return dev->ethtool_ops->set_ringparam(dev, &ringparam);
 }
 
-static int ethtool_get_pauseparam(struct net_device *dev, void *useraddr)
+static int ethtool_get_pauseparam(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM };
 
@@ -397,7 +397,7 @@ static int ethtool_get_pauseparam(struct net_device *dev, void *useraddr)
        return 0;
 }
 
-static int ethtool_set_pauseparam(struct net_device *dev, void *useraddr)
+static int ethtool_set_pauseparam(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_pauseparam pauseparam;
 
@@ -410,7 +410,7 @@ static int ethtool_set_pauseparam(struct net_device *dev, void *useraddr)
        return dev->ethtool_ops->set_pauseparam(dev, &pauseparam);
 }
 
-static int ethtool_get_rx_csum(struct net_device *dev, char *useraddr)
+static int ethtool_get_rx_csum(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata = { ETHTOOL_GRXCSUM };
 
@@ -424,7 +424,7 @@ static int ethtool_get_rx_csum(struct net_device *dev, char *useraddr)
        return 0;
 }
 
-static int ethtool_set_rx_csum(struct net_device *dev, char *useraddr)
+static int ethtool_set_rx_csum(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata;
 
@@ -438,7 +438,7 @@ static int ethtool_set_rx_csum(struct net_device *dev, char *useraddr)
        return 0;
 }
 
-static int ethtool_get_tx_csum(struct net_device *dev, char *useraddr)
+static int ethtool_get_tx_csum(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata = { ETHTOOL_GTXCSUM };
 
@@ -452,7 +452,7 @@ static int ethtool_get_tx_csum(struct net_device *dev, char *useraddr)
        return 0;
 }
 
-static int ethtool_set_tx_csum(struct net_device *dev, char *useraddr)
+static int ethtool_set_tx_csum(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata;
 
@@ -465,7 +465,7 @@ static int ethtool_set_tx_csum(struct net_device *dev, char *useraddr)
        return dev->ethtool_ops->set_tx_csum(dev, edata.data);
 }
 
-static int ethtool_get_sg(struct net_device *dev, char *useraddr)
+static int ethtool_get_sg(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata = { ETHTOOL_GSG };
 
@@ -479,7 +479,7 @@ static int ethtool_get_sg(struct net_device *dev, char *useraddr)
        return 0;
 }
 
-static int ethtool_set_sg(struct net_device *dev, char *useraddr)
+static int ethtool_set_sg(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata;
 
@@ -492,7 +492,7 @@ static int ethtool_set_sg(struct net_device *dev, char *useraddr)
        return dev->ethtool_ops->set_sg(dev, edata.data);
 }
 
-static int ethtool_get_tso(struct net_device *dev, char *useraddr)
+static int ethtool_get_tso(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata = { ETHTOOL_GTSO };
 
@@ -506,7 +506,7 @@ static int ethtool_get_tso(struct net_device *dev, char *useraddr)
        return 0;
 }
 
-static int ethtool_set_tso(struct net_device *dev, char *useraddr)
+static int ethtool_set_tso(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_value edata;
 
@@ -519,7 +519,7 @@ static int ethtool_set_tso(struct net_device *dev, char *useraddr)
        return dev->ethtool_ops->set_tso(dev, edata.data);
 }
 
-static int ethtool_self_test(struct net_device *dev, char *useraddr)
+static int ethtool_self_test(struct net_device *dev, char __user *useraddr)
 {
        struct ethtool_test test;
        struct ethtool_ops *ops = dev->ethtool_ops;
@@ -552,7 +552,7 @@ static int ethtool_self_test(struct net_device *dev, char *useraddr)
        return ret;
 }
 
-static int ethtool_get_strings(struct net_device *dev, void *useraddr)
+static int ethtool_get_strings(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_gstrings gstrings;
        struct ethtool_ops *ops = dev->ethtool_ops;
@@ -599,7 +599,7 @@ static int ethtool_get_strings(struct net_device *dev, void *useraddr)
        return ret;
 }
 
-static int ethtool_phys_id(struct net_device *dev, void *useraddr)
+static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_value id;
 
@@ -612,7 +612,7 @@ static int ethtool_phys_id(struct net_device *dev, void *useraddr)
        return dev->ethtool_ops->phys_id(dev, id.data);
 }
 
-static int ethtool_get_stats(struct net_device *dev, void *useraddr)
+static int ethtool_get_stats(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_stats stats;
        struct ethtool_ops *ops = dev->ethtool_ops;
@@ -650,7 +650,7 @@ static int ethtool_get_stats(struct net_device *dev, void *useraddr)
 int dev_ethtool(struct ifreq *ifr)
 {
        struct net_device *dev = __dev_get_by_name(ifr->ifr_name);
-       void *useraddr = (void *) ifr->ifr_data;
+       void __user *useraddr = (void __user *) ifr->ifr_data;
        u32 ethcmd;
 
        /*