From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC8C3C43331 for ; Tue, 12 Nov 2019 16:55:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C995222C9 for ; Tue, 12 Nov 2019 16:55:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="iGmZdbQY"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="aiEuMyLF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727981AbfKLQzz (ORCPT ); Tue, 12 Nov 2019 11:55:55 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:50874 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbfKLQzx (ORCPT ); Tue, 12 Nov 2019 11:55:53 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DA0FA60F33; Tue, 12 Nov 2019 16:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1573577753; bh=2qpw0n4O5/VIIorasibWq8jjTR8oYNzI+JNmPHLt2pY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iGmZdbQY66/bgutJyGZVBGTaKUuS8gepGQsU64940awZpY2+X1sD5qNEOW+V0ZAoH vxhd/0kI4Ht1oDTdl1EULXWaN3AIvSf0EjKZ+3SFn0y8nsHK/+IMc18lS9zE+HZM80 4BGB687GMhlzpInsbZe4bgMJw1IFmc5306zA4P+0= Received: from jcrouse1-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9FE5960A1D; Tue, 12 Nov 2019 16:55:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1573577751; bh=2qpw0n4O5/VIIorasibWq8jjTR8oYNzI+JNmPHLt2pY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aiEuMyLFE2BX5DhMR98stwoqCmSOxUKjan2nekilbOoz+9b5qK92E9833VzN9ojXj KMdgeU+3XtXJHGLB2w9+waQSniDtc1F2JUjdFxUFw+XJDdUhJVyoCqE+JVmkAGmOjp iEWRPErsxAAyWyAmlqe1R3DNZ0weD+LIl63yueoo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9FE5960A1D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org Date: Tue, 12 Nov 2019 09:55:48 -0700 From: Jordan Crouse To: Arnd Bergmann Cc: y2038@lists.linaro.org, Rob Clark , Sean Paul , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, Jeykumar Sankaran , Sam Ravnborg , Joe Perches , Jonathan Marek , "Kristian H. Kristensen" , Thomas Gleixner , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: Re: [PATCH 14/16] drm/msm: avoid using 'timespec' Message-ID: <20191112165548.GB14014@jcrouse1-lnx.qualcomm.com> Mail-Followup-To: Arnd Bergmann , y2038@lists.linaro.org, Rob Clark , Sean Paul , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, Jeykumar Sankaran , Sam Ravnborg , Joe Perches , Jonathan Marek , "Kristian H. Kristensen" , Thomas Gleixner , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org References: <20191108213257.3097633-1-arnd@arndb.de> <20191108213257.3097633-15-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191108213257.3097633-15-arnd@arndb.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 08, 2019 at 10:32:52PM +0100, Arnd Bergmann wrote: > The timespec structure and associated interfaces are deprecated and will > be removed in the future because of the y2038 overflow. > > The use of ktime_to_timespec() in timeout_to_jiffies() does not > suffer from that overflow, but is easy to avoid by just converting > the ktime_t into jiffies directly. This seems good to me. y2038 changes are the best changes. Reviewed-by: Jordan Crouse > Signed-off-by: Arnd Bergmann > --- > drivers/gpu/drm/msm/msm_drv.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h > index 71547e756e29..740bf7c70d8f 100644 > --- a/drivers/gpu/drm/msm/msm_drv.h > +++ b/drivers/gpu/drm/msm/msm_drv.h > @@ -454,8 +454,7 @@ static inline unsigned long timeout_to_jiffies(const ktime_t *timeout) > remaining_jiffies = 0; > } else { > ktime_t rem = ktime_sub(*timeout, now); > - struct timespec ts = ktime_to_timespec(rem); > - remaining_jiffies = timespec_to_jiffies(&ts); > + remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ); > } > > return remaining_jiffies; > -- > 2.20.0 > -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project