CHROMIUM: virtwl: check for CONFIG_COMPAT before defining compat ioctl
The virtio_wl driver will not compile if COMPAT is not enabled, in which
case we get the following error:
drivers/virtio/virtio_wl.c: In function 'virtwl_ioctl_compat':
drivers/virtio/virtio_wl.c:1042:37: error:
implicit declaration of function 'compat_ptr'; did you mean 'do_set_pte'?
This change guards the code that requires COMPAT with some ifdefs.
TEST=virtio_wl.c compiles
BUG=None
Change-Id: I6ebd15522ff698cceb67b8f79c54a021f298bc75
Signed-off-by: Zach Reizner <zachr@google.com>
Reviewed-on: https://chromium-review.googlesource.com/919828
Commit-Ready: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry-picked from commit 6163663add42bb4db973f11205901e8fc6fca3b3)
Reviewed-on: https://chromium-review.googlesource.com/957811
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
diff --git a/drivers/virtio/virtio_wl.c b/drivers/virtio/virtio_wl.c
index 740460c..64bd6c1 100644
--- a/drivers/virtio/virtio_wl.c
+++ b/drivers/virtio/virtio_wl.c
@@ -1038,11 +1038,15 @@
return virtwl_ioctl_ptr(filp, cmd, (void *__user)arg);
}
+#ifdef CONFIG_COMPAT
static long virtwl_ioctl_compat(struct file *filp, unsigned int cmd,
unsigned long arg)
{
return virtwl_ioctl_ptr(filp, cmd, compat_ptr(arg));
}
+#else
+#define virtwl_ioctl_compat NULL
+#endif
static int virtwl_release(struct inode *inodep, struct file *filp)
{