From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbbJWMe5 (ORCPT ); Fri, 23 Oct 2015 08:34:57 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34807 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751768AbbJWMey convert rfc822-to-8bit (ORCPT ); Fri, 23 Oct 2015 08:34:54 -0400 Content-Type: text/plain; charset=gb2312 Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Subject: Re: [Y2038] [PATCH] hil_mlc: convert timeval to timespec64 From: Pingbo Wen In-Reply-To: <5201254.PnVcGHTDmH@wuerfel> Date: Fri, 23 Oct 2015 20:34:50 +0800 Cc: y2038@lists.linaro.org, dmitry.torokhov@gmail.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <1445161519-27000-1-git-send-email-pingbo.wen@linaro.org> <46052377.96MapaKFAy@wuerfel> <5629FA06.2060608@linaro.org> <5201254.PnVcGHTDmH@wuerfel> To: Arnd Bergmann X-Mailer: Apple Mail (2.3096.5) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 在 2015年10月23日,17:45,Arnd Bergmann 写道: > > On Friday 23 October 2015 17:12:38 Pingbo Wen wrote: >> On Monday, October 19, 2015 04:58 PM, Arnd Bergmann wrote: >>>> - do_gettimeofday(&tv); >>>> - > Handling the jiffies overflow is trivially done through the time_before() > and time_after() helpers, like > > > start = jiffies; > ... > now = jiffies; > timeout = start + HZ * timeout_usec / USEC_PER_SEC; > if (time_after(now, start + timeout_jiffies) > timeout(); > else > mod_timer(timer, start + timeout_jiffies); > > The time_after function works because unsigned overflow is well-defined > in C (unlike signed overflow). > Make sense, I will try this in next version. Thanks, Pingbo