From: Arnd Bergmann <arnd@arndb.de>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Philip Langdale <philipl@overt.org>,
Jiri Kosina <jkosina@suse.cz>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] hiddev: simplify 32bit ioctl compatibilty
Date: Sat, 20 Oct 2007 18:03:35 +0200 [thread overview]
Message-ID: <200710201803.36478.arnd@arndb.de> (raw)
In-Reply-To: <200710201750.58521.arnd@arndb.de>
hiddev has both entries in fs/compat_ioctl.c and its own
compat_ioctl() handler. Remove both and use the new generic_compat_ioctl
helper instead.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-2.6/drivers/hid/hidraw.c
===================================================================
--- linux-2.6.orig/drivers/hid/hidraw.c
+++ linux-2.6/drivers/hid/hidraw.c
@@ -268,6 +268,7 @@ static const struct file_operations hidr
.open = hidraw_open,
.release = hidraw_release,
.ioctl = hidraw_ioctl,
+ .compat_ioctl = generic_compat_ioctl,
};
void hidraw_report_event(struct hid_device *hid, u8 *data, int len)
Index: linux-2.6/drivers/hid/usbhid/hiddev.c
===================================================================
--- linux-2.6.orig/drivers/hid/usbhid/hiddev.c
+++ linux-2.6/drivers/hid/usbhid/hiddev.c
@@ -739,14 +739,6 @@ inval:
return -EINVAL;
}
-#ifdef CONFIG_COMPAT
-static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-{
- struct inode *inode = file->f_path.dentry->d_inode;
- return hiddev_ioctl(inode, file, cmd, compat_ptr(arg));
-}
-#endif
-
static const struct file_operations hiddev_fops = {
.owner = THIS_MODULE,
.read = hiddev_read,
@@ -756,9 +748,7 @@ static const struct file_operations hidd
.release = hiddev_release,
.ioctl = hiddev_ioctl,
.fasync = hiddev_fasync,
-#ifdef CONFIG_COMPAT
- .compat_ioctl = hiddev_compat_ioctl,
-#endif
+ .compat_ioctl = generic_compat_ioctl,
};
static struct usb_class_driver hiddev_class = {
Index: linux-2.6/fs/compat_ioctl.c
===================================================================
--- linux-2.6.orig/fs/compat_ioctl.c
+++ linux-2.6/fs/compat_ioctl.c
@@ -102,8 +102,6 @@
#include <linux/filter.h>
#include <linux/pktcdvd.h>
-#include <linux/hiddev.h>
-
#include <linux/dvb/audio.h>
#include <linux/dvb/dmx.h>
#include <linux/dvb/frontend.h>
@@ -2575,23 +2573,6 @@ COMPATIBLE_IOCTL(SIOCSIWPOWER)
COMPATIBLE_IOCTL(SIOCGIWPOWER)
COMPATIBLE_IOCTL(SIOCSIWAUTH)
COMPATIBLE_IOCTL(SIOCGIWAUTH)
-/* hiddev */
-COMPATIBLE_IOCTL(HIDIOCGVERSION)
-COMPATIBLE_IOCTL(HIDIOCAPPLICATION)
-COMPATIBLE_IOCTL(HIDIOCGDEVINFO)
-COMPATIBLE_IOCTL(HIDIOCGSTRING)
-COMPATIBLE_IOCTL(HIDIOCINITREPORT)
-COMPATIBLE_IOCTL(HIDIOCGREPORT)
-COMPATIBLE_IOCTL(HIDIOCSREPORT)
-COMPATIBLE_IOCTL(HIDIOCGREPORTINFO)
-COMPATIBLE_IOCTL(HIDIOCGFIELDINFO)
-COMPATIBLE_IOCTL(HIDIOCGUSAGE)
-COMPATIBLE_IOCTL(HIDIOCSUSAGE)
-COMPATIBLE_IOCTL(HIDIOCGUCODE)
-COMPATIBLE_IOCTL(HIDIOCGFLAG)
-COMPATIBLE_IOCTL(HIDIOCSFLAG)
-COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX)
-COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO)
/* dvb */
COMPATIBLE_IOCTL(AUDIO_STOP)
COMPATIBLE_IOCTL(AUDIO_PLAY)
next prev parent reply other threads:[~2007-10-20 16:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 23:51 [PATCH] hiddev: Add 32bit ioctl compatibilty Philip Langdale
2007-10-13 0:02 ` Al Viro
2007-10-13 17:42 ` Philip Langdale
2007-10-20 15:50 ` [PATCH] compat_ioctl: introduce generic_compat_ioctl helper Arnd Bergmann
2007-10-20 16:03 ` Arnd Bergmann [this message]
2007-10-20 16:11 ` Christoph Hellwig
2007-10-20 16:23 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200710201803.36478.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=philipl@overt.org \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.