diff options
| author | Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk> | 2004-07-12 21:01:35 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-12 21:01:35 -0700 |
| commit | 61e7f08f06dbd4dec52c60ff85d1df516e3ab29c (patch) | |
| tree | 3080aeb8b591af27fcfea4273d0a577ea2c5d8e6 | |
| parent | d10a605b10cc3dd01847dcf24f63b8c942a7bc2e (diff) | |
[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).
| -rw-r--r-- | drivers/sbus/char/Kconfig | 4 | ||||
| -rw-r--r-- | drivers/sbus/char/vfc_dev.c | 7 | ||||
| -rw-r--r-- | include/asm-sparc/bpp.h | 4 | ||||
| -rw-r--r-- | 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 |
