ion_test: Add compat_ioctl support (v2)
authorJohn Stultz <john.stultz@linaro.org>
Thu, 19 Dec 2013 23:56:23 +0000 (15:56 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Dec 2013 00:10:25 +0000 (16:10 -0800)
Prior to subitting this, Colin reworked the compat_ioctl support
for the ion_test driver, moving the structure to be the same size
on both 32 and 64 bit architectures.

Two small things were left out. The compat_ioctl ptr assignment,
and the fact that despite having uniform sized types in the
structure, the structure pads out to different sizes on different
arches.

This patch resolves this issue by adding a padding entry after
the write flag, and adding the compat_ioctl ptr.

Changes in v2:
- Add a padding int rather then making write a u64

Acked-by: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ion/ion_test.c
drivers/staging/android/uapi/ion_test.h

index 3e20349baf7cb215ec445255912f659a46dc0ea1..654acb5c8eba12f11b53bfb9ab8602aef9830440 100644 (file)
@@ -231,6 +231,7 @@ static int ion_test_release(struct inode *inode, struct file *file)
 static const struct file_operations ion_test_fops = {
        .owner = THIS_MODULE,
        .unlocked_ioctl = ion_test_ioctl,
+       .compat_ioctl = ion_test_ioctl,
        .open = ion_test_open,
        .release = ion_test_release,
 };
index 614d1e36f72ce89a793e7658b71b87969885b44d..ffef06f63133fb874e38c1445947a1b35175dd75 100644 (file)
@@ -32,6 +32,7 @@ struct ion_test_rw_data {
        __u64 offset;
        __u64 size;
        int write;
+       int __padding;
 };
 
 #define ION_IOC_MAGIC          'I'