staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies
PATCH 5/6 staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies
Replace driver specific macro MSECS with msecs_to_jiffies().
This was found using the following Coccinelle semantic patch:
//<smpl>
@@
expression e;
@@
- MSECS(e)
+ msecs_to_jiffies(e)
//</smpl>
--- drivers/staging/rtl8192u/r8192U_dm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +6 -3
@@ -2769,12 +2769,14 @@ void dm_fsync_timer_callback(unsigned long data)if (bDoubleTimeInterval) {if (timer_pending (&priv->fsync_timer))del_timer_sync (&priv->fsync_timer); - priv->fsync_timer.expires = jiffies +MSECS (priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval); + priv->fsync_timer.expires = jiffies + +msecs_to_jiffies (priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval);add_timer (&priv->fsync_timer); }else {if (timer_pending (&priv->fsync_timer))del_timer_sync (&priv->fsync_timer); - priv->fsync_timer.expires = jiffies +MSECS (priv->ieee80211->fsync_time_interval); + priv->fsync_timer.expires = jiffies + +msecs_to_jiffies (priv->ieee80211->fsync_time_interval);add_timer (&priv->fsync_timer); } }else {
@@ -2847,7 +2849,8 @@ static void dm_StartSWFsync(struct net_device *dev) }if (timer_pending (&priv->fsync_timer))del_timer_sync (&priv->fsync_timer); - priv->fsync_timer.expires = jiffies +MSECS (priv->ieee80211->fsync_time_interval); + priv->fsync_timer.expires = jiffies + +msecs_to_jiffies (priv->ieee80211->fsync_time_interval);add_timer (&priv->fsync_timer);write_nic_dword (dev, rOFDM0_RxDetector2,0x465c12cd );
Signature · 1 line
1.9.1
Quoted 23 lines · Amitoj Kaur Chawla
Replace driver specific macro MSECS with
msecs_to_jiffies().This was found using the following Coccinelle semantic patch:
//<smpl>
@@
expression e;
@@- MSECS(e)
+msecs_to_jiffies(e)
//</smpl>Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/rtl8192u/r8192U_dm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/staging/rtl8192u/r8192U_dm.c +0
-0
drivers/staging/rtl8192u/r8192U_dm.c void dm_fsync_timer_callback(unsigned long data) · line 2773
Quoted 6 lines
drivers/staging/rtl8192u/r8192U_dm.c +2
-1@@ -2769,12 +2769,14 @@ void dm_fsync_timer_callback(unsigned long data)if (bDoubleTimeInterval) {if (timer_pending (&priv->fsync_timer))del_timer_sync (&priv->fsync_timer); - priv->fsync_timer.expires = jiffies +MSECS (priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval); + priv->fsync_timer.expires = jiffies + +msecs_to_jiffies (priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval);
You're no worse than before, but maybe there could be some way not to exceed the 80 character limit quite so much. Maybe some subcomputation that could get a meaningful name.
julia
Quoted 30 lines
drivers/staging/rtl8192u/r8192U_dm.c +4
-3add_timer (&priv->fsync_timer); }else {if (timer_pending (&priv->fsync_timer))del_timer_sync (&priv->fsync_timer); - priv->fsync_timer.expires = jiffies +MSECS (priv->ieee80211->fsync_time_interval); + priv->fsync_timer.expires = jiffies + +msecs_to_jiffies (priv->ieee80211->fsync_time_interval);add_timer (&priv->fsync_timer); } }else {@@ -2847,7 +2849,8 @@ static void dm_StartSWFsync(struct net_device *dev) }if (timer_pending (&priv->fsync_timer))del_timer_sync (&priv->fsync_timer); - priv->fsync_timer.expires = jiffies +MSECS (priv->ieee80211->fsync_time_interval); + priv->fsync_timer.expires = jiffies + +msecs_to_jiffies (priv->ieee80211->fsync_time_interval);add_timer (&priv->fsync_timer);write_nic_dword (dev, rOFDM0_RxDetector2,0x465c12cd ); --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160212144041.GA1328%40amitoj-Inspiron-3542.
For more options, visit https://groups.google.com/d/optout.
Quoted 9 lines · Julia Lawall
drivers/staging/rtl8192u/r8192U_dm.c void dm_fsync_timer_callback(unsigned long data) · line 2773
Quoted 3 lines
drivers/staging/rtl8192u/r8192U_dm.c +2
-1- priv->fsync_timer.expires = jiffies +MSECS (priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval); + priv->fsync_timer.expires = jiffies + +msecs_to_jiffies (priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval);You're no worse than before, but maybe there could be some way not to exceed the 80 character limit quite so much. Maybe some subcomputation that could get a meaningful name.
julia
Yes, most of the changes are exceeding the 80 characters limit. To do a subcomputation would be helpful but wouldn't that be a separate patch altogether?
Amitoj
Quoted 9 lines · Amitoj Kaur Chawla
Quoted 8 lines · Julia Lawall
drivers/staging/rtl8192u/r8192U_dm.c void dm_fsync_timer_callback(unsigned long data) · line 2773
Quoted 3 lines
drivers/staging/rtl8192u/r8192U_dm.c +2
-1- priv->fsync_timer.expires = jiffies +MSECS (priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval); + priv->fsync_timer.expires = jiffies + +msecs_to_jiffies (priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval);You're no worse than before, but maybe there could be some way not to exceed the 80 character limit quite so much. Maybe some subcomputation that could get a meaningful name.
Quoted 5 lines
Quoted 1 line
julia
Yes, most of the changes are exceeding the 80 characters limit. To do a subcomputation would be helpful but wouldn't that be a separate patch altogether?
OK.
julia
Quoted 10 lines
Amitoj
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CA%2B5yK5EDZjdokuq0%2Bh%2B2t3%2BzKbTgjc%2BxrnXs%3D2FWz2XhObYSYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.