Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753357AbbF2O0s (ORCPT ); Mon, 29 Jun 2015 10:26:48 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:36111 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753013AbbF2O0f (ORCPT ); Mon, 29 Jun 2015 10:26:35 -0400 From: Bamvor Zhang Jian To: arnd@arndb.de, john.stultz@linaro.org, tglx@linutronix.de Cc: y2039@lists.linaro.org, linux-kernel@vger.kernel.org, bamvor.zhangjian@linaro.org Subject: [RFC PATCH v2 3/4] ppdev: add compat ioctl Date: Mon, 29 Jun 2015 22:23:26 +0800 Message-Id: <1435587807-10008-4-git-send-email-bamvor.zhangjian@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1435587807-10008-1-git-send-email-bamvor.zhangjian@linaro.org> References: <1435587807-10008-1-git-send-email-bamvor.zhangjian@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1568 Lines: 52 Add compat ioctl in ppdev in order to solve the y2038 issue in later patch. This patch simply add pp_do_ioctl to compat_ioctl, because I found that all the ioctl access the arg as a pointer. Signed-off-by: Bamvor Zhang Jian --- drivers/char/ppdev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index ae0b42b..9207658 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -69,6 +69,7 @@ #include #include #include +#include #define PP_VERSION "ppdev: user-space parallel port driver" #define CHRDEV "ppdev" @@ -635,6 +636,11 @@ static long pp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return ret; } +static long pp_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + return pp_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); +} + static int pp_open (struct inode * inode, struct file * file) { unsigned int minor = iminor(inode); @@ -744,6 +750,9 @@ static const struct file_operations pp_fops = { .write = pp_write, .poll = pp_poll, .unlocked_ioctl = pp_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = pp_compat_ioctl, +#endif .open = pp_open, .release = pp_release, }; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/