[PATCH] fbdev: Sanitize ->fb_ioctl prototype

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>

authored by Christoph Hellwig and committed by Linus Torvalds 67a6680d a80da738

+67 -109
+3 -6
drivers/video/amifb.c
··· 1131 1131 const struct fb_copyarea *region); 1132 1132 static void amifb_imageblit(struct fb_info *info, 1133 1133 const struct fb_image *image); 1134 - static int amifb_ioctl(struct inode *inode, struct file *file, 1135 - unsigned int cmd, unsigned long arg, 1136 - struct fb_info *info); 1134 + static int amifb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg); 1137 1135 1138 1136 1139 1137 /* ··· 2170 2172 * Amiga Frame Buffer Specific ioctls 2171 2173 */ 2172 2174 2173 - static int amifb_ioctl(struct inode *inode, struct file *file, 2174 - unsigned int cmd, unsigned long arg, 2175 - struct fb_info *info) 2175 + static int amifb_ioctl(struct fb_info *info, 2176 + unsigned int cmd, unsigned long arg) 2176 2177 { 2177 2178 union { 2178 2179 struct fb_fix_cursorinfo fix;
+2 -3
drivers/video/arcfb.c
··· 399 399 image->height); 400 400 } 401 401 402 - static int arcfb_ioctl(struct inode *inode, struct file *file, 403 - unsigned int cmd, unsigned long arg, 404 - struct fb_info *info) 402 + static int arcfb_ioctl(struct fb_info *info, 403 + unsigned int cmd, unsigned long arg) 405 404 { 406 405 void __user *argp = (void __user *)arg; 407 406 struct arcfb_par *par = info->par;
+1 -2
drivers/video/atafb.c
··· 2571 2571 } 2572 2572 2573 2573 static int 2574 - atafb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 2575 - unsigned long arg, int con, struct fb_info *info) 2574 + atafb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 2576 2575 { 2577 2576 switch (cmd) { 2578 2577 #ifdef FBCMD_GET_CURRENTPAR
+2 -4
drivers/video/aty/aty128fb.c
··· 431 431 static int aty128fb_pan_display(struct fb_var_screeninfo *var, 432 432 struct fb_info *fb); 433 433 static int aty128fb_blank(int blank, struct fb_info *fb); 434 - static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd, 435 - u_long arg, struct fb_info *info); 434 + static int aty128fb_ioctl(struct fb_info *info, u_int cmd, unsigned long arg); 436 435 static int aty128fb_sync(struct fb_info *info); 437 436 438 437 /* ··· 2107 2108 /* in param: u32* backlight value: 0 to 15 */ 2108 2109 #define FBIO_ATY128_SET_MIRROR _IOW('@', 2, __u32) 2109 2110 2110 - static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd, 2111 - u_long arg, struct fb_info *info) 2111 + static int aty128fb_ioctl(struct fb_info *info, u_int cmd, u_long arg) 2112 2112 { 2113 2113 struct aty128fb_par *par = info->par; 2114 2114 u32 value;
+2 -4
drivers/video/aty/atyfb_base.c
··· 238 238 u_int transp, struct fb_info *info); 239 239 static int atyfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); 240 240 static int atyfb_blank(int blank, struct fb_info *info); 241 - static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd, 242 - u_long arg, struct fb_info *info); 241 + static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg); 243 242 extern void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); 244 243 extern void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); 245 244 extern void atyfb_imageblit(struct fb_info *info, const struct fb_image *image); ··· 1738 1739 #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) 1739 1740 #endif 1740 1741 1741 - static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd, 1742 - u_long arg, struct fb_info *info) 1742 + static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) 1743 1743 { 1744 1744 struct atyfb_par *par = (struct atyfb_par *) info->par; 1745 1745 #ifdef __sparc__
+2 -2
drivers/video/aty/radeon_base.c
··· 864 864 } 865 865 866 866 867 - static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int cmd, 868 - unsigned long arg, struct fb_info *info) 867 + static int radeonfb_ioctl (struct fb_info *info, unsigned int cmd, 868 + unsigned long arg) 869 869 { 870 870 struct radeonfb_info *rinfo = info->par; 871 871 unsigned int tmp;
+2 -4
drivers/video/bw2.c
··· 36 36 static int bw2_blank(int, struct fb_info *); 37 37 38 38 static int bw2_mmap(struct fb_info *, struct file *, struct vm_area_struct *); 39 - static int bw2_ioctl(struct inode *, struct file *, unsigned int, 40 - unsigned long, struct fb_info *); 39 + static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long); 41 40 42 41 /* 43 42 * Frame buffer operations ··· 180 181 vma); 181 182 } 182 183 183 - static int bw2_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 184 - unsigned long arg, struct fb_info *info) 184 + static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 185 185 { 186 186 struct bw2_par *par = (struct bw2_par *) info->par; 187 187
+2 -4
drivers/video/cg14.c
··· 32 32 unsigned, struct fb_info *); 33 33 34 34 static int cg14_mmap(struct fb_info *, struct file *, struct vm_area_struct *); 35 - static int cg14_ioctl(struct inode *, struct file *, unsigned int, 36 - unsigned long, struct fb_info *); 35 + static int cg14_ioctl(struct fb_info *, unsigned int, unsigned long); 37 36 static int cg14_pan_display(struct fb_var_screeninfo *, struct fb_info *); 38 37 39 38 /* ··· 276 277 par->iospace, vma); 277 278 } 278 279 279 - static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 280 - unsigned long arg, struct fb_info *info) 280 + static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 281 281 { 282 282 struct cg14_par *par = (struct cg14_par *) info->par; 283 283 struct cg14_regs __iomem *regs = par->regs;
+2 -4
drivers/video/cg3.c
··· 34 34 static int cg3_blank(int, struct fb_info *); 35 35 36 36 static int cg3_mmap(struct fb_info *, struct file *, struct vm_area_struct *); 37 - static int cg3_ioctl(struct inode *, struct file *, unsigned int, 38 - unsigned long, struct fb_info *); 37 + static int cg3_ioctl(struct fb_info *, unsigned int, unsigned long); 39 38 40 39 /* 41 40 * Frame buffer operations ··· 239 240 vma); 240 241 } 241 242 242 - static int cg3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 243 - unsigned long arg, struct fb_info *info) 243 + static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 244 244 { 245 245 struct cg3_par *par = (struct cg3_par *) info->par; 246 246
+2 -4
drivers/video/cg6.c
··· 37 37 static void cg6_fillrect(struct fb_info *, const struct fb_fillrect *); 38 38 static int cg6_sync(struct fb_info *); 39 39 static int cg6_mmap(struct fb_info *, struct file *, struct vm_area_struct *); 40 - static int cg6_ioctl(struct inode *, struct file *, unsigned int, 41 - unsigned long, struct fb_info *); 40 + static int cg6_ioctl(struct fb_info *, unsigned int, unsigned long); 42 41 43 42 /* 44 43 * Frame buffer operations ··· 533 534 vma); 534 535 } 535 536 536 - static int cg6_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 537 - unsigned long arg, struct fb_info *info) 537 + static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 538 538 { 539 539 struct cg6_par *par = (struct cg6_par *) info->par; 540 540
+2 -2
drivers/video/fbmem.c
··· 957 957 default: 958 958 if (fb->fb_ioctl == NULL) 959 959 return -EINVAL; 960 - return fb->fb_ioctl(inode, file, cmd, arg, info); 960 + return fb->fb_ioctl(info, cmd, arg); 961 961 } 962 962 } 963 963 ··· 1107 1107 1108 1108 default: 1109 1109 if (fb->fb_compat_ioctl) 1110 - ret = fb->fb_compat_ioctl(file, cmd, arg, info); 1110 + ret = fb->fb_compat_ioctl(info, cmd, arg); 1111 1111 break; 1112 1112 } 1113 1113 unlock_kernel();
+2 -4
drivers/video/ffb.c
··· 38 38 static void ffb_copyarea(struct fb_info *, const struct fb_copyarea *); 39 39 static int ffb_sync(struct fb_info *); 40 40 static int ffb_mmap(struct fb_info *, struct file *, struct vm_area_struct *); 41 - static int ffb_ioctl(struct inode *, struct file *, unsigned int, 42 - unsigned long, struct fb_info *); 41 + static int ffb_ioctl(struct fb_info *, unsigned int, unsigned long); 43 42 static int ffb_pan_display(struct fb_var_screeninfo *, struct fb_info *); 44 43 45 44 /* ··· 847 848 0, vma); 848 849 } 849 850 850 - static int ffb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 851 - unsigned long arg, struct fb_info *info) 851 + static int ffb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 852 852 { 853 853 struct ffb_par *par = (struct ffb_par *) info->par; 854 854
+1 -2
drivers/video/imsttfb.c
··· 1267 1267 #define FBIMSTT_GETIDXREG 0x545406 1268 1268 1269 1269 static int 1270 - imsttfb_ioctl(struct inode *inode, struct file *file, u_int cmd, 1271 - u_long arg, struct fb_info *info) 1270 + imsttfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) 1272 1271 { 1273 1272 struct imstt_par *par = info->par; 1274 1273 void __user *argp = (void __user *)arg;
+3 -5
drivers/video/intelfb/intelfbdrv.c
··· 157 157 158 158 static int intelfb_sync(struct fb_info *info); 159 159 160 - static int intelfb_ioctl(struct inode *inode, struct file *file, 161 - unsigned int cmd, unsigned long arg, 162 - struct fb_info *info); 160 + static int intelfb_ioctl(struct fb_info *info, 161 + unsigned int cmd, unsigned long arg); 163 162 164 163 static int __devinit intelfb_pci_register(struct pci_dev *pdev, 165 164 const struct pci_device_id *ent); ··· 1379 1380 1380 1381 /* When/if we have our own ioctls. */ 1381 1382 static int 1382 - intelfb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 1383 - unsigned long arg, struct fb_info *info) 1383 + intelfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 1384 1384 { 1385 1385 int retval = 0; 1386 1386
+2 -3
drivers/video/kyro/fbdev.c
··· 586 586 } 587 587 #endif 588 588 589 - static int kyrofb_ioctl(struct inode *inode, struct file *file, 590 - unsigned int cmd, unsigned long arg, 591 - struct fb_info *info) 589 + static int kyrofb_ioctl(struct fb_info *info, 590 + unsigned int cmd, unsigned long arg) 592 591 { 593 592 overlay_create ol_create; 594 593 overlay_viewport_set ol_viewport_set;
+2 -4
drivers/video/leo.c
··· 33 33 static int leo_blank(int, struct fb_info *); 34 34 35 35 static int leo_mmap(struct fb_info *, struct file *, struct vm_area_struct *); 36 - static int leo_ioctl(struct inode *, struct file *, unsigned int, 37 - unsigned long, struct fb_info *); 36 + static int leo_ioctl(struct fb_info *, unsigned int, unsigned long); 38 37 static int leo_pan_display(struct fb_var_screeninfo *, struct fb_info *); 39 38 40 39 /* ··· 372 373 vma); 373 374 } 374 375 375 - static int leo_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 376 - unsigned long arg, struct fb_info *info) 376 + static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 377 377 { 378 378 struct leo_par *par = (struct leo_par *) info->par; 379 379
+2 -3
drivers/video/matrox/matroxfb_base.c
··· 865 865 .name = "Panellink output", 866 866 }; 867 867 868 - static int matroxfb_ioctl(struct inode *inode, struct file *file, 869 - unsigned int cmd, unsigned long arg, 870 - struct fb_info *info) 868 + static int matroxfb_ioctl(struct fb_info *info, 869 + unsigned int cmd, unsigned long arg) 871 870 { 872 871 void __user *argp = (void __user *)arg; 873 872 MINFO_FROM_INFO(info);
+4 -5
drivers/video/matrox/matroxfb_crtc2.c
··· 419 419 return 0; 420 420 } 421 421 422 - static int matroxfb_dh_ioctl(struct inode* inode, 423 - struct file* file, 422 + static int matroxfb_dh_ioctl(struct fb_info *info, 424 423 unsigned int cmd, 425 - unsigned long arg, 426 - struct fb_info* info) { 424 + unsigned long arg) 425 + { 427 426 #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) 428 427 MINFO_FROM(m2info->primary_dev); 429 428 ··· 456 457 case MATROXFB_GET_OUTPUT_MODE: 457 458 case MATROXFB_GET_ALL_OUTPUTS: 458 459 { 459 - return ACCESS_FBINFO(fbcon.fbops)->fb_ioctl(inode, file, cmd, arg, &ACCESS_FBINFO(fbcon)); 460 + return ACCESS_FBINFO(fbcon.fbops)->fb_ioctl(&ACCESS_FBINFO(fbcon), cmd, arg); 460 461 } 461 462 case MATROXFB_SET_OUTPUT_CONNECTION: 462 463 {
+3 -4
drivers/video/p9100.c
··· 32 32 static int p9100_blank(int, struct fb_info *); 33 33 34 34 static int p9100_mmap(struct fb_info *, struct file *, struct vm_area_struct *); 35 - static int p9100_ioctl(struct inode *, struct file *, unsigned int, 36 - unsigned long, struct fb_info *); 35 + static int p9100_ioctl(struct fb_info *, unsigned int, unsigned long); 37 36 38 37 /* 39 38 * Frame buffer operations ··· 231 232 vma); 232 233 } 233 234 234 - static int p9100_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 235 - unsigned long arg, struct fb_info *info) 235 + static int p9100_ioctl(struct fb_info *info, unsigned int cmd, 236 + unsigned long arg) 236 237 { 237 238 struct p9100_par *par = (struct p9100_par *) info->par; 238 239
+2 -6
drivers/video/pm3fb.c
··· 657 657 static void pm3fb_detect(void); 658 658 static int pm3fb_pan_display(const struct fb_var_screeninfo *var, 659 659 struct fb_info_gen *info); 660 - static int pm3fb_ioctl(struct inode *inode, struct file *file, 661 - u_int cmd, u_long arg, int con, 662 - struct fb_info *info); 660 + static int pm3fb_ioctl(struct fb_info *info, u_int cmd, u_long arg); 663 661 664 662 665 663 /* the struct that hold them together */ ··· 3436 3438 return 0; 3437 3439 } 3438 3440 3439 - static int pm3fb_ioctl(struct inode *inode, struct file *file, 3440 - u_int cmd, u_long arg, int con, 3441 - struct fb_info *info) 3441 + static int pm3fb_ioctl(struct fb_info *info, u_int cmd, u_long arg) 3442 3442 { 3443 3443 struct pm3fb_info *l_fb_info = (struct pm3fb_info *) info; 3444 3444 u32 cm, i;
+1 -2
drivers/video/pmag-aa-fb.c
··· 299 299 return -EINVAL; 300 300 } 301 301 302 - static int aafb_ioctl(struct inode *inode, struct file *file, u32 cmd, 303 - unsigned long arg, int con, struct fb_info *info) 302 + static int aafb_ioctl(struct fb_info *info, u32 cmd, unsigned long arg) 304 303 { 305 304 /* TODO: Not yet implemented */ 306 305 return -ENOIOCTLCMD;
+2 -2
drivers/video/radeonfb.c
··· 1497 1497 } 1498 1498 1499 1499 1500 - static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int cmd, 1501 - unsigned long arg, struct fb_info *info) 1500 + static int radeonfb_ioctl (struct fb_info *info, unsigned int cmd, 1501 + unsigned long arg) 1502 1502 { 1503 1503 struct radeonfb_info *rinfo = (struct radeonfb_info *) info; 1504 1504 unsigned int tmp;
+8 -20
drivers/video/sis/sis_main.c
··· 1743 1743 1744 1744 /* ----------- FBDev related routines for all series ---------- */ 1745 1745 1746 - static int 1747 - sisfb_ioctl(struct inode *inode, struct file *file, 1748 - unsigned int cmd, unsigned long arg, 1749 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1750 - int con, 1746 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) 1747 + static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, 1748 + unsigned long arg) 1749 + #else 1750 + static int sisfb_ioctl(struct inode *inode, struct file *file, 1751 + unsigned int cmd, unsigned long arg, 1752 + struct fb_info *info) 1751 1753 #endif 1752 - struct fb_info *info) 1753 1754 { 1754 1755 struct sis_video_info *ivideo = (struct sis_video_info *)info->par; 1755 1756 struct sis_memreq sismemreq; ··· 1925 1924 return 0; 1926 1925 } 1927 1926 1928 - #ifdef SIS_NEW_CONFIG_COMPAT 1929 - static long 1930 - sisfb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg, struct fb_info *info) 1931 - { 1932 - int ret; 1933 - 1934 - lock_kernel(); 1935 - ret = sisfb_ioctl(NULL, f, cmd, arg, info); 1936 - unlock_kernel(); 1937 - return ret; 1938 - } 1939 - #endif 1940 - 1941 1927 static int 1942 1928 sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info) 1943 1929 { ··· 1995 2007 #endif 1996 2008 .fb_sync = fbcon_sis_sync, 1997 2009 #ifdef SIS_NEW_CONFIG_COMPAT 1998 - .fb_compat_ioctl= sisfb_compat_ioctl, 2010 + .fb_compat_ioctl= sisfb_ioctl, 1999 2011 #endif 2000 2012 .fb_ioctl = sisfb_ioctl 2001 2013 };
+5
drivers/video/sis/sis_main.h
··· 727 727 #endif 728 728 729 729 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) 730 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) 731 + static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, 732 + unsigned long arg); 733 + #else 730 734 static int sisfb_ioctl(struct inode *inode, struct file *file, 731 735 unsigned int cmd, unsigned long arg, 732 736 struct fb_info *info); 737 + #endif 733 738 static int sisfb_set_par(struct fb_info *info); 734 739 static int sisfb_blank(int blank, 735 740 struct fb_info *info);
+1 -2
drivers/video/sstfb.c
··· 771 771 return 0; 772 772 } 773 773 774 - static int sstfb_ioctl(struct inode *inode, struct file *file, 775 - u_int cmd, u_long arg, struct fb_info *info ) 774 + static int sstfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) 776 775 { 777 776 struct sstfb_par *par = info->par; 778 777 struct pci_dev *sst_dev = par->dev;
+3 -4
drivers/video/tcx.c
··· 34 34 static int tcx_blank(int, struct fb_info *); 35 35 36 36 static int tcx_mmap(struct fb_info *, struct file *, struct vm_area_struct *); 37 - static int tcx_ioctl(struct inode *, struct file *, unsigned int, 38 - unsigned long, struct fb_info *); 37 + static int tcx_ioctl(struct fb_info *, unsigned int, unsigned long); 39 38 static int tcx_pan_display(struct fb_var_screeninfo *, struct fb_info *); 40 39 41 40 /* ··· 311 312 vma); 312 313 } 313 314 314 - static int tcx_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 315 - unsigned long arg, struct fb_info *info) 315 + static int tcx_ioctl(struct fb_info *info, unsigned int cmd, 316 + unsigned long arg) 316 317 { 317 318 struct tcx_par *par = (struct tcx_par *) info->par; 318 319
+4 -4
include/linux/fb.h
··· 608 608 int (*fb_sync)(struct fb_info *info); 609 609 610 610 /* perform fb specific ioctl (optional) */ 611 - int (*fb_ioctl)(struct inode *inode, struct file *file, unsigned int cmd, 612 - unsigned long arg, struct fb_info *info); 611 + int (*fb_ioctl)(struct fb_info *info, unsigned int cmd, 612 + unsigned long arg); 613 613 614 614 /* Handle 32bit compat ioctl (optional) */ 615 - long (*fb_compat_ioctl)(struct file *f, unsigned cmd, unsigned long arg, 616 - struct fb_info *info); 615 + int (*fb_compat_ioctl)(struct fb_info *info, unsigned cmd, 616 + unsigned long arg); 617 617 618 618 /* perform fb specific mmap */ 619 619 int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);