Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ion_test: Add compat_ioctl support (v2)

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>

authored by

John Stultz and committed by
Greg Kroah-Hartman
07300f43 364014fd

+2
+1
drivers/staging/android/ion/ion_test.c
··· 231 231 static const struct file_operations ion_test_fops = { 232 232 .owner = THIS_MODULE, 233 233 .unlocked_ioctl = ion_test_ioctl, 234 + .compat_ioctl = ion_test_ioctl, 234 235 .open = ion_test_open, 235 236 .release = ion_test_release, 236 237 };
+1
drivers/staging/android/uapi/ion_test.h
··· 32 32 __u64 offset; 33 33 __u64 size; 34 34 int write; 35 + int __padding; 35 36 }; 36 37 37 38 #define ION_IOC_MAGIC 'I'