From patchwork Mon Nov 27 11:36:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10076641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5ED0460353 for ; Mon, 27 Nov 2017 11:37:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51F47289E3 for ; Mon, 27 Nov 2017 11:37:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4577128A99; Mon, 27 Nov 2017 11:37:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9F24289E3 for ; Mon, 27 Nov 2017 11:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751857AbdK0LhE (ORCPT ); Mon, 27 Nov 2017 06:37:04 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:50424 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751834AbdK0LhD (ORCPT ); Mon, 27 Nov 2017 06:37:03 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0M5CrX-1f3X0n0LAV-00zatM; Mon, 27 Nov 2017 12:36:50 +0100 From: Arnd Bergmann To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: y2038@lists.linaro.org, Arnd Bergmann , Bart Van Assche , Douglas Gilbert , Hannes Reinecke , Johannes Thumshirn , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: debug: remove jiffies_to_timespec Date: Mon, 27 Nov 2017 12:36:25 +0100 Message-Id: <20171127113647.2352914-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:f5KdFuoEpe5ofed54wk3vWfcV+UjsJOaNDWqmPcwsmw0xlDgcVl okIYxKpyHZZwH/FMZQmlPcQrRHwdZXsPe3mpU5RBIpWC9qSNLDxHWFuCKK8NbvCpd7bA4GZ djI2efS6Pzjt1L/gMhBEfyYDjyLO0cLeCtjgRkvc0PBwzz338MYlrhDS117/EWhC5mblAqm a3djXA36jpyTD62wKMnDw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Fa/T+OyLtPM=:mv8FjxGUnIM/GFOVcqReyt YDpgsKuyclIDGYWcDh8WkIbK9QA7Q3DN2V2kTuG13YlFvgQSSuf007oROonky8QTOB4rqV2Qr p08ZkmZuPGf3V8d+J9UK6fStMWXnXjQFzbGrU5zul5+JEOnKfmrRm8bwMUST5J71wiajM6ycE G6MJSYK2m7E/aDVxp4RmmPIuTy/sBgTHCSZC+CeRMLVe93pnqIC8ZVEMZNzdMMrGmBjYGKsi8 rkkSrpzWcE2sjWdbUCDxyC0w+hd1NZUgJzqof207pmY5Hq2Ah8CFdKcq+GVxs3yatcY3GZdJs EtJGMcI+o6+Ym6s06Pp+5CXWXg5gpCXjtFdhawAh4zKFagZ7UwaQGRHpn2v59qlcf1LmsELd5 gSwoeRu9UJlfuxSexp+uTCBSOE6dH/ZfgJj95iWS9FHL0OIwJKAvuOMZO4KhyCY0Pl3jpHzqu C+Mmht71N7PKhAxQqzwbPF0KzB5s6QkiCM+VUMOdm0zROe1v6ECvYj88vhT41AOab0XpqiUe6 oe6UNShSH6Sj0hFs2YgwXCMzHZhceouO9dPzILu2MQt9C9wkDvjmpHGf7/LSqRnw5BYTiu/hq oSIVRV5ASnN1B+oOnv0MDrrmIQmDoIPhwu2KqpHiFH+urA/vcawlVczKSlOCUqBupatqS+jwt bBF+Kk419uTqR56u9DiUccNYGWak3gZ1r9IzGbBg5YMM1WtplEAJ7CnuriMIDyY2lwFSvjjgK KEZq063ZDva/YLEO/+lxQWUobDH6bN9O8U7s9w== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Johannes Thumshirn 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) {