staging: imx: use ktime_t for timestamps
authorArnd Bergmann <arnd@arndb.de>
Mon, 27 Nov 2017 13:20:00 +0000 (14:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 12:52:48 +0000 (13:52 +0100)
commitec8354b98b60410ec92935702fce404717be419b
tree7b91f8f598beb9e14123cae7ddb6e86442125758
parent6cf83f2a9e81c500819938fad3555081471212c6
staging: imx: use ktime_t for timestamps

The imx media driver passes around monotonic timestamps in the deprecated
'timespec' format. This is not a problem for the driver, as they won't
overflow, but moving to either timespec64 or ktime_t is preferred.

I'm picking ktime_t for simplicity here. frame_interval_monitor() is
the main function that changes, as it tries to compare a time interval
in microseconds. The algorithm slightly changes here, to avoid 64-bit
division. The code previously assumed that the error was at most 32-bit
worth of microseconds here, so I'm making the same assumption but add
an explicit test for it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/imx/imx-media-csi.c
drivers/staging/media/imx/imx-media-fim.c
drivers/staging/media/imx/imx-media.h