OSDN Git Service

ppdev: convert to y2038 safe
authorBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Fri, 8 Jan 2016 07:50:48 +0000 (15:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 23:00:04 +0000 (15:00 -0800)
commit3b9ab374a1e6d3cd6d16231ec6fe11fe2c49a72a
tree51358634f4bec64354891db97eef6b4ac43ebb72
parent468623bb835c215028947820c5c36afa409de633
ppdev: convert to y2038 safe

The y2038 issue for ppdev is changes of timeval in the ioctl
(PPSETTIME and PPGETTIME). The size of struct timeval changes from
8bytes to 16bytes due to the changes of time_t. It lead to the
changes of the command of ioctl, e.g. for PPGETTIME, We have:

on 32-bit (old): 0x80087095
on 32-bit (new): 0x80107095
on 64-bit      : 0x80107095

This patch define these two ioctl commands to support the 32bit
and 64bit time_t application at the same time. And, introduce
pp_set_timeout to remove some duplicated code.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ppdev.c