* [PATCH] usb: isp1760: use msecs_to_jiffies for time conversion
@ 2015-02-06 10:08 Nicholas Mc Guire
2015-02-09 9:22 ` Laurent Pinchart
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-02-06 10:08 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Felipe Balbi, Laurent Pinchart, linux-usb, linux-kernel,
Nicholas Mc Guire
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 <hofrat@osadl.org>
---
Patch was only compile tested with x86_64_defconfig + CONFIG_USB_ISP1760=m
Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)
drivers/usb/isp1760/isp1760-hcd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
index eba9b82..3cb98b1 100644
--- a/drivers/usb/isp1760/isp1760-hcd.c
+++ b/drivers/usb/isp1760/isp1760-hcd.c
@@ -1274,7 +1274,7 @@ static void errata2_function(unsigned long data)
for (slot = 0; slot < 32; slot++)
if (priv->atl_slots[slot].qh && time_after(jiffies,
priv->atl_slots[slot].timestamp +
- SLOT_TIMEOUT * HZ / 1000)) {
+ msecs_to_jiffies(SLOT_TIMEOUT))) {
ptd_read(hcd->regs, ATL_PTD_OFFSET, slot, &ptd);
if (!FROM_DW0_VALID(ptd.dw0) &&
!FROM_DW3_ACTIVE(ptd.dw3))
@@ -1286,7 +1286,7 @@ static void errata2_function(unsigned long data)
spin_unlock_irqrestore(&priv->lock, spinflags);
- errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000;
+ errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD);
add_timer(&errata2_timer);
}
@@ -1336,7 +1336,7 @@ static int isp1760_run(struct usb_hcd *hcd)
return retval;
setup_timer(&errata2_timer, errata2_function, (unsigned long)hcd);
- errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000;
+ errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD);
add_timer(&errata2_timer);
chipid = reg_read32(hcd->regs, HC_CHIP_ID_REG);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] usb: isp1760: use msecs_to_jiffies for time conversion
2015-02-06 10:08 [PATCH] usb: isp1760: use msecs_to_jiffies for time conversion Nicholas Mc Guire
@ 2015-02-09 9:22 ` Laurent Pinchart
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2015-02-09 9:22 UTC (permalink / raw)
To: Nicholas Mc Guire
Cc: Greg Kroah-Hartman, Felipe Balbi, linux-usb, linux-kernel
Hi Nicholas,
Thank you for the patch.
On Friday 06 February 2015 05:08:53 Nicholas Mc Guire wrote:
> 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 <hofrat@osadl.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>
> Patch was only compile tested with x86_64_defconfig + CONFIG_USB_ISP1760=m
>
> Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)
>
> drivers/usb/isp1760/isp1760-hcd.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/isp1760/isp1760-hcd.c
> b/drivers/usb/isp1760/isp1760-hcd.c index eba9b82..3cb98b1 100644
> --- a/drivers/usb/isp1760/isp1760-hcd.c
> +++ b/drivers/usb/isp1760/isp1760-hcd.c
> @@ -1274,7 +1274,7 @@ static void errata2_function(unsigned long data)
> for (slot = 0; slot < 32; slot++)
> if (priv->atl_slots[slot].qh && time_after(jiffies,
> priv->atl_slots[slot].timestamp +
> - SLOT_TIMEOUT * HZ / 1000)) {
> + msecs_to_jiffies(SLOT_TIMEOUT))) {
> ptd_read(hcd->regs, ATL_PTD_OFFSET, slot, &ptd);
> if (!FROM_DW0_VALID(ptd.dw0) &&
> !FROM_DW3_ACTIVE(ptd.dw3))
> @@ -1286,7 +1286,7 @@ static void errata2_function(unsigned long data)
>
> spin_unlock_irqrestore(&priv->lock, spinflags);
>
> - errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000;
> + errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD);
> add_timer(&errata2_timer);
> }
>
> @@ -1336,7 +1336,7 @@ static int isp1760_run(struct usb_hcd *hcd)
> return retval;
>
> setup_timer(&errata2_timer, errata2_function, (unsigned long)hcd);
> - errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000;
> + errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD);
> add_timer(&errata2_timer);
>
> chipid = reg_read32(hcd->regs, HC_CHIP_ID_REG);
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-09 9:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 10:08 [PATCH] usb: isp1760: use msecs_to_jiffies for time conversion Nicholas Mc Guire
2015-02-09 9:22 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox