From patchwork Mon Nov 27 11:41:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 119681 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp130159qgn; Mon, 27 Nov 2017 03:42:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ4mmzL52h0JJcj1ejNbw86pPccUE1aAAGxxgC80GQzr09Z9Gki/tCG7QS3glNDcTrvsE5R X-Received: by 10.98.212.12 with SMTP id a12mr36203070pfh.164.1511782946852; Mon, 27 Nov 2017 03:42:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511782946; cv=none; d=google.com; s=arc-20160816; b=LE7z7CIlWaN+KBkW9bfKo0tCyixN278G1l/TfR9yUsPTzXiG5nFgPrPiD3xRBy+Di1 CrohV0vpeYEYkhcXp/Ke7E1QRdVULAzSOFjSd9AkSJPbYxgHEy+9XdG/8IdZ9cXlyP7x e36Xeroyl72kv+cTMg0sBiMEtWwtyaA22K29SsGOvOfGahw8/j8HCCtPyhc1x1BxiXqY rp2mbEX/HSYWHF8W4AxjKrRgE63GdNBrLPDxIncKyRZu4vPzOLOS1Sa+peWmReOXiYOF wBWas/CDp0B+MUBPV5i+ZlbeMnpiu8NClXCcuewBS0qh4k7PmEnaAQXm42nMqI5YreW0 +p3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=GWlC41hT8SsOIGNXSu5FPSM79TmLOPyRBOvvpTIol6I=; b=z2zIN0KLzQRLYbltpehaz491kIo5q8KupuIJQXUOg/zUE5o7KTIBVESBMe5XIVNKPv pq+025WvybMehr0W4blNJ37qOXuP+Td5+PPIuvdeF0xszKgH5KBxa70B7EcJ0WRR/QOD ZkXGesMmhxKcxNIzWrMQ1VffEGAg5nZRf6brOHbX27nT7aro9xpGvJGgHnuYUvpDwxFv 3brb+KxGRv3oDMTqnPUtTmbigCV5HRbnH8Pe7Tw6asqj7oA5qajQwsdonjTCbkDLHSHT gYx8oz8Z+/oy6ma+FXG1Nww24w+7O7baDDnWGPvCP2iks0S72QrD3m8mCA/PJV5sYO0m ngrQ== 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 b10si1400368plm.825.2017.11.27.03.42.26; Mon, 27 Nov 2017 03:42:26 -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 S1752060AbdK0LmY (ORCPT + 28 others); Mon, 27 Nov 2017 06:42:24 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:60412 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbdK0LmW (ORCPT ); Mon, 27 Nov 2017 06:42:22 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0MQJuC-1eiTey4BMC-00TmxT; Mon, 27 Nov 2017 12:42:05 +0100 From: Arnd Bergmann To: Pravin Shelar , "David S. Miller" Cc: y2038@lists.linaro.org, Arnd Bergmann , Pravin B Shelar , Tonghao Zhang , Jiri Benc , Willem de Bruijn , Jarno Rajahalme , Yi-Hung Wei , Yi Yang , netdev@vger.kernel.org, dev@openvswitch.org, linux-kernel@vger.kernel.org Subject: [PATCH] openvswitch: use ktime_get_ts64() instead of ktime_get_ts() Date: Mon, 27 Nov 2017 12:41:38 +0100 Message-Id: <20171127114159.2528123-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:khmVcAVWFRa/EN47iAnHB641SwptJ2jKW2xrGODA6Xmc52JqwtL FRf96ZTmc1/WZpQOzJmNMIbqwe1itfqHLl033rUswv5OxHEvzn/ETILr1n9KUmlZLU6CKhx 3xPppDHBOalWxtM7fQaf4G1sKNLEaWEikb75wQ7L+anhvlHUOVH+Xmqc+h8bT2BvgdD5ruO 4ytapCo0SVWbt0v9ZCRFA== X-UI-Out-Filterresults: notjunk:1; V01:K0:PbF2dWyGP/Y=:uV48pZxbfvat4qN6byffy/ FWCQ53UCnSpRjL0CiOi7K9h/i1aV+xiv8vV9ZO8M5/8Wy+KJK59tDDzafZJIFcFsWz5amSy3e +cxH1o5r12C8pR5yc0Qv2+M+X/VnhAcDd+DPljqhYxo+cJfUMku7lXdIepfWYVN+cT0fTYdE5 qNVVlP62LxaKj8vEIc82xgjM6kJFdPS9ObY7JtRr2ZZj+9JVhIJAmBaHf051Az69Khy7f4bru WOcEIdNmkQctHh5U2aVtY0nOd49nOe6i42pJpETunyOQZcFkNQdXiFHyx2h6z8qXHFn+mz3L2 rkSAclV1R6oIKgzJIsXwzaLURckRCJ2LQVEbPcdr2IFPgaN1qnBu0W0u2f34zgSbLBcMI0CLj P4lo+Zq4BbXe7dUkTWSRQ5OGzPP+HHxusq++1dECbEkJhi1Pkzxe8vTmCauCB/EbpfHr76Kva yE6+UWdmKj+VRSBQUEMOkfDq3uiLpJ854zsoAyTUecpEle3fQ+crpczo7F3C7j5M9d3a56nJ+ pFDxBTa+mXP33E8wMn1Xl1U6K0vinzCiZxXBeaDIvQVAWHJrceOww69TVW4/r1mCinrDIVDuY nbM4jURGrkigtSLXYdxi9dhtUP1BPH6z4GURVnoDm1dKFUP9yScxQFHdz+ExTkrM+OrFN0BiQ 2+ccrt1zVVbJtt6oHH3pnJixAgGOxlIwBdkAAriWWWZ+30nlhVSkco931/b2oMutGRp6YXUkl 63JX9wP64plcEXdHFlIIN9L3pTyRKhdCafERxw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org timespec is deprecated because of the y2038 overflow, so let's convert this one to ktime_get_ts64(). The code is already safe even on 32-bit architectures, since it uses monotonic times. On 64-bit architectures, nothing changes, while on 32-bit architectures this avoids one type conversion. Signed-off-by: Arnd Bergmann --- net/openvswitch/flow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index dbe2379329c5..76d050aba7a4 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c @@ -56,12 +56,12 @@ u64 ovs_flow_used_time(unsigned long flow_jiffies) { - struct timespec cur_ts; + struct timespec64 cur_ts; u64 cur_ms, idle_ms; - ktime_get_ts(&cur_ts); + ktime_get_ts64(&cur_ts); idle_ms = jiffies_to_msecs(jiffies - flow_jiffies); - cur_ms = (u64)cur_ts.tv_sec * MSEC_PER_SEC + + cur_ms = (u64)(u32)cur_ts.tv_sec * MSEC_PER_SEC + cur_ts.tv_nsec / NSEC_PER_MSEC; return cur_ms - idle_ms;