From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752875AbbCWM2x (ORCPT ); Mon, 23 Mar 2015 08:28:53 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:35273 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752512AbbCWM2u (ORCPT ); Mon, 23 Mar 2015 08:28:50 -0400 Date: Mon, 23 Mar 2015 12:28:44 +0000 From: Lee Jones To: Nicholas Mc Guire Cc: Samuel Ortiz , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: dln2: use msecs_to_jiffies for time conversion Message-ID: <20150323122844.GA24804@x1> References: <1426519249-14009-1-git-send-email-hofrat@osadl.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1426519249-14009-1-git-send-email-hofrat@osadl.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Mar 2015, Nicholas Mc Guire wrote: > Converting milliseconds to jiffies by "val * HZ / 1000" is technically > OK but msecs_to_jiffies(val) is the cleaner solution and handles all > corner cases correctly. This is a minor API consolidation only and > should make things more readable. > > Signed-off-by: Nicholas Mc Guire > --- > > Patch was compile tested with x86_64_defconfig + CONFIG_MFD_DLN2=m > > Patch is agianst 4.0-rc3 (localversion-next is -next-20150316) > > drivers/mfd/dln2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. > diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c > index 1be9bd1..704e189 100644 > --- a/drivers/mfd/dln2.c > +++ b/drivers/mfd/dln2.c > @@ -435,7 +435,7 @@ static int _dln2_transfer(struct dln2_dev *dln2, u16 handle, u16 cmd, > struct dln2_response *rsp; > struct dln2_rx_context *rxc; > struct device *dev = &dln2->interface->dev; > - const unsigned long timeout = DLN2_USB_TIMEOUT * HZ / 1000; > + const unsigned long timeout = msecs_to_jiffies(DLN2_USB_TIMEOUT); > struct dln2_mod_rx_slots *rxs = &dln2->mod_rx_slots[handle]; > int size; > -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog