From bd8c6ee428efa388f2ef1d6c1a42dde0c21bbb51 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Fri, 3 Jan 2003 17:16:42 +0000 Subject: Build fixes for 2.5.x, thank Gregoire Favre for pointing out these flaws regularly... Changes in detail: - added comapt.[ch] again, but removed the *_usercopy() crap. We define dvb_usercopy() until generic_usercopy() is available. If you have an external source tree, please check what's actually needed to get your application to compile and report back to me or on the mailing list. Thanks! (Necessary changes to the Makefile, and various dvb files, removed some unnecessary #include ) - added linux/lib/Makefile. We need to add an include to drivers/media/dvb/dvb-core/Makefile.lib, so that crc32.o gets build automagically (Adjusted the "makelinks" script as well) --- linux/drivers/media/dvb/dvb-core/dvbdev.c | 64 +------------------------------ 1 file changed, 1 insertion(+), 63 deletions(-) (limited to 'linux/drivers/media/dvb/dvb-core/dvbdev.c') diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index c6b39b66e..e858b3945 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -37,9 +37,9 @@ #include #include #include -#include #include "dvbdev.h" +#include "compat.h" static int dvbdev_debug = 0; #define dprintk if (dvbdev_debug) printk @@ -67,68 +67,6 @@ static char *dnames[] = { #define nums2minor(num,type,id) ((num << 6) | (id << 4) | type) #define DVB_DEVFS_FLAGS (DEVFS_FL_DEFAULT) -/* this is the same as video_usercopy() and should be replaced as - discussed already with something like generic_usercopy() */ -int dvb_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)) -{ - char sbuf[128]; - void *mbuf = NULL; - void *parg = NULL; - int err = -EINVAL; - - /* Copy arguments into temp kernel buffer */ - switch (_IOC_DIR(cmd)) { - case _IOC_NONE: - parg = (void *)arg; - break; - case _IOC_READ: /* some v4l ioctls are marked wrong ... */ - case _IOC_WRITE: - case (_IOC_WRITE | _IOC_READ): - if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { - parg = sbuf; - } else { - /* too big to allocate from stack */ - mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); - if (NULL == mbuf) - return -ENOMEM; - parg = mbuf; - } - - err = -EFAULT; - if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd))) - goto out; - break; - } - - /* call driver */ - if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) - err = -EINVAL; - - if (err < 0) - goto out; - - /* Copy results into user buffer */ - switch (_IOC_DIR(cmd)) - { - case _IOC_READ: - case (_IOC_WRITE | _IOC_READ): - if (copy_to_user((void *)arg, parg, _IOC_SIZE(cmd))) - err = -EFAULT; - break; - } - -out: - if (mbuf) - kfree(mbuf); - - return err; -} - - - static struct dvb_device* dvbdev_find_device (int minor) { -- cgit v1.2.3