From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752570AbdK0Nje (ORCPT ); Mon, 27 Nov 2017 08:39:34 -0500 Received: from smtp.infotech.no ([82.134.31.41]:58022 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbdK0Njc (ORCPT ); Mon, 27 Nov 2017 08:39:32 -0500 X-Greylist: delayed 560 seconds by postgrey-1.27 at vger.kernel.org; Mon, 27 Nov 2017 08:39:32 EST Reply-To: dgilbert@interlog.com Subject: Re: [PATCH] scsi: debug: remove jiffies_to_timespec To: Arnd Bergmann , "James E.J. Bottomley" , "Martin K. Petersen" Cc: y2038@lists.linaro.org, Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171127113647.2352914-1-arnd@arndb.de> From: Douglas Gilbert Message-ID: <2ef3fdc8-8e61-0e67-a3f9-be2dc36d8e50@interlog.com> Date: Mon, 27 Nov 2017 14:29:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171127113647.2352914-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-11-27 12:36 PM, Arnd Bergmann wrote: > There is no need to go through an intermediate timespec to convert > to ktime_t when we just want a simple multiplication. This gets > rid of one of the few users of jiffies_to_timespec, which I > hope to remove as part of the y2038 cleanup. > > Signed-off-by: Arnd Bergmann Acked-by: Douglas Gilbert > --- > drivers/scsi/scsi_debug.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c > index e4f037f0f38b..df7e9db44d44 100644 > --- a/drivers/scsi/scsi_debug.c > +++ b/drivers/scsi/scsi_debug.c > @@ -4085,10 +4085,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, > ktime_t kt; > > if (delta_jiff > 0) { > - struct timespec ts; > - > - jiffies_to_timespec(delta_jiff, &ts); > - kt = ktime_set(ts.tv_sec, ts.tv_nsec); > + kt = ns_to_ktime((u64)delta_jiff * (NSEC_PER_SEC / HZ)); > } else > kt = sdebug_ndelay; > if (NULL == sd_dp) { >