* [PATCH] [RESEND] snic: fix printing time intervals
@ 2018-07-11 12:37 Arnd Bergmann
2018-07-13 3:02 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-07-11 12:37 UTC (permalink / raw)
To: Karan Tilak Kumar, Sesidhar Baddela, James E.J. Bottomley,
Martin K. Petersen
Cc: Arnd Bergmann, linux-scsi, linux-kernel
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 <arnd@arndb.de>
---
Originall sent on June 18, but got no reply, so resending now
without changes.
Please review and apply
---
drivers/scsi/snic/snic_debugfs.c | 10 +++++-----
drivers/scsi/snic/snic_trc.c | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
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,
--
2.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [RESEND] snic: fix printing time intervals
2018-07-11 12:37 [PATCH] [RESEND] snic: fix printing time intervals Arnd Bergmann
@ 2018-07-13 3:02 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2018-07-13 3:02 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Karan Tilak Kumar, Sesidhar Baddela, James E.J. Bottomley,
Martin K. Petersen, linux-scsi, linux-kernel
Arnd,
> 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.
Applied to 4.19/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-13 3:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 12:37 [PATCH] [RESEND] snic: fix printing time intervals Arnd Bergmann
2018-07-13 3:02 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).