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: 119677 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp124134qgn; Mon, 27 Nov 2017 03:37:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMYGk7/BoZ4CQ0O5Ov0BC0GWFuUn1kMd5+pLj7JeWIp98yE9GI3Y6XvuT7UYGemD+THjkF+s X-Received: by 10.99.0.86 with SMTP id 83mr36592414pga.326.1511782627026; Mon, 27 Nov 2017 03:37:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511782627; cv=none; d=google.com; s=arc-20160816; b=ebBFtFcHdhwRckIi2v/Z3aNUE3Q1Do096QXHmYA2ba3cpy0I7mIuN9WirxFD6s8NwH NfpE39Uk/Kd6loMPrSVuz1jKWYrQIGvRbBpGBXQwuNPAGmPPwSZYFUcxaLg7aQI03Prk rLMpFs8oO1Nx6UybMCHlCbs/xuDNQOFVDT7f3DvnUNpD+7/WSP3WG2b/n75q4SOJQPZf 1NsYFWUIPsGbGqXWNvJFMdi2jvH+RZef3pfRrc4INiCJWlZE6MMKe1oJqZaRe0ZpjJrW 1Mw9udRbSlNzwnkHElW7p9P1925AmVzdCsuwfTK4cwRW2hVTSAZ6x1HBjFQKx5YwVf1M IcXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=uT3X+LqPC/Dxxau9VKQ1BB36Hn1I4sEkW0FInwAG6JE=; b=WzStnYEdPIYy1EnxswOfakHHVVVk8aE02XSGeMMxsp6lRFG8mhCrY8Ms9GDTAKdbQe dEFgPGxUmtCwqPzd6GmZex/uusaVPue2FOjSJZiQHAkRHRJG9taddKX9BilP13whU83A mVTjLEwZ0ps7DKDSX6K5fanF5G/GXLrNFV+6GxlhcenS8pabKFvGRFqKPkNW/C08owwR 5zgN+itK2BlhoWOoUL5yJ3I1WIODOCn7ZHGGWTe0E2D0bNAaPym3OE8xmT1nGRbqertd sA6dW2531z0cdeVtXkUlmiXO8n1g06LjoGoEAgeH7L283lvwV2BoRdMqeQvW9gI43zSB 8ANg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si22625212pgt.322.2017.11.27.03.37.06; Mon, 27 Nov 2017 03:37:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbdK0LhF (ORCPT + 28 others); Mon, 27 Nov 2017 06:37:05 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/scsi/scsi_debug.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.9.0 Reviewed-by: Johannes Thumshirn 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) {