Re: [PATCH] USB: usbmon: Remove timeval usage for timestamp

2015-05-05 Thread Alan Stern
On Tue, 5 May 2015, Arnd Bergmann wrote: > Your conversion looks entirely correct, but the original code is a bit > odd here as it does not use the entire range of the 32-bit microsecond > value, and counts from 0 to 409600us instead of the more intuitive > 0 to 4294967296 us range before wrap

Re: [PATCH] USB: usbmon: Remove timeval usage for timestamp

2015-05-05 Thread Pete Zaitcev
On Tue, 05 May 2015 11:24:16 +0200 Arnd Bergmann wrote: > On Tuesday 05 May 2015 11:44:33 Tina Ruchandani wrote: > > static inline unsigned int mon_get_timestamp(void) > > { > > - struct timeval tval; > > + struct timespec64 now; > > unsigned int stamp; > > > > - do_gettimeofday(&t

Re: [PATCH] USB: usbmon: Remove timeval usage for timestamp

2015-05-05 Thread Arnd Bergmann
On Tuesday 05 May 2015 09:19:37 Pete Zaitcev wrote: > On Tue, 05 May 2015 11:24:16 +0200 > Arnd Bergmann wrote: > > > On Tuesday 05 May 2015 11:44:33 Tina Ruchandani wrote: > > > > static inline unsigned int mon_get_timestamp(void) > > > { > > > - struct timeval tval; > > > + struct timespec64

Re: [PATCH] USB: usbmon: Remove timeval usage for timestamp

2015-05-05 Thread Arnd Bergmann
On Tuesday 05 May 2015 10:59:32 Alan Stern wrote: > On Tue, 5 May 2015, Arnd Bergmann wrote: > > > Your conversion looks entirely correct, but the original code is a bit > > odd here as it does not use the entire range of the 32-bit microsecond > > value, and counts from 0 to 409600us instead

Re: [PATCH] USB: usbmon: Remove timeval usage for timestamp

2015-05-05 Thread Arnd Bergmann
On Tuesday 05 May 2015 11:44:33 Tina Ruchandani wrote: > 'struct timeval' uses 32-bits for its seconds field and will overflow in > the year 2038 and beyond. This patch replaces the usage of 'struct timeval' > in mon_get_timestamp() with timespec64 which uses a 64-bit seconds field > and is y2038-s

[PATCH] USB: usbmon: Remove timeval usage for timestamp

2015-05-04 Thread Tina Ruchandani
'struct timeval' uses 32-bits for its seconds field and will overflow in the year 2038 and beyond. This patch replaces the usage of 'struct timeval' in mon_get_timestamp() with timespec64 which uses a 64-bit seconds field and is y2038-safe. mon_get_timestamp() truncates the timestamp at 4096 second