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