From patchwork Thu Jan 7 20:10:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 7979931 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1CFDFBEEE5 for ; Thu, 7 Jan 2016 21:16:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 541A920122 for ; Thu, 7 Jan 2016 21:16:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D0502010E for ; Thu, 7 Jan 2016 21:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbcAGVQ3 (ORCPT ); Thu, 7 Jan 2016 16:16:29 -0500 Received: from www.osadl.org ([62.245.132.105]:41922 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbcAGVQ3 (ORCPT ); Thu, 7 Jan 2016 16:16:29 -0500 X-Greylist: delayed 3704 seconds by postgrey-1.27 at vger.kernel.org; Thu, 07 Jan 2016 16:16:28 EST Received: from debian01.hofrr.at (mail.osadl.at [92.243.35.153]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id u07KECVn026592; Thu, 7 Jan 2016 21:14:13 +0100 From: Nicholas Mc Guire To: Willem Riede Cc: "James E.J. Bottomley" , "Martin K. Petersen" , osst-users@lists.sourceforge.net, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] [SCSI] osst: remove double conversion of timeout Date: Thu, 7 Jan 2016 21:10:33 +0100 Message-Id: <1452197433-26086-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org 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 If the time is actually in jiffies already it seems cleaner to call schedule_timeout_interruptible() than to call msleep and covert the timeout. In this case it will actually optimize the code a bit as it does not need to call jiffies_to_msecs here. Signed-off-by: Nicholas Mc Guire Reviewed-by: Shane Seymour --- problem was found by coccinelle spatch patch was compile tested with: x86_64_defconfig + CONFIG_CHR_DEV_OSST=m patch is against linux-next (localversion-next is -next-20160107) drivers/scsi/osst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index 5033223..d8e5aa9 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c @@ -760,7 +760,7 @@ static int osst_wait_ready(struct osst_tape * STp, struct osst_request ** aSRpnt #endif if (initial_delay > 0) - msleep(jiffies_to_msecs(initial_delay)); + schedule_timeout_uninterruptible(initial_delay); memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY;