Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751899AbbBFJya (ORCPT ); Fri, 6 Feb 2015 04:54:30 -0500 Received: from www.osadl.org ([62.245.132.105]:58030 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238AbbBFJy2 (ORCPT ); Fri, 6 Feb 2015 04:54:28 -0500 From: Nicholas Mc Guire To: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nicholas Mc Guire Subject: [PATCH] USB: image: use msecs_to_jiffies for time conversion Date: Fri, 6 Feb 2015 04:50:21 -0500 Message-Id: <1423216221-29094-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2300 Lines: 61 This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire --- Note that the indentation is not aligned with the correct ( here due to lines going over 80 char - not sure if this is the right way to resolve this (this file has quite a few coding style issues). Patch was only compile tested with x86_64_defconfig + CONFIG_USB_MDC800=m Patch is against 3.19.0-rc7 (localversion-next is -next-20150204) drivers/usb/image/mdc800.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index a62865a..3a72e8f 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -347,7 +347,8 @@ static int mdc800_usb_waitForIRQ (int mode, int msec) { mdc800->camera_request_ready=1+mode; - wait_event_timeout(mdc800->irq_wait, mdc800->irq_woken, msec*HZ/1000); + wait_event_timeout(mdc800->irq_wait, mdc800->irq_woken, + msecs_to_jiffies(msec)); mdc800->irq_woken = 0; if (mdc800->camera_request_ready>0) @@ -743,8 +744,9 @@ static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t l mutex_unlock(&mdc800->io_lock); return len-left; } - wait_event_timeout(mdc800->download_wait, mdc800->downloaded, - TO_DOWNLOAD_GET_READY*HZ/1000); + wait_event_timeout(mdc800->download_wait, + mdc800->downloaded, + msecs_to_jiffies(TO_DOWNLOAD_GET_READY)); mdc800->downloaded = 0; if (mdc800->download_urb->status != 0) { @@ -867,7 +869,8 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s mutex_unlock(&mdc800->io_lock); return -EIO; } - wait_event_timeout(mdc800->write_wait, mdc800->written, TO_WRITE_GET_READY*HZ/1000); + wait_event_timeout(mdc800->write_wait, mdc800->written, + msecs_to_jiffies(TO_WRITE_GET_READY)); mdc800->written = 0; if (mdc800->state == WORKING) { -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/