Skip to content

Commit

Permalink
[PATCH] fbdev: Sanitize ->fb_ioctl prototype
Browse files Browse the repository at this point in the history
The ioctl and file arguments to ->fb_mmap are totally unused and there's not
reason a driver should need them.

Also update the ->fb_compat_ioctl prototype to be the same as ->fb_mmap.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christoph Hellwig authored and Linus Torvalds committed Jan 15, 2006
1 parent a80da73 commit 67a6680
Show file tree
Hide file tree
Showing 27 changed files with 67 additions and 109 deletions.
9 changes: 3 additions & 6 deletions drivers/video/amifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,9 +1131,7 @@ static void amifb_copyarea(struct fb_info *info,
const struct fb_copyarea *region);
static void amifb_imageblit(struct fb_info *info,
const struct fb_image *image);
static int amifb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
struct fb_info *info);
static int amifb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg);


/*
Expand Down Expand Up @@ -2172,9 +2170,8 @@ static void amifb_imageblit(struct fb_info *info, const struct fb_image *image)
* Amiga Frame Buffer Specific ioctls
*/

static int amifb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
struct fb_info *info)
static int amifb_ioctl(struct fb_info *info,
unsigned int cmd, unsigned long arg)
{
union {
struct fb_fix_cursorinfo fix;
Expand Down
5 changes: 2 additions & 3 deletions drivers/video/arcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,8 @@ static void arcfb_imageblit(struct fb_info *info, const struct fb_image *image)
image->height);
}

static int arcfb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
struct fb_info *info)
static int arcfb_ioctl(struct fb_info *info,
unsigned int cmd, unsigned long arg)
{
void __user *argp = (void __user *)arg;
struct arcfb_par *par = info->par;
Expand Down
3 changes: 1 addition & 2 deletions drivers/video/atafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2571,8 +2571,7 @@ atafb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info *info)
}

static int
atafb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, int con, struct fb_info *info)
atafb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
#ifdef FBCMD_GET_CURRENTPAR
Expand Down
6 changes: 2 additions & 4 deletions drivers/video/aty/aty128fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,7 @@ static int aty128fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static int aty128fb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *fb);
static int aty128fb_blank(int blank, struct fb_info *fb);
static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, struct fb_info *info);
static int aty128fb_ioctl(struct fb_info *info, u_int cmd, unsigned long arg);
static int aty128fb_sync(struct fb_info *info);

/*
Expand Down Expand Up @@ -2108,8 +2107,7 @@ static int aty128fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
/* in param: u32* backlight value: 0 to 15 */
#define FBIO_ATY128_SET_MIRROR _IOW('@', 2, __u32)

static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, struct fb_info *info)
static int aty128fb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
{
struct aty128fb_par *par = info->par;
u32 value;
Expand Down
6 changes: 2 additions & 4 deletions drivers/video/aty/atyfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info);
static int atyfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
static int atyfb_blank(int blank, struct fb_info *info);
static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, struct fb_info *info);
static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg);
extern void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
extern void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
extern void atyfb_imageblit(struct fb_info *info, const struct fb_image *image);
Expand Down Expand Up @@ -1739,8 +1738,7 @@ struct atyclk {
#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
#endif

static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, struct fb_info *info)
static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
{
struct atyfb_par *par = (struct atyfb_par *) info->par;
#ifdef __sparc__
Expand Down
4 changes: 2 additions & 2 deletions drivers/video/aty/radeon_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,8 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var,
}


static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int radeonfb_ioctl (struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
struct radeonfb_info *rinfo = info->par;
unsigned int tmp;
Expand Down
6 changes: 2 additions & 4 deletions drivers/video/bw2.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
static int bw2_blank(int, struct fb_info *);

static int bw2_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static int bw2_ioctl(struct inode *, struct file *, unsigned int,
unsigned long, struct fb_info *);
static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long);

