Commit 00ca7784 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] annotations in drivers/video

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9e943963
...@@ -2149,7 +2149,7 @@ static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -2149,7 +2149,7 @@ static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
case FBIO_ATY128_SET_MIRROR: case FBIO_ATY128_SET_MIRROR:
if (par->chip_gen != rage_M3) if (par->chip_gen != rage_M3)
return -EINVAL; return -EINVAL;
rc = get_user(value, (__u32*)arg); rc = get_user(value, (__u32 __user *)arg);
if (rc) if (rc)
return rc; return rc;
par->lcd_on = (value & 0x01) != 0; par->lcd_on = (value & 0x01) != 0;
...@@ -2163,7 +2163,7 @@ static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -2163,7 +2163,7 @@ static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
if (par->chip_gen != rage_M3) if (par->chip_gen != rage_M3)
return -EINVAL; return -EINVAL;
value = (par->crt_on << 1) | par->lcd_on; value = (par->crt_on << 1) | par->lcd_on;
return put_user(value, (__u32*)arg); return put_user(value, (__u32 __user *)arg);
} }
#endif #endif
return -EINVAL; return -EINVAL;
......
...@@ -1037,7 +1037,7 @@ static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -1037,7 +1037,7 @@ static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
fbtyp.fb_cmsize = info->cmap.len; fbtyp.fb_cmsize = info->cmap.len;
fbtyp.fb_size = info->fix.smem_len; fbtyp.fb_size = info->fix.smem_len;
if (copy_to_user if (copy_to_user
((struct fbtype *) arg, &fbtyp, sizeof(fbtyp))) ((struct fbtype __user *) arg, &fbtyp, sizeof(fbtyp)))
return -EFAULT; return -EFAULT;
break; break;
#endif /* __sparc__ */ #endif /* __sparc__ */
......
...@@ -278,7 +278,7 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -278,7 +278,7 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{ {
struct cg14_par *par = (struct cg14_par *) info->par; struct cg14_par *par = (struct cg14_par *) info->par;
struct cg14_regs *regs = par->regs; struct cg14_regs *regs = par->regs;
struct mdi_cfginfo kmdi, *mdii; struct mdi_cfginfo kmdi, __user *mdii;
unsigned long flags; unsigned long flags;
int cur_mode, mode, ret = 0; int cur_mode, mode, ret = 0;
...@@ -301,13 +301,13 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -301,13 +301,13 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
kmdi.mdi_size = par->ramsize; kmdi.mdi_size = par->ramsize;
spin_unlock_irqrestore(&par->lock, flags); spin_unlock_irqrestore(&par->lock, flags);
mdii = (struct mdi_cfginfo *) arg; mdii = (struct mdi_cfginfo __user *) arg;
if (copy_to_user(mdii, &kmdi, sizeof(kmdi))) if (copy_to_user(mdii, &kmdi, sizeof(kmdi)))
ret = -EFAULT; ret = -EFAULT;
break; break;
case MDI_SET_PIXELMODE: case MDI_SET_PIXELMODE:
if (get_user(mode, (int *) arg)) { if (get_user(mode, (int __user *) arg)) {
ret = -EFAULT; ret = -EFAULT;
break; break;
} }
......
...@@ -93,7 +93,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, ...@@ -93,7 +93,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
{ {
switch(cmd) { switch(cmd) {
case FBIOGTYPE: { case FBIOGTYPE: {
struct fbtype *f = (struct fbtype *) arg; struct fbtype __user *f = (struct fbtype __user *) arg;
if (put_user(type, &f->fb_type) || if (put_user(type, &f->fb_type) ||
__put_user(info->var.yres, &f->fb_height) || __put_user(info->var.yres, &f->fb_height) ||
...@@ -105,10 +105,12 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, ...@@ -105,10 +105,12 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
return 0; return 0;
} }
case FBIOPUTCMAP_SPARC: { case FBIOPUTCMAP_SPARC: {
struct fbcmap *c = (struct fbcmap *) arg; struct fbcmap __user *c = (struct fbcmap __user *) arg;
struct fb_cmap cmap; struct fb_cmap cmap;
u16 red, green, blue; u16 red, green, blue;
unsigned char *ured, *ugreen, *ublue; unsigned char __user *ured;
unsigned char __user *ugreen;
unsigned char __user *ublue;
int index, count, i; int index, count, i;
if (get_user(index, &c->index) || if (get_user(index, &c->index) ||
...@@ -139,8 +141,10 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, ...@@ -139,8 +141,10 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
return 0; return 0;
} }
case FBIOGETCMAP_SPARC: { case FBIOGETCMAP_SPARC: {
struct fbcmap *c = (struct fbcmap *) arg; struct fbcmap __user *c = (struct fbcmap __user *) arg;
unsigned char *ured, *ugreen, *ublue; unsigned char __user *ured;
unsigned char __user *ugreen;
unsigned char __user *ublue;
struct fb_cmap *cmap = &info->cmap; struct fb_cmap *cmap = &info->cmap;
int index, count, i; int index, count, i;
......
#ifndef __LINUX_FBIO_H #ifndef __LINUX_FBIO_H
#define __LINUX_FBIO_H #define __LINUX_FBIO_H
#include <linux/compiler.h>
/* Constants used for fbio SunOS compatibility */ /* Constants used for fbio SunOS compatibility */
/* (C) 1996 Miguel de Icaza */ /* (C) 1996 Miguel de Icaza */
...@@ -56,9 +58,9 @@ struct fbtype { ...@@ -56,9 +58,9 @@ struct fbtype {
struct fbcmap { struct fbcmap {
int index; /* first element (0 origin) */ int index; /* first element (0 origin) */
int count; int count;
unsigned char *red; unsigned char __user *red;
unsigned char *green; unsigned char __user *green;
unsigned char *blue; unsigned char __user *blue;
}; };
#ifdef __KERNEL__ #ifdef __KERNEL__
......
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