All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>, y2038@lists.linaro.org
Cc: gregkh@linuxfoundation.org, broonie@kernel.org,
	linux-kernel@vger.kernel.org,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Bamvor Zhang Jian <bamvor.zhangjian@linaro.org>
Subject: Re: [Y2038] [PATCH v2 2/2] ppdev: add support for compat ioctl
Date: Wed, 30 Dec 2015 22:20:58 +0800	[thread overview]
Message-ID: <5683E84A.5000301@linaro.org> (raw)
In-Reply-To: <2440736.t1FM5MM9m8@wuerfel>

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.

Regards

Bamvor
> 
> 	Arnd
> _______________________________________________
> Y2038 mailing list
> Y2038@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/y2038
> 

  reply	other threads:[~2015-12-30 14:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17  9:58 [PATCH v2 0/2] Convert ppdev to y2038 safe Bamvor Jian Zhang
2015-12-17  9:58 ` [PATCH v2 1/2] ppdev: convert " Bamvor Jian Zhang
2015-12-17  9:58 ` [PATCH v2 2/2] ppdev: add support for compat ioctl Bamvor Jian Zhang
2015-12-17 23:12   ` Arnd Bergmann
2015-12-30 11:16     ` Sudip Mukherjee
2015-12-30 13:24       ` Bamvor Jian Zhang
2015-12-30 13:48         ` Sudip Mukherjee
2015-12-30 13:51         ` [Y2038] " Arnd Bergmann
2015-12-30 14:20           ` Bamvor Jian Zhang [this message]
2015-12-31  9:43             ` Sudip Mukherjee
2015-12-31 14:12               ` Arnd Bergmann
2016-01-01  5:04                 ` Sudip Mukherjee
2016-01-01 22:09                   ` Arnd Bergmann
2016-01-02  6:29                     ` Sudip Mukherjee
2016-01-02 22:40                       ` Arnd Bergmann
2016-01-04 13:14                         ` Sudip Mukherjee
2016-01-04 13:26                           ` Arnd Bergmann
2016-01-06 12:56                           ` Bamvor Jian Zhang
2016-01-07 15:12                             ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5683E84A.5000301@linaro.org \
    --to=bamvor.zhangjian@linaro.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.