All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] hidraw: compat_ioctl for hidraw
@ 2011-01-04  5:37 Alan Ott
  2011-01-04  5:37 ` [PATCH 1/1] hidraw: Added Compatibility ioctl() for 32-bit applications Alan Ott
  2011-01-04  5:37 ` Alan Ott
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Ott @ 2011-01-04  5:37 UTC (permalink / raw)
  To: Jiri Kosina, Stefan Achatz, Antonio Ospite, Tejun Heo,
	Marcel Holtmann, linux-input, linux-kernel
  Cc: Alan Ott

hidraw did not have a compat_ioctl set, causing ioctls to fail from 32-bit apps on 64-bit systems. This patch seems to make ioctls work from 32-bit apps.

I made this look like the one in drivers/input/joydev.c. I'm not 100% sure that this is all that needs to be done, so it'd be nice if someone could review it.

Alan Ott (1):
  hidraw: Added Compatibility ioctl() for 32-bit applications.

 drivers/hid/hidraw.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] hidraw: Added Compatibility ioctl() for 32-bit applications.
  2011-01-04  5:37 [PATCH 0/1] hidraw: compat_ioctl for hidraw Alan Ott
@ 2011-01-04  5:37 ` Alan Ott
  2011-01-04  5:37 ` Alan Ott
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Ott @ 2011-01-04  5:37 UTC (permalink / raw)
  To: Jiri Kosina, Stefan Achatz, Antonio Ospite, Tejun Heo,
	Marcel Holtmann
  Cc: Alan Ott

Added the ioctl function to the compat_ioctl pointer in the file_operations struct. Before this, some ioctls would fail for 32-bit apps on 64-bit systems.

Signed-off-by: Alan Ott <alan@signal11.us>
---
 drivers/hid/hidraw.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 29495e6..57ccc5f 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -428,6 +428,9 @@ static const struct file_operations hidraw_ops = {
 	.open =         hidraw_open,
 	.release =      hidraw_release,
 	.unlocked_ioctl = hidraw_ioctl,
+#ifdef CONFIG_COMPAT
+	.compat_ioctl	= hidraw_ioctl,
+#endif
 };
 
 void hidraw_report_event(struct hid_device *hid, u8 *data, int len)
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/1] hidraw: Added Compatibility ioctl() for 32-bit applications.
  2011-01-04  5:37 [PATCH 0/1] hidraw: compat_ioctl for hidraw Alan Ott
  2011-01-04  5:37 ` [PATCH 1/1] hidraw: Added Compatibility ioctl() for 32-bit applications Alan Ott
@ 2011-01-04  5:37 ` Alan Ott
  2011-01-04 10:18   ` Arnd Bergmann
  1 sibling, 1 reply; 5+ messages in thread
From: Alan Ott @ 2011-01-04  5:37 UTC (permalink / raw)
  To: Jiri Kosina, Stefan Achatz, Antonio Ospite, Tejun Heo,
	Marcel Holtmann, linux-input, linux-kernel
  Cc: Alan Ott

Added the ioctl function to the compat_ioctl pointer in the file_operations struct. Before this, some ioctls would fail for 32-bit apps on 64-bit systems.

Signed-off-by: Alan Ott <alan@signal11.us>
---
 drivers/hid/hidraw.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 29495e6..57ccc5f 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -428,6 +428,9 @@ static const struct file_operations hidraw_ops = {
 	.open =         hidraw_open,
 	.release =      hidraw_release,
 	.unlocked_ioctl = hidraw_ioctl,
+#ifdef CONFIG_COMPAT
+	.compat_ioctl	= hidraw_ioctl,
+#endif
 };
 
 void hidraw_report_event(struct hid_device *hid, u8 *data, int len)
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] hidraw: Added Compatibility ioctl() for 32-bit applications.
  2011-01-04  5:37 ` Alan Ott
@ 2011-01-04 10:18   ` Arnd Bergmann
  2011-01-04 10:25     ` Jiri Kosina
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2011-01-04 10:18 UTC (permalink / raw)
  To: Alan Ott
  Cc: Jiri Kosina, Stefan Achatz, Antonio Ospite, Tejun Heo,
	Marcel Holtmann, linux-input, linux-kernel

On Tuesday 04 January 2011 06:37:22 Alan Ott wrote:
> Added the ioctl function to the compat_ioctl pointer in the
> file_operations struct. Before this, some ioctls would 
> fail for 32-bit apps on 64-bit systems.
> 
> Signed-off-by: Alan Ott <alan@signal11.us>

Acked-by: Arnd Bergmann <arnd@arndb.de>

I verified that all the ioctls for hidraw are indeed compatible.

	Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] hidraw: Added Compatibility ioctl() for 32-bit applications.
  2011-01-04 10:18   ` Arnd Bergmann
@ 2011-01-04 10:25     ` Jiri Kosina
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2011-01-04 10:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alan Ott, Stefan Achatz, Antonio Ospite, Tejun Heo,
	Marcel Holtmann, linux-input, linux-kernel

On Tue, 4 Jan 2011, Arnd Bergmann wrote:

> On Tuesday 04 January 2011 06:37:22 Alan Ott wrote:
> > Added the ioctl function to the compat_ioctl pointer in the
> > file_operations struct. Before this, some ioctls would 
> > fail for 32-bit apps on 64-bit systems.
> > 
> > Signed-off-by: Alan Ott <alan@signal11.us>
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks guys.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-04 10:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-04  5:37 [PATCH 0/1] hidraw: compat_ioctl for hidraw Alan Ott
2011-01-04  5:37 ` [PATCH 1/1] hidraw: Added Compatibility ioctl() for 32-bit applications Alan Ott
2011-01-04  5:37 ` Alan Ott
2011-01-04 10:18   ` Arnd Bergmann
2011-01-04 10:25     ` Jiri Kosina

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.