Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753132AbbLIGMN (ORCPT ); Wed, 9 Dec 2015 01:12:13 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:35250 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752792AbbLIGMJ (ORCPT ); Wed, 9 Dec 2015 01:12:09 -0500 From: Bamvor Jian Zhang To: linux-kernel@vger.kernel.org Cc: y2038@lists.linaro.org, gregkh@linuxfoundation.org, arnd@arndb.de, sudipm.mukherjee@gmail.com, broonie@kernel.org, Bamvor Jian Zhang Subject: [PATCH 2/2] ppdev: add support for compat ioctl Date: Wed, 9 Dec 2015 14:11:38 +0800 Message-Id: <1449641498-5761-3-git-send-email-bamvor.zhangjian@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449641498-5761-1-git-send-email-bamvor.zhangjian@linaro.org> References: <1449641498-5761-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: 1410 Lines: 47 The arg of ioctl in ppdev is the pointer of integer except the timeval in PPSETTIME, PPGETTIME. Different size of timeval is already supported by the previous patches. So, it is safe to add compat support. Signed-off-by: Bamvor Jian Zhang --- drivers/char/ppdev.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 19a4d6e..7390166 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -670,6 +670,14 @@ static long pp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return ret; } +#ifdef CONFIG_COMPAT +static long pp_compat_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) +{ + return pp_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); +} +#endif + static int pp_open (struct inode * inode, struct file * file) { unsigned int minor = iminor(inode); @@ -779,6 +787,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/