From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753067AbcAGUOq (ORCPT ); Thu, 7 Jan 2016 15:14:46 -0500 Received: from www.osadl.org ([62.245.132.105]:41462 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751693AbcAGUOp (ORCPT ); Thu, 7 Jan 2016 15:14:45 -0500 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.1.4