* [PATCH 5/6] staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies
@ 2016-02-12 14:40 Amitoj Kaur Chawla
2016-02-12 14:52 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-12 14:40 UTC (permalink / raw
To: outreachy-kernel
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 <amitoj1606@gmail.com>
---
drivers/staging/rtl8192u/r8192U_dm.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 9b58b1a..d2e86b9 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -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);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH 5/6] staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies
2016-02-12 14:40 [PATCH 5/6] staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies Amitoj Kaur Chawla
@ 2016-02-12 14:52 ` Julia Lawall
2016-02-12 15:35 ` Amitoj Kaur Chawla
0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2016-02-12 14:52 UTC (permalink / raw
To: Amitoj Kaur Chawla; +Cc: outreachy-kernel
On Fri, 12 Feb 2016, Amitoj Kaur Chawla wrote:
> 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 <amitoj1606@gmail.com>
> ---
> drivers/staging/rtl8192u/r8192U_dm.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
> index 9b58b1a..d2e86b9 100644
> --- a/drivers/staging/rtl8192u/r8192U_dm.c
> +++ b/drivers/staging/rtl8192u/r8192U_dm.c
> @@ -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
> 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);
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH 5/6] staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies
2016-02-12 14:52 ` [Outreachy kernel] " Julia Lawall
@ 2016-02-12 15:35 ` Amitoj Kaur Chawla
2016-02-12 15:37 ` Julia Lawall
0 siblings, 1 reply; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-12 15:35 UTC (permalink / raw
To: Julia Lawall; +Cc: outreachy-kernel
On Fri, Feb 12, 2016 at 8:22 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> - 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH 5/6] staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies
2016-02-12 15:35 ` Amitoj Kaur Chawla
@ 2016-02-12 15:37 ` Julia Lawall
0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2016-02-12 15:37 UTC (permalink / raw
To: Amitoj Kaur Chawla; +Cc: Julia Lawall, outreachy-kernel
On Fri, 12 Feb 2016, Amitoj Kaur Chawla wrote:
> On Fri, Feb 12, 2016 at 8:22 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >> - 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?
OK.
julia
>
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-12 15:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 14:40 [PATCH 5/6] staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies Amitoj Kaur Chawla
2016-02-12 14:52 ` [Outreachy kernel] " Julia Lawall
2016-02-12 15:35 ` Amitoj Kaur Chawla
2016-02-12 15:37 ` Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.