From patchwork Thu Dec 17 09:58:52 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: 58537 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp260548lbb; Thu, 17 Dec 2015 01:59:44 -0800 (PST) X-Received: by 10.98.16.22 with SMTP id y22mr11025189pfi.27.1450346384830; Thu, 17 Dec 2015 01:59:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sp7si15488573pac.230.2015.12.17.01.59.44; Thu, 17 Dec 2015 01:59:44 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756009AbbLQJ7S (ORCPT + 29 others); Thu, 17 Dec 2015 04:59:18 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35670 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755642AbbLQJ7M (ORCPT ); Thu, 17 Dec 2015 04:59:12 -0500 Received: by mail-pa0-f44.google.com with SMTP id jx14so11025124pad.2 for ; Thu, 17 Dec 2015 01:59:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5wJaBkl6MTeZ19QvJZ/gLPNTdUNL0hRq3tWWVkxtn1U=; b=BQL6o1hMDVkqUiA61j9iyRJGAt2Q+Y8KLmKqd4mnNBDaYQ2y7yW3Qh4tn3IMvC4oye 42b0P3J7MbJUDaiffC+CEAK9t7geyFYWz2C9woblX8F910a961Ko4OrHzhDge33iLwYd ClcQTfQ/qj6LObTFbOV4bLIgv5mv0Of993hgg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5wJaBkl6MTeZ19QvJZ/gLPNTdUNL0hRq3tWWVkxtn1U=; b=WYqU5AV5T/bVafWdMxFPZjalN9DAWX1XaNyFeStQkvrg1FfrAV0zvN5mzYzilBq81f iot339HDLDjOW2noHKwnvLkrdwPFBTVHcWPQlqSSWCfOSvTPIHbOcml5LI/nRRKuESEJ YzLPCr2KWJzU9h6qKtgDjDoCxCrwfvxy27i5s9jSbyavhL7TiRIdPBIJ5bjQaDPzjth3 1t3nNGq+Z1k64HT7kqRHExkU3ZyVC/3pYFS5B99UMhGAI5z5QMeN8HpU7JSQxsQ9H6Gv uD+ZB7wxMVrpjHNclkLtMLYLUf7CnAjSx0s9s+EJEiIDGtIsbLxNW8jcyaVDOAELK4Ur 4Rdg== X-Gm-Message-State: ALoCoQnRjS1ItT22+0xMDUu3iBhpRRaWmbGT1jeZb2imO2hQtucAgwM7uyqC1yU8TxkK6p4oLxqL52MPyq6E6mTf3yvD2apJHw== X-Received: by 10.67.3.196 with SMTP id by4mr69987064pad.67.1450346351948; Thu, 17 Dec 2015 01:59:11 -0800 (PST) Received: from linux-j170.site (li753-237.members.linode.com. [106.185.42.237]) by smtp.gmail.com with ESMTPSA id s84sm10245237pfa.22.2015.12.17.01.59.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Dec 2015 01:59:11 -0800 (PST) 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 v2 2/2] ppdev: add support for compat ioctl Date: Thu, 17 Dec 2015 17:58:52 +0800 Message-Id: <1450346332-31830-3-git-send-email-bamvor.zhangjian@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450346332-31830-1-git-send-email-bamvor.zhangjian@linaro.org> References: <1450346332-31830-1-git-send-email-bamvor.zhangjian@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 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/ Reviewed-by: Arnd Bergmann diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 19a4d6e..31bc7b7 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" @@ -670,6 +671,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 +788,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, };