Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1263391

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

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [RESEND PATCH] USB: usbmon: Use 64bit timestamp for mon_bin_hdr
Date 2015-11-05 17:20 +0100
Message-ID <qrvqA-ys-67@gated-at.bofh.it> (permalink)
References <qpaJz-1Pv-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@gmail.com>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [RESEND PATCH] USB: usbmon: Use 64bit timestamp for mon_bin_hdr Arnd Bergmann <arnd@arndb.de> - 2015-11-05 17:20 +0100
  Re: [RESEND PATCH] USB: usbmon: Use 64bit timestamp for mon_bin_hdr Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-11-05 17:40 +0100
    Re: [RESEND PATCH] USB: usbmon: Use 64bit timestamp for mon_bin_hdr Arnd Bergmann <arnd@arndb.de> - 2015-11-05 20:10 +0100

csiph-web