/*
* Frame buffer operations
Expand Down Expand Up @@ -181,8 +180,7 @@ static int bw2_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma);
}

static int bw2_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
struct bw2_par *par = (struct bw2_par *) info->par;

Expand Down
6 changes: 2 additions & 4 deletions drivers/video/cg14.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ static int cg14_setcolreg(unsigned, unsigned, unsigned, unsigned,
unsigned, struct fb_info *);

static int cg14_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static int cg14_ioctl(struct inode *, struct file *, unsigned int,
unsigned long, struct fb_info *);
static int cg14_ioctl(struct fb_info *, unsigned int, unsigned long);
static int cg14_pan_display(struct fb_var_screeninfo *, struct fb_info *);

/*
Expand Down Expand Up @@ -277,8 +276,7 @@ static int cg14_mmap(struct fb_info *info, struct file *file, struct vm_area_str
par->iospace, vma);
}

static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
struct cg14_par *par = (struct cg14_par *) info->par;
struct cg14_regs __iomem *regs = par->regs;
Expand Down
6 changes: 2 additions & 4 deletions drivers/video/cg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ static int cg3_setcolreg(unsigned, unsigned, unsigned, unsigned,
static int cg3_blank(int, struct fb_info *);

static int cg3_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static int cg3_ioctl(struct inode *, struct file *, unsigned int,
unsigned long, struct fb_info *);
static int cg3_ioctl(struct fb_info *, unsigned int, unsigned long);

/*
* Frame buffer operations
Expand Down Expand Up @@ -240,8 +239,7 @@ static int cg3_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma);
}

static int cg3_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
struct cg3_par *par = (struct cg3_par *) info->par;

Expand Down
6 changes: 2 additions & 4 deletions drivers/video/cg6.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ static void cg6_imageblit(struct fb_info *, const struct fb_image *);
static void cg6_fillrect(struct fb_info *, const struct fb_fillrect *);
static int cg6_sync(struct fb_info *);
static int cg6_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static int cg6_ioctl(struct inode *, struct file *, unsigned int,
unsigned long, struct fb_info *);
static int cg6_ioctl(struct fb_info *, unsigned int, unsigned long);

/*
* Frame buffer operations
Expand Down Expand Up @@ -534,8 +533,7 @@ static int cg6_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma);
}

static int cg6_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
struct cg6_par *par = (struct cg6_par *) info->par;

Expand Down
4 changes: 2 additions & 2 deletions drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
default:
if (fb->fb_ioctl == NULL)
return -EINVAL;
return fb->fb_ioctl(inode, file, cmd, arg, info);
return fb->fb_ioctl(info, cmd, arg);
}
}

Expand Down Expand Up @@ -1107,7 +1107,7 @@ fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

default:
if (fb->fb_compat_ioctl)
ret = fb->fb_compat_ioctl(file, cmd, arg, info);
ret = fb->fb_compat_ioctl(info, cmd, arg);
break;
}
unlock_kernel();
Expand Down
6 changes: 2 additions & 4 deletions drivers/video/ffb.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ static void ffb_fillrect(struct fb_info *, const struct fb_fillrect *);
static void ffb_copyarea(struct fb_info *, const struct fb_copyarea *);
static int ffb_sync(struct fb_info *);
static int ffb_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static int ffb_ioctl(struct inode *, struct file *, unsigned int,
unsigned long, struct fb_info *);
static int ffb_ioctl(struct fb_info *, unsigned int, unsigned long);
static int ffb_pan_display(struct fb_var_screeninfo *, struct fb_info *);

/*
Expand Down Expand Up @@ -848,8 +847,7 @@ static int ffb_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
0, vma);
}

static int ffb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int ffb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
struct ffb_par *par = (struct ffb_par *) info->par;

Expand Down
3 changes: 1 addition & 2 deletions drivers/video/imsttfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1267,8 +1267,7 @@ imsttfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
#define FBIMSTT_GETIDXREG 0x545406

static int
imsttfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, struct fb_info *info)
imsttfb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
{
struct imstt_par *par = info->par;
void __user *argp = (void __user *)arg;
Expand Down
8 changes: 3 additions & 5 deletions drivers/video/intelfb/intelfbdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ static int intelfb_cursor(struct fb_info *info,

static int intelfb_sync(struct fb_info *info);

static int intelfb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
struct fb_info *info);
static int intelfb_ioctl(struct fb_info *info,
unsigned int cmd, unsigned long arg);

static int __devinit intelfb_pci_register(struct pci_dev *pdev,
const struct pci_device_id *ent);
Expand Down Expand Up @@ -1380,8 +1379,7 @@ intelfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)

/* When/if we have our own ioctls. */
static int
intelfb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
intelfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
int retval = 0;

Expand Down
5 changes: 2 additions & 3 deletions drivers/video/kyro/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,8 @@ static int __init kyrofb_setup(char *options)
}
#endif

