From patchwork Mon Jun 18 15:18:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 138995 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4077449lji; Mon, 18 Jun 2018 08:19:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJdPYT2egJkSZ/TICwPNBzNeuLKCsJcf1nw8L2ZOdRaPur73TYknzxvRZlzGxNjBR6LQPMg X-Received: by 2002:a62:6f86:: with SMTP id k128-v6mr14032780pfc.150.1529335164013; Mon, 18 Jun 2018 08:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529335164; cv=none; d=google.com; s=arc-20160816; b=Qs1Lqr3qc9+uni7xl16JgJoBsKYBJSQ1KMfRlCyAfA2aNmPDLCe5dCzpz/Miob0q3F LRLMykmj8M/HthGfxmHMvzv5vWl9m3o6KBduQmbhobapf/WRfYimeUW+BNX28YuJQhG2 /Hf4DpWOjTTvqGSdQKEyiIIWVqtMeI23cC1WqZeg+0MA4MbBCn5h4qXV4EwwLwGBiBtk h5l4yLvV/vgd49yEsVBt0vgFerKyFp+s7035Koduv7lddq4RurhWxe3J2chud51GRAjk seCAz+/TUSPhe5YqYCRZVJ/Gwsv6Tbk/htW6ATpwtrz3RsYjIm3dtDC5SCIAzCXk3d8g tSiQ== 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=qJ5mldpD/9KtdhEpyDK9g2ytuYeDSuPzon4LxRGdExs=; b=uHr1OaTO/UcfVjaM/1aPmTLyAebCUIyIlj3INqVXCkVehCeidTHTSyFNMqJcI5l/rH 19IbLm+pRUtBXc9NP7+vqP0TrxLvAS7YGZNUSpqO32tU94k/5LhaKT/q3GkIAxkz6XVX aiyhmcAXDaEmovRXG7wJAe1k8d9VXdB3wpovLC6qkqEx0pZxMOiuKVCKyfk+VEa/xdJ2 FybJIvzKR1sWWEs4ygQt3hAEolTEvbDgyPpcoJLNYeWwOHC7qu5WDrev8eGoILJkZXKS 3xo3KXCjcb6XugkjVvBm7oz5ikMCyGsmpZuPwDMmyMw6sClt4jc/4WjHl4QyZNKY2UGv 48KA== 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 p5-v6si14222904pfb.171.2018.06.18.08.19.23; Mon, 18 Jun 2018 08:19:24 -0700 (PDT) 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 S1754989AbeFRPTW (ORCPT + 30 others); Mon, 18 Jun 2018 11:19:22 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51469 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752765AbeFRPTU (ORCPT ); Mon, 18 Jun 2018 11:19:20 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0Mecsy-1ft4Uf0xtQ-00ODYn; Mon, 18 Jun 2018 17:19:09 +0200 From: Arnd Bergmann To: Karan Tilak Kumar , Sesidhar Baddela , "James E.J. Bottomley" , "Martin K. Petersen" Cc: y2038@lists.linaro.org, Arnd Bergmann , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] snic: fix printing time intervals Date: Mon, 18 Jun 2018 17:18:41 +0200 Message-Id: <20180618151907.1453733-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:gPPt4IKuuoCYM7qjB85xXgyNhcEVi0mEJ75+NE2X/A5ZxEIgUo9 cmB4f+qHqU7xW7f2aS5JaaozLy/YvrfT/hPCWwQa1CZUTsUzBlSQCDb0TcwPLjfm1cWE7uM LBct/ugz5o+p1Vu/g4zoFuu6DhB41W4SK1wpqTDx8osj6ZwNLj6pmrHVycBZFe8+csVaUIB uVe6E6hFsINzFvv1HPR2w== X-UI-Out-Filterresults: notjunk:1; V01:K0:zFOWDC0Pkmw=:rbs4s/zJgP2qRZFK7pQqn6 K0xy0npsmzvLBdrYepGKA/3T8nlH35lydOau3HnrupcudtBRLwuxQ7GdC61HI7LZ0bIW/qMur a/2Pz7SUubCHTmo3TqYrLGOsT9psJ+LLSmws0YCCdXX89wtO/NF8A9fri/iTyp8VQcH7IXS0H hKugmxlMUjQAFlSRwsTx+m0Prmkla/K/QhDFhX9PAW6GSna1gJKNhRWTK7lE1lj2ax7vLh2iL GUsyR8/J8nLIZ51r7zakkLrygnuTqApaxmLIuWQzch7l3xUO8O48cQvZS6+5RyD5OtzGN+PWI vyOezwTVl+CJTrWrlVtXf2byzIeBC8VZysZWYi1+hPUfA7lPMaYXzexA4SsTth/lB5XykJTSg v2dbnQhdAKY+WlTIYObaOuE1Giu+DIa86O7OrJaK0DhcOBPkK/9lgngeR+ytCEqsELjfSpXPu Qt2lqOqt+2a9rqBgQ5B9fLVfjbeJCPLjShIaDjI3niyRHFO/wJ2E4dHTi/8TPkViKzxpsbJ6y PmC1XIefH1cL3P0a3JadHxLcnpT/YKMeQGZ3pHwSM5NlclkLw7mb/kZbGXYAZjfsHE3I3HdHN LSyNL9im/mzRDV7v5J4trOibJNFyliFkzefwvDPrA4m+12Vkb14G47bxr7UfjPSMvlcKlgEJe QVY6Ma4N75dYjCt46IMCfrXKTBzJ5xWJhsxkTX82i1MHX3Xh5qPDPWTuJWPvUD98ms4k= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We don't want to use 'struct timespec' because of the y2038 overflow problem. The overflow is not actually an issue here, but it's easy to replace with 'timespec64' for consistency. However, it's worth pointing out that nanosecond values have nine digits, not eight or ten, so I'm fixing the format strings accordingly as well. Signed-off-by: Arnd Bergmann --- drivers/scsi/snic/snic_debugfs.c | 10 +++++----- drivers/scsi/snic/snic_trc.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) -- 2.9.0 diff --git a/drivers/scsi/snic/snic_debugfs.c b/drivers/scsi/snic/snic_debugfs.c index 269ddf791a73..0abe17c1a73b 100644 --- a/drivers/scsi/snic/snic_debugfs.c +++ b/drivers/scsi/snic/snic_debugfs.c @@ -200,7 +200,7 @@ snic_stats_show(struct seq_file *sfp, void *data) { struct snic *snic = (struct snic *) sfp->private; struct snic_stats *stats = &snic->s_stats; - struct timespec last_isr_tms, last_ack_tms; + struct timespec64 last_isr_tms, last_ack_tms; u64 maxio_tm; int i; @@ -312,12 +312,12 @@ snic_stats_show(struct seq_file *sfp, void *data) "\t\t Other Statistics\n" "\n---------------------------------------------\n"); - jiffies_to_timespec(stats->misc.last_isr_time, &last_isr_tms); - jiffies_to_timespec(stats->misc.last_ack_time, &last_ack_tms); + jiffies_to_timespec64(stats->misc.last_isr_time, &last_isr_tms); + jiffies_to_timespec64(stats->misc.last_ack_time, &last_ack_tms); seq_printf(sfp, - "Last ISR Time : %llu (%8lu.%8lu)\n" - "Last Ack Time : %llu (%8lu.%8lu)\n" + "Last ISR Time : %llu (%8llu.%09lu)\n" + "Last Ack Time : %llu (%8llu.%09lu)\n" "Ack ISRs : %llu\n" "IO Cmpl ISRs : %llu\n" "Err Notify ISRs : %llu\n" diff --git a/drivers/scsi/snic/snic_trc.c b/drivers/scsi/snic/snic_trc.c index f00ebf4717e0..fc60c933d6c0 100644 --- a/drivers/scsi/snic/snic_trc.c +++ b/drivers/scsi/snic/snic_trc.c @@ -65,12 +65,12 @@ static int snic_fmt_trc_data(struct snic_trc_data *td, char *buf, int buf_sz) { int len = 0; - struct timespec tmspec; + struct timespec64 tmspec; - jiffies_to_timespec(td->ts, &tmspec); + jiffies_to_timespec64(td->ts, &tmspec); len += snprintf(buf, buf_sz, - "%lu.%10lu %-25s %3d %4x %16llx %16llx %16llx %16llx %16llx\n", + "%llu.%09lu %-25s %3d %4x %16llx %16llx %16llx %16llx %16llx\n", tmspec.tv_sec, tmspec.tv_nsec, td->fn,