Forgot to do reply-all earlier.
Resending.
I considered using the ktime_get_seconds() earlier. However, I'm not convinced that the driver actually needs time in seconds. It would be hard to guess given that I'm not actually running this on a platform. So I used ktime_get() instead so that when the driver gets cleaned up later, it can be updated to use correct time granularity.
Given that sometimes they could end up calculating time from epoch seems to hint that there is more cleanup required on the driver.
Do you think this is reasonable?
Thanks, Deepa
On Fri, Oct 16, 2015 at 3:14 PM, Arnd Bergmann arnd@arndb.de wrote:
On Wednesday 14 October 2015 17:43:00 Deepa Dinamani wrote:
Replace use of struct timeval with ktime_t to calculate connection duration. This avoids y2038 issues. Use ktime_get monotonic clock instead of gettimeofday realtime clock to guard against negative durations. Fix pr_debug to use matching %ul instead of converting value to int, so that debug does not provide misleading information. Fix connection time conversion to use interface type unsigned long instead of assuming it maps to u32.
Signed-off-by: Deepa Dinamani deepa.kernel@gmail.com
The change looks correct, and your changelog also looks reasonable.
However, I notice that the code only ever looks at the second portion of the time stamp. Therefore it would be nicer to use ktime_get_seconds() to avoid the expensive ktime_divns(), and to slightly simplify the code further.
You can use either time64_t or a shorter type like 'u32' or 'long' to store monotonic seconds, so pick one of them and explain why you have that one.
Arnd
-- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. To post to this group, send email to outreachy-kernel@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/30046181.iodvR1OlJa%40wue... . For more options, visit https://groups.google.com/d/optout.