From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752709AbbJWJcE (ORCPT ); Fri, 23 Oct 2015 05:32:04 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34403 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942AbbJWJcB (ORCPT ); Fri, 23 Oct 2015 05:32:01 -0400 Subject: Re: [Y2038] [PATCH V2] hp_sdc: fixed y2038 problem To: Arnd Bergmann , y2038@lists.linaro.org References: <5041745.xAgMz1TQSE@wuerfel> <1445590406-30448-1-git-send-email-pingbo.wen@linaro.org> <3901659.bcGNtuE6xV@wuerfel> Cc: dmitry.torokhov@gmail.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org From: Pingbo Wen Message-ID: <5629FE8E.8020300@linaro.org> Date: Fri, 23 Oct 2015 17:31:58 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <3901659.bcGNtuE6xV@wuerfel> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, October 23, 2015 05:25 PM, Arnd Bergmann wrote: > On Friday 23 October 2015 16:53:26 WEN Pingbo wrote: >> 1. Converting timeval to ktime_t, and there is no need to handle sec and >> usec separately >> >> 2. hp_sdc.rtv is only used for time diff, monotonic time is better here >> >> Signed-off-by: WEN Pingbo >> --- > > This version is still correct and looks better than the first version, but > I'd still like you to improve some details: > > - read some other changelogs and follow the common style. In particular, > in the subject line say /what/ you do ("e.g. use ktime_get instead of > do_gettimeofday", or "avoid using struct timespec") instead of /why/, > but then explain in the changelog text what is wrong with the current > version and why it gets changed like this. > > - Below the '---', add a short list of things you have changed since > the previous versions. This part will not get copied into the git > history. > Ok, I will fix this in the next version. >> - do_gettimeofday(&tv); >> - if (tv.tv_sec > hp_sdc.rtv.tv_sec) >> - tv.tv_usec += USEC_PER_SEC; >> - >> - if (tv.tv_usec - hp_sdc.rtv.tv_usec > HP_SDC_MAX_REG_DELAY) { >> + if (time_diff.tv64 > HP_SDC_MAX_REG_DELAY) { >> hp_sdc_transaction *curr; >> uint8_t tmp; >> >> - printk(KERN_WARNING PREFIX "read timeout (%ius)!\n", >> - (int)(tv.tv_usec - hp_sdc.rtv.tv_usec)); >> + printk(KERN_WARNING PREFIX "read timeout (%llins)!\n", >> + time_diff.tv64); >> curr->idx += hp_sdc.rqty; >> hp_sdc.rqty = 0; >> tmp = curr->seq[curr->actidx]; > > A tiny style comment here: please use ktime_to_ns() to extract the > nanoseconds out of the ktime_t type rather than accessing the tv64 > member directly. Same here. Thank you Pingbo > > Arnd >