summaryrefslogtreecommitdiff
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2017-04-03 08:25:31 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-04-10 07:42:12 -0300
commit52276df0b1ce3a833293f4b57fc3b62d6f540901 (patch)
tree0ff7c2b6224b4cd6ac3fa6d6eb22feabcfbda50a /drivers/media/usb
parent360a3a90c6261fe24a959ff38f8f6c3a8468f23c (diff)
[media] uvcvideo: Don't record timespec_sub
The statistics function subtracts two timespecs manually. A helper is provided by the kernel to do this. Replace the implementation, using the helper. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/uvc/uvc_video.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 128c0a7826ce..47d93a938dde 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -868,14 +868,8 @@ size_t uvc_video_stats_dump(struct uvc_streaming *stream, char *buf,
struct timespec ts;
size_t count = 0;
- ts.tv_sec = stream->stats.stream.stop_ts.tv_sec
- - stream->stats.stream.start_ts.tv_sec;
- ts.tv_nsec = stream->stats.stream.stop_ts.tv_nsec
- - stream->stats.stream.start_ts.tv_nsec;
- if (ts.tv_nsec < 0) {
- ts.tv_sec--;
- ts.tv_nsec += 1000000000;
- }
+ ts = timespec_sub(stream->stats.stream.stop_ts,
+ stream->stats.stream.start_ts);
/* Compute the SCR.SOF frequency estimate. At the nominal 1kHz SOF
* frequency this will not overflow before more than 1h.