From: Aiyoujun <ayj@rock-chips.com>
Date: Sat, 11 Apr 2015 08:04:31 +0000 (+0800)
Subject: usb: ftp: fix the bug of ftp ioctrl args problem with 32bit userspace on 64bit platforms
X-Git-Tag: firefly_0821_release~4158^2~217
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c04cdecff9f7283308b286e1bc1dbf0edfe4453b;p=firefly-linux-kernel-4.4.55.git

usb: ftp: fix the bug of ftp ioctrl args problem with 32bit userspace on 64bit platforms

Signed-off-by: Aiyoujun <ayj@rock-chips.com>
---

diff --git a/include/uapi/linux/usb/f_mtp.h b/include/uapi/linux/usb/f_mtp.h
index 503291855abd..9a08c643ae20 100644
--- a/include/uapi/linux/usb/f_mtp.h
+++ b/include/uapi/linux/usb/f_mtp.h
@@ -38,12 +38,22 @@ struct mtp_file_range {
 	uint32_t	transaction_id;
 };
 
+/* support of 32bit userspace on 64bit platforms */
+#ifdef CONFIG_COMPAT
+struct mtp_event {
+	/* size of the event */
+	int32_t		length;
+	/* event data to send */
+	compat_uptr_t		data;
+};
+#else
 struct mtp_event {
 	/* size of the event */
 	size_t		length;
 	/* event data to send */
 	void		*data;
 };
+#endif
 
 /* Sends the specified file range to the host */
 #define MTP_SEND_FILE              _IOW('M', 0, struct mtp_file_range)