public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Nicholas Mc Guire <hofrat@osadl.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: dln2: use msecs_to_jiffies for time conversion
Date: Mon, 23 Mar 2015 12:28:44 +0000	[thread overview]
Message-ID: <20150323122844.GA24804@x1> (raw)
In-Reply-To: <1426519249-14009-1-git-send-email-hofrat@osadl.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 <hofrat@osadl.org>
> ---
> 
> 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

      reply	other threads:[~2015-03-23 12:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 15:20 [PATCH] mfd: dln2: use msecs_to_jiffies for time conversion Nicholas Mc Guire
2015-03-23 12:28 ` Lee Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150323122844.GA24804@x1 \
    --to=lee.jones@linaro.org \
    --cc=hofrat@osadl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox