lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 05 Dec 2017 02:58:02 +0200
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        y2038@...ts.linaro.org,
        Kieran Bingham <kieran.bingham@...asonboard.com>,
        Guennadi Liakhovetski <g.liakhovetski@....de>,
        Hans Verkuil <hans.verkuil@...co.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/8] [media] uvc_video: use ktime_t for timestamps

Hi Arnd,

On Tuesday, 5 December 2017 02:37:27 EET Laurent Pinchart wrote:
> On Monday, 27 November 2017 15:19:54 EET Arnd Bergmann wrote:
> > uvc_video_get_ts() returns a 'struct timespec', but all its users
> > really want a nanoseconds variable anyway.
> > 
> > Changing the deprecated ktime_get_ts/ktime_get_real_ts to ktime_get
> > and ktime_get_real simplifies the code noticeably, while keeping
> > the resulting numbers unchanged.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@...db.de>
> > ---
> > 
> >  drivers/media/usb/uvc/uvc_video.c | 37 ++++++++++++---------------------
> >  drivers/media/usb/uvc/uvcvideo.h  |  2 +-
> >  2 files changed, 13 insertions(+), 26 deletions(-)

[snip]

> > -	struct timespec ts;
> > +	u64 timestamp;

[snip]

> >  	uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %llu "
> >  		  "buf ts %llu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n",
> >  		  stream->dev->name,
> >  		  sof >> 16, div_u64(((u64)sof & 0xffff) * 1000000LLU, 65536),
> > -		  y, timespec_to_ns(&ts), vbuf->vb2_buf.timestamp,
> > +		  y, timestamp, vbuf->vb2_buf.timestamp,
> >  		  x1, first->host_sof, first->dev_sof,
> >  		  x2, last->host_sof, last->dev_sof, y1, y2);

As you've done lots of work moving code away from timespec I figured out I 
would ask, what is the preferred way to print a ktime in secs.nsecs format ? 
Should I use ktime_to_timespec and print ts.tv_sec and ts.tv_nsec, or is there 
a better way ?

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