diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2015-02-11 04:27:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-11 22:37:43 -0500 |
commit | bc2f3873f74414cdf095b337a73f96262e6aadbc (patch) | |
tree | e843ed92a363dcb78fa0e026482b531d13114ce2 /drivers/net/ethernet/agere | |
parent | 777b3e930ac8eb1f8360b3e4f2aaf5e4abe5ed46 (diff) |
et131x: use msecs_to_jiffies for conversions
This is only an API consolidation and should make things more readable.
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.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/agere')
-rw-r--r-- | drivers/net/ethernet/agere/et131x.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c index 384dc163851b..e0f3d197e7f2 100644 --- a/drivers/net/ethernet/agere/et131x.c +++ b/drivers/net/ethernet/agere/et131x.c | |||
@@ -3127,7 +3127,8 @@ static void et131x_error_timer_handler(unsigned long data) | |||
3127 | } | 3127 | } |
3128 | 3128 | ||
3129 | /* This is a periodic timer, so reschedule */ | 3129 | /* This is a periodic timer, so reschedule */ |
3130 | mod_timer(&adapter->error_timer, jiffies + TX_ERROR_PERIOD * HZ / 1000); | 3130 | mod_timer(&adapter->error_timer, jiffies + |
3131 | msecs_to_jiffies(TX_ERROR_PERIOD)); | ||
3131 | } | 3132 | } |
3132 | 3133 | ||
3133 | static void et131x_adapter_memory_free(struct et131x_adapter *adapter) | 3134 | static void et131x_adapter_memory_free(struct et131x_adapter *adapter) |
@@ -3647,7 +3648,8 @@ static int et131x_open(struct net_device *netdev) | |||
3647 | 3648 | ||
3648 | /* Start the timer to track NIC errors */ | 3649 | /* Start the timer to track NIC errors */ |
3649 | init_timer(&adapter->error_timer); | 3650 | init_timer(&adapter->error_timer); |
3650 | adapter->error_timer.expires = jiffies + TX_ERROR_PERIOD * HZ / 1000; | 3651 | adapter->error_timer.expires = jiffies + |
3652 | msecs_to_jiffies(TX_ERROR_PERIOD); | ||
3651 | adapter->error_timer.function = et131x_error_timer_handler; | 3653 | adapter->error_timer.function = et131x_error_timer_handler; |
3652 | adapter->error_timer.data = (unsigned long)adapter; | 3654 | adapter->error_timer.data = (unsigned long)adapter; |
3653 | add_timer(&adapter->error_timer); | 3655 | add_timer(&adapter->error_timer); |