From patchwork Tue Jan 16 17:00:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124748 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1079606lje; Tue, 16 Jan 2018 09:01:07 -0800 (PST) X-Google-Smtp-Source: ACJfBotqjybJZsJRbITpXbssqlvKneBJftJRdAuoUTcC5CVxc6FdPU+YHnwFDPW729dYC0AxZ0Bb X-Received: by 10.159.204.139 with SMTP id t11mr3098997plo.286.1516122067800; Tue, 16 Jan 2018 09:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516122067; cv=none; d=google.com; s=arc-20160816; b=TPVpp7G4x5LRIsycOSvmXeQiekhgAprMATuxSkJXZLMSXRLVUOWf0BRdO+pMmlzlDV QV4c8KZpeO83QWAAbzB12NXdhqaeRUn73u/hCCSS9K78u8pJj+iGP1ZUKRHERcveFZtC LFOmp5rbCBvKH9aDJ1VydBD7/52/IG59Z841staBCZjoiM1V2OG1yD7kWxtxNxojaeQm N4PCHFQ5RoTEPSRJMxBSl4l0e9jQVydsvOE9pZgYi+2yzqpF7wyjSXOAdj4m8sHM6mHk XbuYP5IFJmHiLHEUtIZ+LUvE22INImOVtYA8Q0yyazh6wnvX1Uv5V4usEhXTaWAlU/QP ++0g== 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=VagujCeedy36mAUM0AtlbACnG/4YgaSaqQtaeid302w=; b=cMTDQuCqUxNzZKIhCwNy7B1tMnRijx9usmiawKoQCYOFdjmiG694rkcUNfiKyxjgCS c/Bx2PAwuc4XaC1UF7nWaxl6nLv2Ff+CSIbgdQ0Y/nxOgHtvF5vAlPfeOpi254Mo7Pt7 PIZpM916Wtkkt+kTW69PLr/JfIqfUgYZAKbAd2LtI9AKs10PV6SSmRHOD18z0vAizddw tse7aPomgT5VbKMGpx37Umiic+P8bE110xWi5LYzCoqBaVXTDxYF+xOS/azlCf2Q3Wme PMBd7q6Z3gqBSpV0BPITkHmS0vVBg75+yvknnZGyiWmiCDfhbzF9Rj9ouY8UklnVZy0Z 3PHg== 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 j189si1954481pgc.294.2018.01.16.09.01.07; Tue, 16 Jan 2018 09:01:07 -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 S1751293AbeAPRBE (ORCPT + 28 others); Tue, 16 Jan 2018 12:01:04 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:62792 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790AbeAPRBD (ORCPT ); Tue, 16 Jan 2018 12:01:03 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0MYGci-1eOLRv2nui-00Uu5t; Tue, 16 Jan 2018 18:00:55 +0100 From: Arnd Bergmann To: Jeremy Kerr , Arnd Bergmann , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Al Viro , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] [RESEND] spufs: use timespec64 for timestamps Date: Tue, 16 Jan 2018 18:00:35 +0100 Message-Id: <20180116170053.2557047-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:/qoT/uFDhNfeANqXXyLK6Y7UlobBFW3E6ELFmfMkNRY83c/c82I F8rAb5/gGqWZWEsdEY7zFOBa0Unuo5r/A6ZzPrqoj7WfGT0sGwW+csK1IxvQPcyISRIsn1h 3d9O+DC2bKfkyEjPm40Zjy168OmNSXiMlk0lrzWheI0NQbeqo/QL2cAeXwZ0xdDy4A0aEF9 MIJuZaeNdHUDBw8BKTNyg== X-UI-Out-Filterresults: notjunk:1; V01:K0:2QwRfZbMSN0=:pLWBC1uH/55clPQyYlBudD nDsKR6jE+Dqu7g6Deow2VsIUXFBFYXempA7Lp/w0IXZ5kwOxv9QV9fOPdd7XjNHd6d1P9feO0 tsjNj4rfhYAZyM9WWgMZwlPHimWJAdkJH2wQinxfe856Gpl5sjo74oXfp5XLxfD57xN19qBVf umZflkZwGbrX1IP3pZEFOLdUr6ZTl5MATkLwp5LL7Go8hoVkXDW7o/8ooVj8zbXJPQ3C74raB 4Ilq8lKuCiCb9G85eQR3aHw89wagNuntbvhDzwWeFOYMWdZlKFibqtvBlTWuVkhrNkdh+bRLX QygHwexFCWGbJCzvt1l5L1Ib3NW+VLskR1GrOpFIFryXMSXPwkTyzKhkYD8u2LK93ssjR36Vz 0iO5/a7GLeaUwo3upkJbIsf/gX9m2nsYwI8K+uIQ6NFGYb8wdq4gBeAFf73ZT8KBe5iPg9W0p Po+WJy6KzbENWntgie9uFI/gI2dOCkiQZ8VxrWiR5LwerIld47fAdr4CjKLOQGi0CIUKpWJPv AysVWwC5YSLqh13MyZYsiWC/giLbOjYI1W/YO8zpGTTh9k0KY843QfidmqTSDg6AVdekMFLIK EfTI03A+tW6CIbpPC/k4y+JH8p064G+xnN6t2QBI4QCCcd4YhGtelvM6frh6rjxcYyfnP+8/p avKJPdqOesBRGoPP0EOrNJVNtIFpV66qYN/Qe7cRa86mADiH+Y5LhYk0HI5VxlfjHkFHQAI/F 9pj0amMK/2GEy0HLJJxQI2tvs3QFCJqmPmYURw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The switch log prints the tv_sec portion of timespec as a 32-bit number, while overflows in 2106. It also uses the timespec type, which is safe on 64-bit architectures, but deprecated because it causes overflows in 2038 elsewhere. This changes it to timespec64 and printing a 64-bit number for consistency. Signed-off-by: Arnd Bergmann --- Submitted in November 2017, no reply, resending. Please apply. --- arch/powerpc/platforms/cell/spufs/file.c | 6 +++--- arch/powerpc/platforms/cell/spufs/spufs.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.9.0 Acked-by: Jeremy Kerr diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index fc7772c3d068..c1be486da899 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -2375,8 +2375,8 @@ static int switch_log_sprint(struct spu_context *ctx, char *tbuf, int n) p = ctx->switch_log->log + ctx->switch_log->tail % SWITCH_LOG_BUFSIZE; - return snprintf(tbuf, n, "%u.%09u %d %u %u %llu\n", - (unsigned int) p->tstamp.tv_sec, + return snprintf(tbuf, n, "%llu.%09u %d %u %u %llu\n", + (unsigned long long) p->tstamp.tv_sec, (unsigned int) p->tstamp.tv_nsec, p->spu_id, (unsigned int) p->type, @@ -2499,7 +2499,7 @@ void spu_switch_log_notify(struct spu *spu, struct spu_context *ctx, struct switch_log_entry *p; p = ctx->switch_log->log + ctx->switch_log->head; - ktime_get_ts(&p->tstamp); + ktime_get_ts64(&p->tstamp); p->timebase = get_tb(); p->spu_id = spu ? spu->number : -1; p->type = type; diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index 2d0479ad3af4..b5fc1b3fe538 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h @@ -69,7 +69,7 @@ struct switch_log { unsigned long head; unsigned long tail; struct switch_log_entry { - struct timespec tstamp; + struct timespec64 tstamp; s32 spu_id; u32 type; u32 val;