On Wednesday 28 October 2015 11:25:52 Amitoj Kaur Chawla wrote:
This driver uses 'struct timeval' which we are trying to remove since 32 bit time types will break in the year 2038 by replacing it with ktime_t.
This patch changes do_gettimeofday() to ktime_get() because ktime_get() returns a ktime_t while do_gettimeofday() returns struct timeval.
This patch also uses ktime_us_delta() to get the elapsed time.
Signed-off-by: Amitoj Kaur Chawla amitoj1606@gmail.com
The patch looks great, except for one important detail:
} else if (!tx->stop_sdu_tx && !list_empty(&tx->sdu_list)) {
do_gettimeofday(&now);
now = ktime_get(); before = &tx->sdu_stamp;
diff = (now.tv_sec - before->tv_sec) * 1000000 +
(now.tv_usec - before->tv_usec);
diff = ktime_us_delta(now, before); if (diff >= 0 && diff < TX_INTERVAL) { schedule_work(&sdev->ws); spin_unlock_irqrestore(&tx->lock, flags);
This will not compile. Something must have gone wrong with your build testing, otherwise you would have surely found the problem.
Arnd