From patchwork Fri Dec 13 20:53:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 181591 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1145137ile; Fri, 13 Dec 2019 12:55:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzyRQP/v+4h9l9sxXbPOO41Bz9fvdCudOfwLxoVYZUIhKz/JWGiAyWAmeY4kUF6IWzMfWMQ X-Received: by 2002:a9d:70cb:: with SMTP id w11mr17094623otj.157.1576270518406; Fri, 13 Dec 2019 12:55:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576270518; cv=none; d=google.com; s=arc-20160816; b=iGSpgpXQbQQnihd3W8aZQX0G6dCI+sAJqT84sS32a92nWfydcpGDnXYbqDwakLXAEz KxIKIzlghAex/HrCN3So9oikECG6hTT8BLfbH/vT3kll1COhSmS7aDOAbCa32JIZfeyg 0S+OoRFIB/z5SFwRuTanXimAn4wk3t6wNs5zjl5CeVbxnpxMUdpnpwiyGEc58IdmS5BF aIPfBTqpQ+ccf9yR+kM2q7ZbpjF1RscjLzsVf3c6J0Wv4gFLlyZvuuAg0w9ybX/iWcJn PHM1DFWZSSmbfJJO+oZj5gTGAe6IsS2wum718pKsQw7Huhjd+3m7LGBkxzY7sY1vDsrC VPzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ShaZAF4+x8CFNZ7oHO62Y+SaG5fvOUB0eAZgeHpBgyw=; b=t7zRFPxoxiH36zLj+dxN8mSVJ9/9xwsFsXO1d9XBRJwL4rLaQa+WcZ7ovFxjN766XZ 7qtSAr2tD52wRGxQGUyjwoMd+I3qcgT6NVIE00EzgmZQx54s0hVcri7PiQcYz9ED2ShK JgLQ9lTAF+rxRTI20c3nMrG0C6Rfoj4niGy2tDniZr4jvUOR2r1zBIBuefiLqmYzL3zk zlLhuIK4nc5/qqnII2K0a5K7inLrObEv2zaSXK7OgZ1dGUl31X5JvMauRtjyJHB6nLTJ O47ZZ0/oqFdNTF0Dx4V2rVnySaRfEo2n3Oz+HC+g+/fUlGEYGM1AXYc34IIX7QCiQoz+ +uGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i140si5946680oib.90.2019.12.13.12.55.18; Fri, 13 Dec 2019 12:55:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbfLMUzR (ORCPT + 27 others); Fri, 13 Dec 2019 15:55:17 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:42775 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfLMUzQ (ORCPT ); Fri, 13 Dec 2019 15:55:16 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1MGQWr-1iVdkq2Ao9-00GmsB; Fri, 13 Dec 2019 21:54:57 +0100 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, Rob Clark , Sean Paul , David Airlie , Daniel Vetter Cc: Arnd Bergmann , Jordan Crouse , Jeykumar Sankaran , Sam Ravnborg , Joe Perches , "Kristian H. Kristensen" , Thomas Gleixner , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 12/24] drm/msm: avoid using 'timespec' Date: Fri, 13 Dec 2019 21:53:40 +0100 Message-Id: <20191213205417.3871055-3-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191213204936.3643476-1-arnd@arndb.de> References: <20191213204936.3643476-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:SMQNgPIVRwQmcTY5DRfiQVqW9b6fdavzYJig6CP6LZtweyjRbiD 6mCGxP1rZR5pga+x9KqlX9c6PXDBBgTUGKDJ0BZKNHZin6AxQJIq0jYcnvNfnUsFc79qM/e q8qmecpfokP3hq7bAPt5LDfnxYTuvoKmrPS0nS2HU9pnuvh+0wbVT234k8D5E087sBGJcmP i4yEHD4KCli0umxh9A3ww== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:DbQaztQtI+A=:gxrodGEeRggtiphssUm9Us Jq/wlDutot4qEvgTcu7kfZQQQ3iQeN6l/jwOUlHw1Ybnq3VPgMPcTl9strNMqMIzw9JBvSljD C2jPPtCwvmIl6PByLxcmzD+QyHErVxvkZOmoIegYpuQhUqJIzfhj3Kg6RZVgHW4bz1CqibKR6 Ft+KVdpngmtt8UlvfyoTGNfYmprA9eW5mMVLEvqNmCPx0H24nj3frUkSFibwdnsTjWZZz63di tZABpibKZpy0u8d75dZczso0jUzTi7eQxK68axCwzreJDWLNLzMYomhhBrRb0z+C4Bh7wMREh IqmDvEY1RvYXwj0XALqnYz7FFUInslWTRCWa2S3qkZcg0DSj7/GN6q0MEx3pG4szda+yfMRmK J+8eQam1TInOwvydZdgspJK76t8NiIyLnWBR73tNZXBFkwWoljvI7oQwLHLMzuf7IjJQfvbod 6/+GSDtKOqO9r1irukoe/vUnyVZuxagYtaHgrd/VK2u1ToWu05PY1fGxC+WOCC9dmpwvf4Smo Vje6psV+nHPjQ2LbyeSJYMu8+Vyrfb59oJPpTsfY/ssvaM4JnnlPfgIUn4jSfRDwYrToDgzQJ eNDAO7A/aC8WX3IrDLKrEb4NpEi6wEZO59Ax1mICG/9qQMRhieTT0sii3o27R8skBPFa0BThe S3nKTK699n9ObLvefDUa/onIL6mlTOLQ4MG/dwG5bPq1dlUl/NohuJ6Snj3AKNhp0g10qPDEV RQLRhD98PZpi9F6xvPJMoiLcmvHmOz8gK8ZSNJ7ApEvDJzQ6poZfwqLwx8qK+dGt8k0lrFdqS HZ9OGCvIK91CYt69M0Soyrm7cJpKtZhVe4DJdxYaOiRvfLeff/cHHaLOcnwvnj2Q9MNLlsCJS hyaeD68zOSQ+8Ex8yWDw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reviewed-by: Jordan Crouse Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/msm_drv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.20.0 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;