Commit bc2f3873 authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by David S. Miller

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: default avatarNicholas Mc Guire <hofrat@osadl.org>
Acked-by: default avatarMark Einon <mark.einon@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 777b3e93
...@@ -3127,7 +3127,8 @@ static void et131x_error_timer_handler(unsigned long data) ...@@ -3127,7 +3127,8 @@ static void et131x_error_timer_handler(unsigned long data)
} }
/* This is a periodic timer, so reschedule */ /* This is a periodic timer, so reschedule */
mod_timer(&adapter->error_timer, jiffies + TX_ERROR_PERIOD * HZ / 1000); mod_timer(&adapter->error_timer, jiffies +
msecs_to_jiffies(TX_ERROR_PERIOD));
} }
static void et131x_adapter_memory_free(struct et131x_adapter *adapter) static void et131x_adapter_memory_free(struct et131x_adapter *adapter)
...@@ -3647,7 +3648,8 @@ static int et131x_open(struct net_device *netdev) ...@@ -3647,7 +3648,8 @@ static int et131x_open(struct net_device *netdev)
/* Start the timer to track NIC errors */ /* Start the timer to track NIC errors */
init_timer(&adapter->error_timer); init_timer(&adapter->error_timer);
adapter->error_timer.expires = jiffies + TX_ERROR_PERIOD * HZ / 1000; adapter->error_timer.expires = jiffies +
msecs_to_jiffies(TX_ERROR_PERIOD);
adapter->error_timer.function = et131x_error_timer_handler; adapter->error_timer.function = et131x_error_timer_handler;
adapter->error_timer.data = (unsigned long)adapter; adapter->error_timer.data = (unsigned long)adapter;
add_timer(&adapter->error_timer); add_timer(&adapter->error_timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment