linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] wireless: orinoco: orinoco_plx use msecs_to_jiffies for conversion
@ 2015-02-04  8:07 Nicholas Mc Guire
  2015-02-04  8:07 ` [PATCH 2/3] wireless: orinoco: orinoco_pci " Nicholas Mc Guire
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicholas Mc Guire @ 2015-02-04  8:07 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Benoit Taine, Bjorn Helgaas, linux-wireless, netdev,
	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>
---

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 cleanup only.

Patch was compile-tested only for x86_64_defconfig + CONFIG_HERMES=m
CONFIG_PLX_HERMES=m

Patch is against 3.19.0-rc7 (localversion-next is -next-20150203)

 drivers/net/wireless/orinoco/orinoco_plx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/orinoco/orinoco_plx.c b/drivers/net/wireless/orinoco/orinoco_plx.c
index b8f6e5c..8b04523 100644
--- a/drivers/net/wireless/orinoco/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco/orinoco_plx.c
@@ -121,7 +121,7 @@ static int orinoco_plx_cor_reset(struct orinoco_private *priv)
 	mdelay(1);
 
 	/* Just in case, wait more until the card is no longer busy */
-	timeout = jiffies + (PLX_RESET_TIME * HZ / 1000);
+	timeout = jiffies + msecs_to_jiffies(PLX_RESET_TIME);
 	reg = hermes_read_regn(hw, CMD);
 	while (time_before(jiffies, timeout) && (reg & HERMES_CMD_BUSY)) {
 		mdelay(1);
-- 
1.7.10.4


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

* [PATCH 2/3] wireless: orinoco: orinoco_pci use msecs_to_jiffies for conversion
  2015-02-04  8:07 [PATCH 1/3] wireless: orinoco: orinoco_plx use msecs_to_jiffies for conversion Nicholas Mc Guire
@ 2015-02-04  8:07 ` Nicholas Mc Guire
  2015-02-04  8:07 ` [PATCH 3/3] wireless: orinoco: orinoco_tmd " Nicholas Mc Guire
  2015-02-06  6:46 ` [1/3] orinoco: orinoco_plx " Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas Mc Guire @ 2015-02-04  8:07 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Benoit Taine, Bjorn Helgaas, linux-wireless, netdev,
	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>
---

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 cleanup only.

Patch was compile-tested only for x86_64_defconfig + CONFIG_HERMES=m
CONFIG_HERMES_PRISM=y, CONFIG_PCI_HERMES=m

Patch is against 3.19.0-rc7 (localversion-next is -next-20150203)

 drivers/net/wireless/orinoco/orinoco_pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c
index b6bdad6..74219d5 100644
--- a/drivers/net/wireless/orinoco/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco/orinoco_pci.c
@@ -94,7 +94,7 @@ static int orinoco_pci_cor_reset(struct orinoco_private *priv)
 	mdelay(HERMES_PCI_COR_OFFT);
 
 	/* The card is ready when it's no longer busy */
-	timeout = jiffies + (HERMES_PCI_COR_BUSYT * HZ / 1000);
+	timeout = jiffies + msecs_to_jiffies(HERMES_PCI_COR_BUSYT);
 	reg = hermes_read_regn(hw, CMD);
 	while (time_before(jiffies, timeout) && (reg & HERMES_CMD_BUSY)) {
 		mdelay(1);
-- 
1.7.10.4


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

* [PATCH 3/3] wireless: orinoco: orinoco_tmd use msecs_to_jiffies for conversion
  2015-02-04  8:07 [PATCH 1/3] wireless: orinoco: orinoco_plx use msecs_to_jiffies for conversion Nicholas Mc Guire
  2015-02-04  8:07 ` [PATCH 2/3] wireless: orinoco: orinoco_pci " Nicholas Mc Guire
@ 2015-02-04  8:07 ` Nicholas Mc Guire
  2015-02-06  6:46 ` [1/3] orinoco: orinoco_plx " Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas Mc Guire @ 2015-02-04  8:07 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Benoit Taine, Bjorn Helgaas, linux-wireless, netdev,
	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>
---

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 cleanup only.

Patch was compile-tested only for x86_64_defconfig + CONFIG_HERMES=m
CONFIG_TMD_HERMES=m

Patch is against 3.19.0-rc7 (localversion-next is -next-20150203)

 drivers/net/wireless/orinoco/orinoco_tmd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/orinoco/orinoco_tmd.c b/drivers/net/wireless/orinoco/orinoco_tmd.c
index 79d0e33..20ce569 100644
--- a/drivers/net/wireless/orinoco/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco/orinoco_tmd.c
@@ -71,7 +71,7 @@ static int orinoco_tmd_cor_reset(struct orinoco_private *priv)
 	mdelay(1);
 
 	/* Just in case, wait more until the card is no longer busy */
-	timeout = jiffies + (TMD_RESET_TIME * HZ / 1000);
+	timeout = jiffies + msecs_to_jiffies(TMD_RESET_TIME);
 	reg = hermes_read_regn(hw, CMD);
 	while (time_before(jiffies, timeout) && (reg & HERMES_CMD_BUSY)) {
 		mdelay(1);
-- 
1.7.10.4


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

* Re: [1/3] orinoco: orinoco_plx use msecs_to_jiffies for conversion
  2015-02-04  8:07 [PATCH 1/3] wireless: orinoco: orinoco_plx use msecs_to_jiffies for conversion Nicholas Mc Guire
  2015-02-04  8:07 ` [PATCH 2/3] wireless: orinoco: orinoco_pci " Nicholas Mc Guire
  2015-02-04  8:07 ` [PATCH 3/3] wireless: orinoco: orinoco_tmd " Nicholas Mc Guire
@ 2015-02-06  6:46 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2015-02-06  6:46 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Benoit Taine, Bjorn Helgaas, linux-wireless, netdev,
	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>

Thanks, 3 patches applied to wireless-drivers-next.git:

ab458cc85fa2 orinoco: orinoco_plx use msecs_to_jiffies for conversion
3427da4597ae orinoco: orinoco_pci use msecs_to_jiffies for conversion
c1f1f6663b3c orinoco: orinoco_tmd use msecs_to_jiffies for conversion

Kalle Valo

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

end of thread, other threads:[~2015-02-06  6:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-04  8:07 [PATCH 1/3] wireless: orinoco: orinoco_plx use msecs_to_jiffies for conversion Nicholas Mc Guire
2015-02-04  8:07 ` [PATCH 2/3] wireless: orinoco: orinoco_pci " Nicholas Mc Guire
2015-02-04  8:07 ` [PATCH 3/3] wireless: orinoco: orinoco_tmd " Nicholas Mc Guire
2015-02-06  6:46 ` [1/3] orinoco: orinoco_plx " Kalle Valo

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).