From patchwork Mon Jun 18 15:39:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10472133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D1BD26029B for ; Mon, 18 Jun 2018 15:40:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF79328917 for ; Mon, 18 Jun 2018 15:40:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B08C028931; Mon, 18 Jun 2018 15:40:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 261CA28917 for ; Mon, 18 Jun 2018 15:40:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DC2B6E482; Mon, 18 Jun 2018 15:40:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D62A6E482 for ; Mon, 18 Jun 2018 15:40:06 +0000 (UTC) Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LheU5-1fzLKj45qb-00mwck; Mon, 18 Jun 2018 17:40:01 +0200 From: Arnd Bergmann To: Rob Clark , David Airlie Subject: [PATCH] drm/msm: avoid using 'timespec' Date: Mon, 18 Jun 2018 17:39:42 +0200 Message-Id: <20180618153959.2169325-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:ZdeoPOOJT9Ro/rbS97oUpW3HbzobVPg+/VvV5rkRaRuMGMnh4gm GgwhoWJX4wIUnDmw7Ce3scdPv2afBkMJpoG+4nSXLLjo4TMpftpEgIIG/tDtEfrhCybqxGT GdSDEqCW+SmhhbG3w+ZCfNTvQtlnZvNJlxTwD1wOa1LC4rOp0FW60NBviUgUOIEWfy49oRn lrARVN99LjYcZESbYzn2g== X-UI-Out-Filterresults: notjunk:1; V01:K0:V4zlwv3sXTA=:LHPVF+/8LGLNnMp1dcjCgU L/6t9UtbLmAo7HIYuL7fh7pll0c4jXYr8ZlArtd97K7Ue40jsVdjPvXQ6JQMVxL9meQc6tLEL 7XdMR9uMTsOZf3cz440gsZcP7MZlAb2vO2o9h8LQUYc5jvQizebSlLPj5hpXxcIwlApN9a4Ke qRvBTkO2hpJ13AHuL35UqhmDAc4NnH0T4/zrSm/7adaGmKQssdFJMYu8cba+uJfV33wSkfEM9 YYTEIfp0JeoLUEuw+B35QBN3dY90Uq2sdLluUGyAgcicW0ajD8l2YJi5HJhCBMgoDcD0TKafg QqH9gAUG6j2fQEmkL4PJ7091l7gYtmglNwMfW2+PbpOWc9yZ1/k12laceyFLLHYNM1Y+bg+KQ 55YUh6FjqFzEwcnAQjkhBizSgCf2mip2QG83A7hF6vatS4IeF4d/C8xEWxA/V5idfblANn1WR hy0uysdosdEJPM36j0PeQwO1uwf+dpjyj0SdT5mDBNqMIe++QHCv3/Z1LgCQwTPfyQPC4DdmQ JryB0YL+GraOB8OYEwikpxwgfRz0NsML2UBTqJDf5bF9wMXoa9UCttQRQ2TzJ9zcb1DercuVa VdPmqNRmdIlZ1uLYrDm+KsWEAnPKKJOt1NU92ACH2RAQqTK9SXQ5rXZlLjOuf8cZ7nbkaa35W 9taGgiANSRgXq4L7KAVsd7iyvapR1O4l3sBV2hmj0IyZbeVs31850VtMHCCNSetOKSNE= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , y2038@lists.linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Arnd Bergmann Reviewed-by: Sean Paul --- 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 b2da1fbf81e0..cc8977476a41 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -353,8 +353,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;