diff options
author | Nicholas Mc Guire <der.herr@hofr.at> | 2015-01-31 11:51:54 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-02-07 17:24:11 +0800 |
commit | 7dfb6d2ec4547a6fd83571f6beeee47db9184847 (patch) | |
tree | 7c3f48eefd3058cc22eacd68c81b4690ab113ced /drivers/staging | |
parent | 509031dd5f5ae008ef5d4d04226ce63ca8c84354 (diff) | |
download | linux-7dfb6d2ec4547a6fd83571f6beeee47db9184847.tar.gz linux-7dfb6d2ec4547a6fd83571f6beeee47db9184847.tar.bz2 linux-7dfb6d2ec4547a6fd83571f6beeee47db9184847.zip |
staging: rtl8712: cleanup of timeout conversions
This is only an API consolidation to make things more readable.
Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var).
As msecs_to_jiffies will return > 0 if it is passed a value > 0 the
== 0 check is not needed.
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8712/osdep_service.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 5153ad9c2c75..f9337135340b 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -71,7 +71,7 @@ static inline void _init_timer(struct timer_list *ptimer, static inline void _set_timer(struct timer_list *ptimer, u32 delay_time) { - mod_timer(ptimer, (jiffies+(delay_time*HZ/1000))); + mod_timer(ptimer, (jiffies+msecs_to_jiffies(delay_time))); } static inline void _cancel_timer(struct timer_list *ptimer, u8 *bcancelled) @@ -101,9 +101,7 @@ static inline void sleep_schedulable(int ms) { u32 delta; - delta = (ms * HZ) / 1000;/*(ms)*/ - if (delta == 0) - delta = 1;/* 1 ms */ + delta = msecs_to_jiffies(ms);/*(ms)*/ set_current_state(TASK_INTERRUPTIBLE); if (schedule_timeout(delta) != 0) return; |