From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752648AbbJWJZh (ORCPT ); Fri, 23 Oct 2015 05:25:37 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:59625 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbbJWJZf (ORCPT ); Fri, 23 Oct 2015 05:25:35 -0400 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: WEN Pingbo , dmitry.torokhov@gmail.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [Y2038] [PATCH V2] hp_sdc: fixed y2038 problem Date: Fri, 23 Oct 2015 11:25:29 +0200 Message-ID: <3901659.bcGNtuE6xV@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1445590406-30448-1-git-send-email-pingbo.wen@linaro.org> References: <5041745.xAgMz1TQSE@wuerfel> <1445590406-30448-1-git-send-email-pingbo.wen@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:KqiQc1ErF0ZJo8nJRfEKLnAVTo4p13p8S7jc62sHuLGraMG6piC ek0osdHFwEbtRit5xVUF2j6KfvvTch7aUykMlYCmU2ApxMvkVSOrkD66O3kI8LzSWNVlVof 6K94hs2+UVNCZjoMh/Ws+fRiyQ7JKc7l7Zxz86an3M7mcSJmU3qVLUzJs8oQXQaPXb/En+G X0ReSw+yDs5reS2wYHgEg== X-UI-Out-Filterresults: notjunk:1;V01:K0:b1KVCyI6454=:p9bHOKeZ4C0SjEJ+HkZYuk taYZ/LpO/FN9yGJHCtVGz1ynjvTN+12eElXTk987+wvmZuDlHTSRGQINhjV0DdYA5EF15Ne52 R/3rr/2SqP+Egbv4fJ65VuxUb9LN3b5Xq6bvgpLHdkizPJrefMhrQ49DIQYAECX/SlguaAYI5 LMJthFxcvcWq+yrKAt4wwkcFQsPzwHNW2IAi/4YLbmAP64njUs32AVA9lKk/ToxzaBo+VZG+D yWXqOC0JGin4r9YiMsFhYJ5uqQGCVJoUJILB0sUWQPrgprcWkrhtSlYyAkkDJjxY6WEf1GbGL ZnbJ9IVDH1jafqupIHA/N1Tn6mvtAdmkeDJtFVGEv34XE+eC1ZDRF2VnSt5hrbXoxmlctQjjK r77MjSN6yv+7gBAaSoEwdp/B8Cyw/RmZlm0oJ7hznKQPy2wiLtyZDCZgc5mWMBZQQ4M+LZVNP +9WYTX791itv0XJK6emV6VSbkl5BZ1G30VQvsswpBILVk2aQmy/SBNb54u4Qf/qv4MbSf6bYe ByvQX9m8vCzh/EHEz2twoRq7FzkEt+6Bo3O/dWzk+L9cZu/kbb/AUjr+7sg2EYeu3quiPPl7O FaArqLaqjbgO/Xaoc+3+KGWtFtSLdWSoXUEKIgQCK8VYc+JCYNOQgUnELXELDhx6sIzXLwm6+ ylKpmoLD9ZkIGSjwxPTycMJw7UDa6usHhpBPZ5xs1k6HHrjOoInu4WnOyXF0z1Y1tm1dLmdq9 r3NxlIw9Iu9lAeI1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > - 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. Arnd