Re: [RESEND PATCH] USB: usbmon: Use 64bit timestamp for mon_bin_hdr

From: Arnd Bergmann
Date: Thu Nov 05 2015 - 11:18:52 EST


On Thursday 29 October 2015 22:44:31 Tina Ruchandani wrote:
> struct mon_bin_hdr allows for a 64-bit seconds timestamp. The code
> currently uses 'struct timeval' to populate the timestamp in mon_bin_hdr,
> which has a 32-bit seconds field and will overflow in year 2038 and beyond.
> This patch replaces 'struct timeval' with 'struct timespec64' which is
> y2038 safe. This patch is part of a larger attempt to remove instances
> of struct timeval and other 32-bit timekeeping (time_t, struct timespec)
> from the kernel.
>
> Signed-off-by: Tina Ruchandani <ruchandani.tina@xxxxxxxxx>

Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>

As the patch is a week old and Greg hasn't picked it up yet, I'm guessing
that he doesn't have it in his queue any more and you should send it once
more with my 'Reviewed-by' tag.

> @@ -494,7 +495,7 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
> struct mon_bin_hdr *ep;
> char data_tag = 0;
>
> - do_gettimeofday(&ts);
> + getnstimeofday64(&ts);
>
> spin_lock_irqsave(&rp->b_lock, flags);
>

This is a very minor comment I still have, and the patch is fine as it, but
I tend to prefer ktime_get_real_ts64() over getnstimeofday64() these days.
The two functions do the exact same thing, and I hope to remove the latter
eventually.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/