[media] staging: media: lirc: Replace timeval with ktime_t in lirc_sasem.c
authorArnd Bergmann <arnd@arndb.de>
Wed, 25 Nov 2015 15:12:53 +0000 (13:12 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 3 Dec 2015 18:19:36 +0000 (16:19 -0200)
commitf07c73fea2187997552020c3d2db4f0b0302931c
tree20e783b8f88e2dfdf6dc130ebb41daec698d46c2
parent8459503295d9ed3aaf5a2089a2fbdbdb5e9a9576
[media] staging: media: lirc: Replace timeval with ktime_t in lirc_sasem.c

'struct timeval presstime' and 'struct timeval tv' is used to
calculate the time since the last button press.

32-bit systems using 'struct timeval' will break in the year 2038,
so we have to replace that code with more appropriate types.
This patch changes the media: lirc driver to use ktime_t.

ktime_get() is  better than using do_gettimeofday(), because it uses
the monotonic clock. ktime_sub() are used to subtract two ktime
variables. 'ms' is only used to check how much time has passed by comparing
to 250. So instead of using expensive ktime_to_ms() call, it has been
changed to hold nanoseconds by using ktime_to_ns().

Build tested it. Tested with sparse too.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/staging/media/lirc/lirc_sasem.c
This page took 0.025413 seconds and 5 git commands to generate.