From 7d88c72f4ad7a6c1b1a0a5e927726fbe1ef52224 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 7 Nov 2007 17:18:57 +0000 Subject: [PATCH] Fix for 2.6.10 and earlier. Rename comedi_compat_ioctl function to comedi_compat_ioctl_ and define comedi_compat_ioctl macro to access it. The comedi_compat_ioctl macro expands to 0 for 2.6.10 and earlier (HAVE_COMPAT_IOCTL undefined) so it tried to define a function called '0'! --- comedi/comedi_compat32.c | 6 ++++-- comedi/comedi_compat32.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/comedi/comedi_compat32.c b/comedi/comedi_compat32.c index 995371a2..ac3c60ff 100644 --- a/comedi/comedi_compat32.c +++ b/comedi/comedi_compat32.c @@ -428,7 +428,9 @@ static int compat_insn(struct file *file, unsigned long arg) return translated_ioctl(file, COMEDI_INSN, (unsigned long)insn); } -long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +/* compat_ioctl file operation. */ +long comedi_compat_ioctl_(struct file *file, unsigned int cmd, + unsigned long arg) { int rc; @@ -495,7 +497,7 @@ static int mapped_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, if (imajor(file->f_dentry->d_inode) != COMEDI_MAJOR) { return -ENOTTY; } - rc = (int)comedi_compat_ioctl(file, cmd, arg); + rc = (int)comedi_compat_ioctl_(file, cmd, arg); if (rc == -ENOIOCTLCMD) { rc = -ENOTTY; } diff --git a/comedi/comedi_compat32.h b/comedi/comedi_compat32.h index 198aea54..8f556ee8 100644 --- a/comedi/comedi_compat32.h +++ b/comedi/comedi_compat32.h @@ -34,8 +34,9 @@ #ifdef HAVE_COMPAT_IOCTL -extern long comedi_compat_ioctl(struct file *file, unsigned int cmd, +extern long comedi_compat_ioctl_(struct file *file, unsigned int cmd, unsigned long arg); +#define comedi_compat_ioctl comedi_compat_ioctl_ #define comedi_register_ioctl32() do{}while(0) #define comedi_unregister_ioctl32() do{}while(0) -- 2.26.2