From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbdK0PL7 (ORCPT ); Mon, 27 Nov 2017 10:11:59 -0500 Received: from mga07.intel.com ([134.134.136.100]:5608 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbdK0PL6 (ORCPT ); Mon, 27 Nov 2017 10:11:58 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,465,1505804400"; d="scan'208";a="6450959" Message-ID: <1511795153.25007.451.camel@linux.intel.com> Subject: Re: [PATCH 7/8] [media] staging: atomisp: convert timestamps to ktime_t From: Andy Shevchenko To: Arnd Bergmann , Alan Cox , Sakari Ailus , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: y2038@lists.linaro.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Mon, 27 Nov 2017 17:05:53 +0200 In-Reply-To: <20171127132027.1734806-7-arnd@arndb.de> References: <20171127132027.1734806-1-arnd@arndb.de> <20171127132027.1734806-7-arnd@arndb.de> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Intel Finland Oy