From patchwork Mon Jun 29 14:23:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bamvor Zhang Jian X-Patchwork-Id: 50414 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F1093218E4 for ; Mon, 29 Jun 2015 14:26:57 +0000 (UTC) Received: by wibdu3 with SMTP id du3sf8873336wib.2 for ; Mon, 29 Jun 2015 07:26:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=e4420HvEtbCfn7XJcsOV4WVEjOmy3t+LpJDSFsjfEzE=; b=GY11JwuFcFMbPFE9OkI+feIzDUM0SOPcrfZj2/XCQXPdcQeyIjU8tUDo3JTRU8Ijqz sbQuK38NGUfHIy0AtWh358YcZ0JuO1VIQWoszT4e2tCvT5A4yz+6SFtNFqn7O6xp86D8 cuEMr3pokgrTSzt4Fud0sE0R+bYRzPbQgn2oAvXjt8PXL9HAxTo/7+P1JzbJ4yy7Qwm8 ZPdvxKNFlxCGxBdTLX4l1hkKg8Z84td1G4tfuuiD49D2lr+Ad4qaxBmMqSRTxB/s1dDR 0jKAlK1hRIuACOdsk3QPdhltYKiQM4TcnLM4c2Gr+kwKRD6BhXUlSLf/83riCufUhsru 3b7g== X-Gm-Message-State: ALoCoQnt/6HIjjtdAHSNgVWNgoAFnJwFVmPpt6/yruCELJO4JF+kisvWl4Rky4xo035Gj4rS3QhO X-Received: by 10.180.216.12 with SMTP id om12mr8777750wic.1.1435588017287; Mon, 29 Jun 2015 07:26:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.1 with SMTP id o1ls791390lao.12.gmail; Mon, 29 Jun 2015 07:26:57 -0700 (PDT) X-Received: by 10.112.83.135 with SMTP id q7mr14476956lby.13.1435588017088; Mon, 29 Jun 2015 07:26:57 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id la8si35169270lac.141.2015.06.29.07.26.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 07:26:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagh6 with SMTP id h6so55863710lag.2 for ; Mon, 29 Jun 2015 07:26:56 -0700 (PDT) X-Received: by 10.152.179.234 with SMTP id dj10mr14454218lac.73.1435588016882; Mon, 29 Jun 2015 07:26:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1743785lbb; Mon, 29 Jun 2015 07:26:55 -0700 (PDT) X-Received: by 10.68.169.34 with SMTP id ab2mr32210072pbc.120.1435588015107; Mon, 29 Jun 2015 07:26:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bq3si5240379pdb.151.2015.06.29.07.26.54; Mon, 29 Jun 2015 07:26:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370AbbF2O0t (ORCPT + 30 others); Mon, 29 Jun 2015 10:26:49 -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 Received: by pdcu2 with SMTP id u2so117812766pdc.3 for ; Mon, 29 Jun 2015 07:26:34 -0700 (PDT) X-Received: by 10.68.250.194 with SMTP id ze2mr32988278pbc.24.1435587994495; Mon, 29 Jun 2015 07:26:34 -0700 (PDT) Received: from linux-j170.site.site ([69.85.92.49]) by mx.google.com with ESMTPSA id i10sm42520177pdr.78.2015.06.29.07.26.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Jun 2015 07:26:33 -0700 (PDT) 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 Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bamvor.zhangjian@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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, };