]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
usb: misc: usbtest: Remove timeval usage
authorDeepa Dinamani <deepa.kernel@gmail.com>
Wed, 4 Nov 2015 23:29:11 +0000 (15:29 -0800)
committerFelipe Balbi <balbi@ti.com>
Tue, 15 Dec 2015 15:12:41 +0000 (09:12 -0600)
commit75f5c434c30b22a48a1d4a0f827473dc29036d78
treedb34bbc36af1263f5ff444cb9ab525e76ab21343
parent38660ac7beb53b5f7bdb1d325a93c70cb7ba429f
usb: misc: usbtest: Remove timeval usage

timeval is deprecated and not y2038 safe.  Its size also changes according
to 32 bit/ 64 bit compilation.  Replace it with 32 and 64 bit versions of
its individual fields, giving two ioctls with different code values.
The two ioctls are necessary to maintain the 32 bit and 64 bit userspace
compatibility with a 64/32 bit kernel.

Change unsigned to __u32 types for a definitive userspace interface.
This is in accordance with the psABI that the unsigned type is always
32 bits.

Also use motonic timer instead of real time to ensure positive delta
values.

Refactor usbtest_ioctl for readability to isolate the handling of the
testing timing measurement.

The official testusb userspace tool can be changed in a separate patch
to reflect the __u32 changes as well. It can use the usbtest_param_32
struct, since 32 bit seconds is long enough for test durations.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/misc/usbtest.c