static int kyrofb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
struct fb_info *info)
static int kyrofb_ioctl(struct fb_info *info,
unsigned int cmd, unsigned long arg)
{
overlay_create ol_create;
overlay_viewport_set ol_viewport_set;
Expand Down
6 changes: 2 additions & 4 deletions drivers/video/leo.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ static int leo_setcolreg(unsigned, unsigned, unsigned, unsigned,
static int leo_blank(int, struct fb_info *);

static int leo_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static int leo_ioctl(struct inode *, struct file *, unsigned int,
unsigned long, struct fb_info *);
static int leo_ioctl(struct fb_info *, unsigned int, unsigned long);
static int leo_pan_display(struct fb_var_screeninfo *, struct fb_info *);

/*
Expand Down Expand Up @@ -373,8 +372,7 @@ static int leo_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma);
}

static int leo_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
struct leo_par *par = (struct leo_par *) info->par;

Expand Down
5 changes: 2 additions & 3 deletions drivers/video/matrox/matroxfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,8 @@ static struct matrox_altout panellink_output = {
.name = "Panellink output",
};

static int matroxfb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
struct fb_info *info)
static int matroxfb_ioctl(struct fb_info *info,
unsigned int cmd, unsigned long arg)
{
void __user *argp = (void __user *)arg;
MINFO_FROM_INFO(info);
Expand Down
9 changes: 4 additions & 5 deletions drivers/video/matrox/matroxfb_crtc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,10 @@ static int matroxfb_dh_get_vblank(const struct matroxfb_dh_fb_info* m2info, stru
return 0;
}

static int matroxfb_dh_ioctl(struct inode* inode,
struct file* file,
static int matroxfb_dh_ioctl(struct fb_info *info,
unsigned int cmd,
unsigned long arg,
struct fb_info* info) {
unsigned long arg)
{
#define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon))
MINFO_FROM(m2info->primary_dev);

Expand Down Expand Up @@ -457,7 +456,7 @@ static int matroxfb_dh_ioctl(struct inode* inode,
case MATROXFB_GET_OUTPUT_MODE:
case MATROXFB_GET_ALL_OUTPUTS:
{
return ACCESS_FBINFO(fbcon.fbops)->fb_ioctl(inode, file, cmd, arg, &ACCESS_FBINFO(fbcon));
return ACCESS_FBINFO(fbcon.fbops)->fb_ioctl(&ACCESS_FBINFO(fbcon), cmd, arg);
}
case MATROXFB_SET_OUTPUT_CONNECTION:
{
Expand Down
7 changes: 3 additions & 4 deletions drivers/video/p9100.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ static int p9100_setcolreg(unsigned, unsigned, unsigned, unsigned,
static int p9100_blank(int, struct fb_info *);

static int p9100_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static int p9100_ioctl(struct inode *, struct file *, unsigned int,
unsigned long, struct fb_info *);
static int p9100_ioctl(struct fb_info *, unsigned int, unsigned long);

/*
* Frame buffer operations
Expand Down Expand Up @@ -232,8 +231,8 @@ static int p9100_mmap(struct fb_info *info, struct file *file, struct vm_area_st
vma);
}

static int p9100_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int p9100_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
struct p9100_par *par = (struct p9100_par *) info->par;

Expand Down
8 changes: 2 additions & 6 deletions drivers/video/pm3fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,7 @@ static void pm3fb_set_disp(const void *par, struct display *disp,
static void pm3fb_detect(void);
static int pm3fb_pan_display(const struct fb_var_screeninfo *var,
struct fb_info_gen *info);
static int pm3fb_ioctl(struct inode *inode, struct file *file,
u_int cmd, u_long arg, int con,
struct fb_info *info);
static int pm3fb_ioctl(struct fb_info *info, u_int cmd, u_long arg);


/* the struct that hold them together */
Expand Down Expand Up @@ -3438,9 +3436,7 @@ static int pm3fb_pan_display(const struct fb_var_screeninfo *var,
return 0;
}

static int pm3fb_ioctl(struct inode *inode, struct file *file,
u_int cmd, u_long arg, int con,
struct fb_info *info)
static int pm3fb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
{
struct pm3fb_info *l_fb_info = (struct pm3fb_info *) info;
u32 cm, i;
Expand Down
3 changes: 1 addition & 2 deletions drivers/video/pmag-aa-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@ static int aafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
return -EINVAL;
}

static int aafb_ioctl(struct inode *inode, struct file *file, u32 cmd,
unsigned long arg, int con, struct fb_info *info)
static int aafb_ioctl(struct fb_info *info, u32 cmd, unsigned long arg)
{
/* TODO: Not yet implemented */
return -ENOIOCTLCMD;
Expand Down
4 changes: 2 additions & 2 deletions drivers/video/radeonfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1497,8 +1497,8 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var,
}


static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, struct fb_info *info)
static int radeonfb_ioctl (struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
struct radeonfb_info *rinfo = (struct radeonfb_info *) info;
unsigned int tmp;
Expand Down
Loading

0 comments on commit 67a6680

Please sign in to comment.