Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753368AbbLaJnW (ORCPT ); Thu, 31 Dec 2015 04:43:22 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:35190 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbbLaJnS (ORCPT ); Thu, 31 Dec 2015 04:43:18 -0500 Date: Thu, 31 Dec 2015 15:13:08 +0530 From: Sudip Mukherjee To: Bamvor Jian Zhang Cc: Arnd Bergmann , y2038@lists.linaro.org, gregkh@linuxfoundation.org, broonie@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Y2038] [PATCH v2 2/2] ppdev: add support for compat ioctl Message-ID: <20151231094308.GA3489@sudip-pc> References: <1450346332-31830-1-git-send-email-bamvor.zhangjian@linaro.org> <20151230111648.GA29697@sudip-pc> <5683DB05.7000704@linaro.org> <2440736.t1FM5MM9m8@wuerfel> <5683E84A.5000301@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5683E84A.5000301@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2178 Lines: 49 On Wed, Dec 30, 2015 at 10:20:58PM +0800, Bamvor Jian Zhang wrote: > Hi, Arnd > > On 12/30/2015 09:51 PM, Arnd Bergmann wrote: > > On Wednesday 30 December 2015 21:24:21 Bamvor Jian Zhang wrote: > >> diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c > >> index 31bc7b7..9e98d01 100644 > >> --- a/drivers/char/ppdev.c > >> +++ b/drivers/char/ppdev.c > >> @@ -636,7 +636,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) > >> if ((time32[0] < 0) || (time32[1] < 0)) > >> return -EINVAL; > >> > >> - if (copy_to_user(time32, argp, sizeof(time32))) > >> + if (copy_to_user(argp, time32, sizeof(time32))) > >> return -EFAULT; > >> > >> return 0; > >> @@ -648,7 +648,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) > >> if ((time64[0] < 0) || (time64[1] < 0)) > >> return -EINVAL; > >> > >> - if (copy_to_user(time64, argp, sizeof(time64))) > >> + if (copy_to_user(argp, time64, sizeof(time64))) > >> return -EFAULT; > >> > >> return 0; > > > > This is something that would be caught by running 'make C=1' with 'sparse' > > on your patch. Can you try that to see if you introduce any other warnings? > OK. I do not do it before, there is no extra warning after apply the above > patch. > > I'm guessing it's fine, but it would be nice to confirm. I also send a lot > > of patches without running sparse and checkpatch first, but it's generally > > a good idea. > Got you. I only do the checkpatch in past. I will do sparse and checkpatch > in future. Usually sparse will be part of the tests that are done by 0day. Anyway, it worked perfectly in 64bit systems also. Can you please send your patch v3 with this change.. regards sudip -- 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/