Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (9331): Remove unused inode parameter from video_ioctl2

inode is never used on video_ioctl2. Remove it and rename the function to
__video_ioctl2. This allows its usage directly as a callback at
fops.unlocked_ioctl.

Since we still need a callback with inode to be used with fops.ioctl,
this patch adds video_ioctl2() that is just a call to __video_ioctl2().

Also, this patch adds some comments about video_ioctl2 and __video_ioctl2
usage at v4l2-ioctl.h.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

+22 -12
+1 -1
drivers/media/video/ivtv/ivtv-ioctl.c
··· 1830 1830 1831 1831 if (ivtv_debug & IVTV_DBGFLG_IOCTL) 1832 1832 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; 1833 - ret = video_ioctl2_unlocked(filp, cmd, arg); 1833 + ret = __video_ioctl2(filp, cmd, arg); 1834 1834 vfd->debug = 0; 1835 1835 return ret; 1836 1836 }
+6 -6
drivers/media/video/v4l2-ioctl.c
··· 1768 1768 return ret; 1769 1769 } 1770 1770 1771 - int video_ioctl2(struct inode *inode, struct file *file, 1771 + int __video_ioctl2(struct file *file, 1772 1772 unsigned int cmd, unsigned long arg) 1773 1773 { 1774 1774 char sbuf[128]; ··· 1860 1860 kfree(mbuf); 1861 1861 return err; 1862 1862 } 1863 - EXPORT_SYMBOL(video_ioctl2); 1863 + EXPORT_SYMBOL(__video_ioctl2); 1864 1864 1865 - long video_ioctl2_unlocked(struct file *file, 1866 - unsigned int cmd, unsigned long arg) 1865 + int video_ioctl2(struct inode *inode, struct file *file, 1866 + unsigned int cmd, unsigned long arg) 1867 1867 { 1868 - return video_ioctl2(file->f_path.dentry->d_inode, file, cmd, arg); 1868 + return __video_ioctl2(file, cmd, arg); 1869 1869 } 1870 - EXPORT_SYMBOL(video_ioctl2_unlocked); 1870 + EXPORT_SYMBOL(video_ioctl2);
+15 -5
include/media/v4l2-ioctl.h
··· 284 284 extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, 285 285 unsigned long arg); 286 286 287 - extern int video_ioctl2(struct inode *inode, struct file *file, 288 - unsigned int cmd, unsigned long arg); 289 - extern long video_ioctl2_unlocked(struct file *file, 290 - unsigned int cmd, unsigned long arg); 291 - 292 287 /* Include support for obsoleted stuff */ 293 288 extern int video_usercopy(struct inode *inode, struct file *file, 294 289 unsigned int cmd, unsigned long arg, 295 290 int (*func)(struct inode *inode, struct file *file, 296 291 unsigned int cmd, void *arg)); 292 + 293 + /* Standard handlers for V4L ioctl's */ 294 + 295 + /* This prototype is used on fops.unlocked_ioctl */ 296 + extern int __video_ioctl2(struct file *file, 297 + unsigned int cmd, unsigned long arg); 298 + 299 + /* This prototype is used on fops.ioctl 300 + * Since fops.ioctl enables Kernel Big Lock, it is preferred 301 + * to use __video_ioctl2 instead. 302 + * It should be noticed that there's no lock code inside 303 + * video_ioctl2(). 304 + */ 305 + extern int video_ioctl2(struct inode *inode, struct file *file, 306 + unsigned int cmd, unsigned long arg); 297 307 298 308 #endif /* _V4L2_IOCTL_H */