From 61e7f08f06dbd4dec52c60ff85d1df516e3ab29c Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Mon, 12 Jul 2004 21:01:35 -0700 Subject: [PATCH] sparse: drivers/sbus fixes a) vfc is not 64bit-clean, marked as such in Kconfig b) aurora is simply broken - still uses tqueues. Marked as broken. c) vfc does dereferencing of userland pointer, right after having carefully copied the data to kernel space ;-) Fixed. d) vfc ->mmap() had missed prototype change. Fixed. e) BPP ioctls are misdeclared - they should've been _IO(...) instead of _IOR(..., void). Too late to fix, but we can at least make them _IOR(..., char) - same value, but doesn't try to find sizeof(void). --- drivers/sbus/char/Kconfig | 4 ++-- drivers/sbus/char/vfc_dev.c | 7 +++---- include/asm-sparc/bpp.h | 4 ++-- include/asm-sparc64/bpp.h | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/sbus/char/Kconfig b/drivers/sbus/char/Kconfig index bba1c80dba48..90d8ef1f0bcc 100644 --- a/drivers/sbus/char/Kconfig +++ b/drivers/sbus/char/Kconfig @@ -39,7 +39,7 @@ config SUN_BPP config SUN_VIDEOPIX tristate "Videopix Frame Grabber (EXPERIMENTAL)" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && (BROKEN || !64BIT) help Say Y here to support the Videopix Frame Grabber from Sun Microsystems, commonly found on SPARCstations. This card, which is @@ -48,7 +48,7 @@ config SUN_VIDEOPIX config SUN_AURORA tristate "Aurora Multiboard 1600se (EXPERIMENTAL)" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && BROKEN help The Aurora Multiboard is a multi-port high-speed serial controller. If you have one of these, say Y. diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 87d992820bc0..6d3195b67b59 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c @@ -253,7 +253,7 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, unsigned long arg) vfc_lock_device(dev); inout.ret= vfc_i2c_sendbuf(dev,inout.addr & 0xff, - inout.buffer,inout.len); + buffer,inout.len); if (copy_to_user((void *)arg,&inout,sizeof(inout))) { kfree(buffer); @@ -611,13 +611,12 @@ static int vfc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, return ret; } -static int vfc_mmap(struct inode *inode, struct file *file, - struct vm_area_struct *vma) +static int vfc_mmap(struct file *file, struct vm_area_struct *vma) { unsigned int map_size, ret, map_offset; struct vfc_dev *dev; - dev = vfc_get_dev_ptr(iminor(inode)); + dev = vfc_get_dev_ptr(iminor(file->f_dentry->d_inode)); if(dev == NULL) return -ENODEV; diff --git a/include/asm-sparc/bpp.h b/include/asm-sparc/bpp.h index ad4a8457161e..3578ac113cf0 100644 --- a/include/asm-sparc/bpp.h +++ b/include/asm-sparc/bpp.h @@ -40,9 +40,9 @@ */ # define BPP_PUT_PINS _IOW('B', 1, int) -# define BPP_GET_PINS _IOR('B', 2, void) +# define BPP_GET_PINS _IOR('B', 2, char) /* that's bogus - should've been _IO */ # define BPP_PUT_DATA _IOW('B', 3, int) -# define BPP_GET_DATA _IOR('B', 4, void) +# define BPP_GET_DATA _IOR('B', 4, char) /* ditto */ /* * Set the data bus to input mode. Disengage the data bin driver and diff --git a/include/asm-sparc64/bpp.h b/include/asm-sparc64/bpp.h index 9b12a088a60a..abe163a50382 100644 --- a/include/asm-sparc64/bpp.h +++ b/include/asm-sparc64/bpp.h @@ -40,9 +40,9 @@ */ # define BPP_PUT_PINS _IOW('B', 1, int) -# define BPP_GET_PINS _IOR('B', 2, void) +# define BPP_GET_PINS _IOR('B', 2, char) /* that's bogus - should've been _IO */ # define BPP_PUT_DATA _IOW('B', 3, int) -# define BPP_GET_DATA _IOR('B', 4, void) +# define BPP_GET_DATA _IOR('B', 4, char) /* ditto */ /* * Set the data bus to input mode. Disengage the data bin driver and -- cgit v1.2.3