[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1511795153.25007.451.camel@linux.intel.com>
Date: Mon, 27 Nov 2017 17:05:53 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Arnd Bergmann <arnd@...db.de>, Alan Cox <alan@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: y2038@...ts.linaro.org, linux-media@...r.kernel.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/8] [media] staging: atomisp: convert timestamps to
ktime_t
On Mon, 2017-11-27 at 14:19 +0100, Arnd Bergmann wrote:
> timespec overflows in 2038 on 32-bit architectures, and the
> getnstimeofday() suffers from possible time jumps, so the
> timestamps here are better done using ktime_get(), which has
> neither of those problems.
>
> In case of ov2680, we don't seem to use the timestamp at
> all, so I just remove it.
>
> + ktime_t timedelay = ns_to_ktime(
> min((u32)abs(dev->number_of_steps) *
> DELAY_PER_STEP_NS,
> - (u32)DELAY_MAX_PER_STEP_NS),
> - };
> + (u32)DELAY_MAX_PER_STEP_NS));
Since you are touching this, it might make sense to convert to
min_t(u32, ...)
...and locate lines something like:
ktime_t timeday = ns_to_ktime(min_t(u32,
param1,
param2));
>From my pov will make readability better.
--
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy
Powered by blists - more mailing lists