All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	y2038@lists.linaro.org,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/8] [media] uvc_video: use ktime_t for timestamps
Date: Tue, 05 Dec 2017 02:58:02 +0200	[thread overview]
Message-ID: <5754191.7VT3CuYHXL@avalon> (raw)
In-Reply-To: <2878836.BpTQ5Kp5iv@avalon>

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@arndb.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

  reply	other threads:[~2017-12-05  0:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 13:19 [PATCH 1/8] [media] uvc_video: use ktime_t for stats Arnd Bergmann
2017-11-27 13:19 ` [PATCH 2/8] [media] uvc_video: use ktime_t for timestamps Arnd Bergmann
2017-12-05  0:37   ` Laurent Pinchart
2017-12-05  0:58     ` Laurent Pinchart [this message]
2017-12-05 11:27       ` Arnd Bergmann
2017-11-27 13:19 ` [PATCH 3/8] [media] solo6x10: use ktime_get_ts64() for time sync Arnd Bergmann
2017-11-27 20:45   ` Ismael Luceno
2017-11-27 13:19 ` [PATCH 4/8] [media] staging: bcm2835-camera use ktime_t for timestamps Arnd Bergmann
2017-11-27 13:19   ` Arnd Bergmann
2017-11-27 13:19 ` [PATCH 5/8] [media] omap3isp: support 64-bit version of omap3isp_stat_data Arnd Bergmann
2017-12-05  0:41   ` Laurent Pinchart
2018-01-16 17:10     ` Arnd Bergmann
2017-11-27 13:19 ` [PATCH 6/8] [media] vivid: use ktime_t for timestamp calculation Arnd Bergmann
2017-11-27 15:14   ` Hans Verkuil
2017-11-27 15:25     ` Arnd Bergmann
2017-11-27 13:19 ` [PATCH 7/8] [media] staging: atomisp: convert timestamps to ktime_t Arnd Bergmann
2017-11-27 15:05   ` Andy Shevchenko
2017-11-27 15:20     ` [Y2038] " Arnd Bergmann
2017-11-27 13:20 ` [PATCH 8/8] [media] staging: imx: use ktime_t for timestamps Arnd Bergmann
2017-12-01 23:55   ` Steve Longerbeam
2017-12-05  0:40 ` [PATCH 1/8] [media] uvc_video: use ktime_t for stats Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5754191.7VT3CuYHXL@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=arnd@arndb.de \
    --cc=g.liakhovetski@gmx.de \
    --cc=hans.verkuil@cisco.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.