Commit 8412a0db authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

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

parent d48bc1ac
......@@ -26,7 +26,7 @@
typedef struct dgrs_ioctl {
unsigned short cmd; /* Command to run */
unsigned short len; /* Length of the data buffer */
unsigned char *data; /* Pointer to the data buffer */
unsigned char __user *data; /* Pointer to the data buffer */
unsigned short port; /* port number for command, if needed */
unsigned short filter; /* filter number for command, if needed */
} DGRS_IOCTL;
......
......@@ -238,7 +238,7 @@ ppp_asynctty_close(struct tty_struct *tty)
*/
static ssize_t
ppp_asynctty_read(struct tty_struct *tty, struct file *file,
unsigned char *buf, size_t count)
unsigned char __user *buf, size_t count)
{
return -EAGAIN;
}
......@@ -249,7 +249,7 @@ ppp_asynctty_read(struct tty_struct *tty, struct file *file,
*/
static ssize_t
ppp_asynctty_write(struct tty_struct *tty, struct file *file,
const unsigned char *buf, size_t count)
const unsigned char __user *buf, size_t count)
{
return -EAGAIN;
}
......@@ -260,6 +260,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
{
struct asyncppp *ap = ap_get(tty);
int err, val;
int __user *p = (int __user *)arg;
if (ap == 0)
return -ENXIO;
......@@ -270,7 +271,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
if (ap == 0)
break;
err = -EFAULT;
if (put_user(ppp_channel_index(&ap->chan), (int *) arg))
if (put_user(ppp_channel_index(&ap->chan), p))
break;
err = 0;
break;
......@@ -280,7 +281,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
if (ap == 0)
break;
err = -EFAULT;
if (put_user(ppp_unit_number(&ap->chan), (int *) arg))
if (put_user(ppp_unit_number(&ap->chan), p))
break;
err = 0;
break;
......@@ -299,7 +300,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
case FIONREAD:
val = 0;
if (put_user(val, (int *) arg))
if (put_user(val, p))
break;
err = 0;
break;
......@@ -397,6 +398,8 @@ static int
ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
{
struct asyncppp *ap = chan->private;
void __user *argp = (void __user *)arg;
int __user *p = argp;
int err, val;
u32 accm[8];
......@@ -404,12 +407,12 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
switch (cmd) {
case PPPIOCGFLAGS:
val = ap->flags | ap->rbits;
if (put_user(val, (int *) arg))
if (put_user(val, p))
break;
err = 0;
break;
case PPPIOCSFLAGS:
if (get_user(val, (int *) arg))
if (get_user(val, p))
break;
ap->flags = val & ~SC_RCV_BITS;
spin_lock_irq(&ap->recv_lock);
......@@ -419,34 +422,34 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
break;
case PPPIOCGASYNCMAP:
if (put_user(ap->xaccm[0], (u32 *) arg))
if (put_user(ap->xaccm[0], (u32 __user *)argp))
break;
err = 0;
break;
case PPPIOCSASYNCMAP:
if (get_user(ap->xaccm[0], (u32 *) arg))
if (get_user(ap->xaccm[0], (u32 __user *)argp))
break;
err = 0;
break;
case PPPIOCGRASYNCMAP:
if (put_user(ap->raccm, (u32 *) arg))
if (put_user(ap->raccm, (u32 __user *)argp))
break;
err = 0;
break;
case PPPIOCSRASYNCMAP:
if (get_user(ap->raccm, (u32 *) arg))
if (get_user(ap->raccm, (u32 __user *)argp))
break;
err = 0;
break;
case PPPIOCGXASYNCMAP:
if (copy_to_user((void __user *) arg, ap->xaccm, sizeof(ap->xaccm)))
if (copy_to_user(argp, ap->xaccm, sizeof(ap->xaccm)))
break;
err = 0;
break;
case PPPIOCSXASYNCMAP:
if (copy_from_user(accm, (void __user *) arg, sizeof(accm)))
if (copy_from_user(accm, argp, sizeof(accm)))
break;
accm[2] &= ~0x40000000U; /* can't escape 0x5e */
accm[3] |= 0x60000000U; /* must escape 0x7d, 0x7e */
......@@ -455,12 +458,12 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
break;
case PPPIOCGMRU:
if (put_user(ap->mru, (int *) arg))
if (put_user(ap->mru, p))
break;
err = 0;
break;
case PPPIOCSMRU:
if (get_user(val, (int *) arg))
if (get_user(val, p))
break;
if (val < PPP_MRU)
val = PPP_MRU;
......
......@@ -288,7 +288,7 @@ ppp_sync_close(struct tty_struct *tty)
*/
static ssize_t
ppp_sync_read(struct tty_struct *tty, struct file *file,
unsigned char *buf, size_t count)
unsigned char __user *buf, size_t count)
{
return -EAGAIN;
}
......@@ -299,7 +299,7 @@ ppp_sync_read(struct tty_struct *tty, struct file *file,
*/
static ssize_t
ppp_sync_write(struct tty_struct *tty, struct file *file,
const unsigned char *buf, size_t count)
const unsigned char __user *buf, size_t count)
{
return -EAGAIN;
}
......@@ -309,6 +309,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct syncppp *ap = sp_get(tty);
int __user *p = (int __user *)arg;
int err, val;
if (ap == 0)
......@@ -320,7 +321,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
if (ap == 0)
break;
err = -EFAULT;
if (put_user(ppp_channel_index(&ap->chan), (int *) arg))
if (put_user(ppp_channel_index(&ap->chan), p))
break;
err = 0;
break;
......@@ -330,7 +331,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
if (ap == 0)
break;
err = -EFAULT;
if (put_user(ppp_unit_number(&ap->chan), (int *) arg))
if (put_user(ppp_unit_number(&ap->chan), p))
break;
err = 0;
break;
......@@ -349,7 +350,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
case FIONREAD:
val = 0;
if (put_user(val, (int *) arg))
if (put_user(val, p))
break;
err = 0;
break;
......@@ -449,17 +450,19 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
struct syncppp *ap = chan->private;
int err, val;
u32 accm[8];
void __user *argp = (void __user *)arg;
u32 __user *p = argp;
err = -EFAULT;
switch (cmd) {
case PPPIOCGFLAGS:
val = ap->flags | ap->rbits;
if (put_user(val, (int *) arg))
if (put_user(val, (int __user *) argp))
break;
err = 0;
break;
case PPPIOCSFLAGS:
if (get_user(val, (int *) arg))
if (get_user(val, (int __user *) argp))
break;
ap->flags = val & ~SC_RCV_BITS;
spin_lock_irq(&ap->recv_lock);
......@@ -469,34 +472,34 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
break;
case PPPIOCGASYNCMAP:
if (put_user(ap->xaccm[0], (u32 *) arg))
if (put_user(ap->xaccm[0], p))
break;
err = 0;
break;
case PPPIOCSASYNCMAP:
if (get_user(ap->xaccm[0], (u32 *) arg))
if (get_user(ap->xaccm[0], p))
break;
err = 0;
break;
case PPPIOCGRASYNCMAP:
if (put_user(ap->raccm, (u32 *) arg))
if (put_user(ap->raccm, p))
break;
err = 0;
break;
case PPPIOCSRASYNCMAP:
if (get_user(ap->raccm, (u32 *) arg))
if (get_user(ap->raccm, p))
break;
err = 0;
break;
case PPPIOCGXASYNCMAP:
if (copy_to_user((void *) arg, ap->xaccm, sizeof(ap->xaccm)))
if (copy_to_user(argp, ap->xaccm, sizeof(ap->xaccm)))
break;
err = 0;
break;
case PPPIOCSXASYNCMAP:
if (copy_from_user(accm, (void *) arg, sizeof(accm)))
if (copy_from_user(accm, argp, sizeof(accm)))
break;
accm[2] &= ~0x40000000U; /* can't escape 0x5e */
accm[3] |= 0x60000000U; /* must escape 0x7d, 0x7e */
......@@ -505,12 +508,12 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
break;
case PPPIOCGMRU:
if (put_user(ap->mru, (int *) arg))
if (put_user(ap->mru, (int __user *) argp))
break;
err = 0;
break;
case PPPIOCSMRU:
if (get_user(val, (int *) arg))
if (get_user(val, (int __user *) argp))
break;
if (val < PPP_MRU)
val = PPP_MRU;
......
......@@ -691,7 +691,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
if (put_user(po->pppoe_dev->mtu -
sizeof(struct pppoe_hdr) -
PPP_HDRLEN,
(int *) arg))
(int __user *) arg))
break;
err = 0;
break;
......@@ -702,7 +702,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
break;
err = -EFAULT;
if (get_user(val,(int *) arg))
if (get_user(val,(int __user *) arg))
break;
if (val < (po->pppoe_dev->mtu
......@@ -715,7 +715,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
case PPPIOCSFLAGS:
err = -EFAULT;
if (get_user(val, (int *) arg))
if (get_user(val, (int __user *) arg))
break;
err = 0;
break;
......@@ -736,7 +736,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
PPPoE address to which frames are forwarded to */
err = -EFAULT;
if (copy_from_user(&po->pppoe_relay,
(void*)arg,
(void __user *)arg,
sizeof(struct sockaddr_pppox)))
break;
......
......@@ -86,7 +86,7 @@ static int pppox_ioctl(struct socket* sock, unsigned int cmd,
rc = -EINVAL;
index = ppp_channel_index(&po->chan);
if (put_user(index , (int *) arg))
if (put_user(index , (int __user *) arg))
break;
rc = 0;
......
......@@ -170,7 +170,7 @@ struct s_DrvRlmtMbuf {
typedef struct s_IOCTL SK_GE_IOCTL;
struct s_IOCTL {
char* pData;
char __user * pData;
unsigned int Len;
};
......
......@@ -528,8 +528,10 @@ static void happy_meal_tcvr_write(struct happy_meal *hp,
ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value));
/* Welcome to Sun Microsystems, can I take your order please? */
if (!(hp->happy_flags & HFLAG_FENABLE))
return happy_meal_bb_write(hp, tregs, reg, value);
if (!(hp->happy_flags & HFLAG_FENABLE)) {
happy_meal_bb_write(hp, tregs, reg, value);
return;
}
/* Would you like fries with that? */
hme_write32(hp, tregs + TCVR_FRAME,
......
......@@ -399,7 +399,7 @@ static int arlan_setup_card_by_book(struct net_device *dev)
static char arlan_drive_info[ARLAN_STR_SIZE] = "A655\n\0";
static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp,
void *buffer, size_t * lenp)
void __user *buffer, size_t * lenp)
{
int i;
int retv, pos, devnum;
......@@ -636,7 +636,7 @@ static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp,
static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp,
void *buffer, size_t * lenp)
void __user *buffer, size_t * lenp)
{
int i;
int retv, pos, devnum;
......@@ -670,7 +670,7 @@ static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp
}
static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp,
void *buffer, size_t * lenp)
void __user *buffer, size_t * lenp)
{
int i;
int retv, pos, devnum;
......@@ -699,7 +699,7 @@ static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp
}
static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp,
void *buffer, size_t * lenp)
void __user *buffer, size_t * lenp)
{
int i;
int retv, pos, devnum;
......@@ -727,7 +727,7 @@ static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp
}
static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
void *buffer, size_t * lenp)
void __user *buffer, size_t * lenp)
{
int i;
int retv, pos, devnum;
......@@ -763,7 +763,7 @@ static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
static char conf_reset_result[200];
static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
void *buffer, size_t * lenp)
void __user *buffer, size_t * lenp)
{
int pos = 0;
int devnum = ctl->procname[6] - '0';
......@@ -788,7 +788,7 @@ static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
}
static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
void *buffer, size_t * lenp)
void __user *buffer, size_t * lenp)
{
int pos = 0;
int devnum = ctl->procname[5] - '0';
......
......@@ -2360,7 +2360,7 @@ static const iw_handler atmel_private_handler[] =
typedef struct atmel_priv_ioctl {
char id[32];
unsigned char *data;
unsigned char __user *data;
unsigned short len;
} atmel_priv_ioctl;
......
......@@ -384,7 +384,7 @@ static int __init orinoco_pci_init(void)
return pci_module_init(&orinoco_pci_driver);
}
extern void __exit orinoco_pci_exit(void)
void __exit orinoco_pci_exit(void)
{
pci_unregister_driver(&orinoco_pci_driver);
}
......
......@@ -341,7 +341,7 @@ static int __init orinoco_plx_init(void)
return pci_module_init(&orinoco_plx_driver);
}
extern void __exit orinoco_plx_exit(void)
void __exit orinoco_plx_exit(void)
{
pci_unregister_driver(&orinoco_plx_driver);
current->state = TASK_UNINTERRUPTIBLE;
......
......@@ -219,7 +219,7 @@ static int __init orinoco_tmd_init(void)
return pci_module_init(&orinoco_tmd_driver);
}
extern void __exit orinoco_tmd_exit(void)
void __exit orinoco_tmd_exit(void)
{
pci_unregister_driver(&orinoco_tmd_driver);
current->state = TASK_UNINTERRUPTIBLE;
......
......@@ -2854,7 +2854,7 @@ static void raycs_write(const char *name, write_proc_t *w, void *data)
}
}
static int write_essid(struct file *file, const char *buffer, unsigned long count, void *data)
static int write_essid(struct file *file, const char __user *buffer, unsigned long count, void *data)
{
static char proc_essid[33];
int len = count;
......@@ -2868,7 +2868,7 @@ static int write_essid(struct file *file, const char *buffer, unsigned long coun
return count;
}
static int write_int(struct file *file, const char *buffer, unsigned long count, void *data)
static int write_int(struct file *file, const char __user *buffer, unsigned long count, void *data)
{
static char proc_number[10];
char *p;
......
......@@ -409,12 +409,12 @@ static const MetricomAddress zero_address;
static const MetricomAddress broadcast_address =
{ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} };
static const MetricomKey SIP0Key = { {"SIP0"} };
static const MetricomKey ARP0Key = { {"ARP0"} };
static const MetricomKey ATR_Key = { {"ATR "} };
static const MetricomKey ACK_Key = { {"ACK_"} };
static const MetricomKey INF_Key = { {"INF_"} };
static const MetricomKey ERR_Key = { {"ERR_"} };
static const MetricomKey SIP0Key = { "SIP0" };
static const MetricomKey ARP0Key = { "ARP0" };
static const MetricomKey ATR_Key = { "ATR " };
static const MetricomKey ACK_Key = { "ACK_" };
static const MetricomKey INF_Key = { "INF_" };
static const MetricomKey ERR_Key = { "ERR_" };
static const long MaxARPInterval = 60 * HZ; /* One minute */
......@@ -2733,14 +2733,14 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file,
switch (cmd) {
case SIOCGIFNAME:
if(copy_to_user((void *) arg, strip_info->dev->name, strlen(strip_info->dev->name) + 1))
if(copy_to_user((void __user *) arg, strip_info->dev->name, strlen(strip_info->dev->name) + 1))
return -EFAULT;
break;
case SIOCSIFHWADDR:
{
MetricomAddress addr;
//printk(KERN_INFO "%s: SIOCSIFHWADDR\n", strip_info->dev->name);
if(copy_from_user(&addr, (void *) arg, sizeof(MetricomAddress)))
if(copy_from_user(&addr, (void __user *) arg, sizeof(MetricomAddress)))
return -EFAULT;
return set_mac_address(strip_info, &addr);
}
......@@ -2750,7 +2750,7 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file,
case TCGETS:
case TCGETA:
return n_tty_ioctl(tty, (struct file *) file, cmd, (unsigned long) arg);
return n_tty_ioctl(tty, file, cmd, arg);
break;
default:
return -ENOIOCTLCMD;
......
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