LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mtd: fsl_ifc_nand: use msecs_to_jiffies for time conversion
@ 2015-03-13 11:23 Nicholas Mc Guire
  2015-04-01 13:58 ` Aaron Sierra
  2015-04-06  1:05 ` Brian Norris
  0 siblings, 2 replies; 7+ messages in thread
From: Nicholas Mc Guire @ 2015-03-13 11:23 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Brian Norris, Aaron Sierra, Joe Schultz, Wolfram Sang, linux-mtd,
	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) which helps readability
and also handles all corner-cases properly.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Patch was compile tested with corenet64_smp_defconfig 
(implies CONFIG_MTD_NAND_FSL_IFC=y)

Patch is against 4.0-rc3 (localversion-next is -next-20150313

 drivers/mtd/nand/fsl_ifc_nand.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 4c05f4f..51394e5 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -317,7 +317,7 @@ static void fsl_ifc_run_command(struct mtd_info *mtd)
 
 	/* wait for command complete flag or timeout */
 	wait_event_timeout(ctrl->nand_wait, ctrl->nand_stat,
-			   IFC_TIMEOUT_MSECS * HZ/1000);
+			   msecs_to_jiffies(IFC_TIMEOUT_MSECS));
 
 	/* ctrl->nand_stat will be updated from IRQ context */
 	if (!ctrl->nand_stat)
@@ -860,7 +860,7 @@ static void fsl_ifc_sram_init(struct fsl_ifc_mtd *priv)
 
 	/* wait for command complete flag or timeout */
 	wait_event_timeout(ctrl->nand_wait, ctrl->nand_stat,
-			   IFC_TIMEOUT_MSECS * HZ/1000);
+			   msecs_to_jiffies(IFC_TIMEOUT_MSECS));
 
 	if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC)
 		printk(KERN_ERR "fsl-ifc: Failed to Initialise SRAM\n");
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-06  1:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 11:23 [PATCH] mtd: fsl_ifc_nand: use msecs_to_jiffies for time conversion Nicholas Mc Guire
2015-04-01 13:58 ` Aaron Sierra
2015-04-01 14:24   ` Nicholas Mc Guire
2015-04-01 15:08     ` Aaron Sierra
2015-04-01 15:18       ` Joe Perches
2015-04-02  0:20         ` Nicholas Mc Guire
2015-04-06  1:05 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).