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

[PATCH] isdn_divert annotations

missing __user annotations + removal of gratitious casts in LHS of
assignments.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 54484186
...@@ -77,7 +77,7 @@ put_info_buffer(char *cp) ...@@ -77,7 +77,7 @@ put_info_buffer(char *cp)
/* deflection device read routine */ /* deflection device read routine */
/**********************************/ /**********************************/
static ssize_t static ssize_t
isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off) isdn_divert_read(struct file *file, char __user *buf, size_t count, loff_t * off)
{ {
struct divert_info *inf; struct divert_info *inf;
int len; int len;
...@@ -91,7 +91,7 @@ isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off) ...@@ -91,7 +91,7 @@ isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off)
return (0); return (0);
inf->usage_cnt--; /* new usage count */ inf->usage_cnt--; /* new usage count */
(struct divert_info **) file->private_data = &inf->next; /* next structure */ file->private_data = &inf->next; /* next structure */
if ((len = strlen(inf->info_start)) <= count) { if ((len = strlen(inf->info_start)) <= count) {
if (copy_to_user(buf, inf->info_start, len)) if (copy_to_user(buf, inf->info_start, len))
return -EFAULT; return -EFAULT;
...@@ -105,7 +105,7 @@ isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off) ...@@ -105,7 +105,7 @@ isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off)
/* deflection device write routine */ /* deflection device write routine */
/**********************************/ /**********************************/
static ssize_t static ssize_t
isdn_divert_write(struct file *file, const char *buf, size_t count, loff_t * off) isdn_divert_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
{ {
return (-ENODEV); return (-ENODEV);
} /* isdn_divert_write */ } /* isdn_divert_write */
...@@ -138,9 +138,9 @@ isdn_divert_open(struct inode *ino, struct file *filep) ...@@ -138,9 +138,9 @@ isdn_divert_open(struct inode *ino, struct file *filep)
spin_lock_irqsave( &divert_info_lock, flags ); spin_lock_irqsave( &divert_info_lock, flags );
if_used++; if_used++;
if (divert_info_head) if (divert_info_head)
(struct divert_info **) filep->private_data = &(divert_info_tail->next); filep->private_data = &(divert_info_tail->next);
else else
(struct divert_info **) filep->private_data = &divert_info_head; filep->private_data = &divert_info_head;
spin_unlock_irqrestore( &divert_info_lock, flags ); spin_unlock_irqrestore( &divert_info_lock, flags );
/* start_divert(); */ /* start_divert(); */
return nonseekable_open(ino, filep); return nonseekable_open(ino, filep);
...@@ -185,7 +185,7 @@ isdn_divert_ioctl(struct inode *inode, struct file *file, ...@@ -185,7 +185,7 @@ isdn_divert_ioctl(struct inode *inode, struct file *file,
divert_rule *rulep; divert_rule *rulep;
char *cp; char *cp;
if (copy_from_user(&dioctl, (char *) arg, sizeof(dioctl))) if (copy_from_user(&dioctl, (void __user *) arg, sizeof(dioctl)))
return -EFAULT; return -EFAULT;
switch (cmd) { switch (cmd) {
...@@ -253,7 +253,7 @@ isdn_divert_ioctl(struct inode *inode, struct file *file, ...@@ -253,7 +253,7 @@ isdn_divert_ioctl(struct inode *inode, struct file *file,
default: default:
return (-EINVAL); return (-EINVAL);
} /* switch cmd */ } /* switch cmd */
return copy_to_user((char *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0; return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
} /* isdn_divert_ioctl */ } /* isdn_divert_ioctl */
......
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