Skip to contentSkip to conversation

Staging: rtl8192u: Eliminate use of MSECS macro

PATCH In review Shraddha Barke 2 participants 5 messages Oct 21, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8192u: Eliminate use of MSECS macro

Use msecs_to_jiffies instead of driver specific macro MSECS. This is done using Coccinelle and semantic patch used for this is as follows:

@@expression t;@@

- MSECS(t)
+ msecs_to_jiffies(t)

---
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index 678ecf6..e06864f 100644
@@ -3516,7 +3516,7 @@ static void watch_dog_timer_callback(unsigned long data)
 
 	queue_delayed_work(priv->priv_wq, &priv->watch_dog_wq, 0);
 	mod_timer(&priv->watch_dog_timer,
-		  jiffies + MSECS(IEEE80211_WATCH_DOG_TIME));
+		  jiffies + msecs_to_jiffies(IEEE80211_WATCH_DOG_TIME));
 }
 static int _rtl8192_up(struct net_device *dev)
 {
Signature · 1 line
2.1.4
#1 lore raw
Quoted 8 lines · Shraddha Barke

Use msecs_to_jiffies instead of driver specific macro MSECS. This is done using Coccinelle and semantic patch used for this is as follows:

@@expression t;@@

- MSECS(t)
+ msecs_to_jiffies(t)

Can you now get rid of the marco?

julia

Quoted 29 lines
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/r8192U_core.c +1 -2
index 678ecf6..e06864f 100644
@@ -3516,7 +3516,7 @@ static void watch_dog_timer_callback(unsigned long data)
 
 	queue_delayed_work(priv->priv_wq, &priv->watch_dog_wq, 0);
 	mod_timer(&priv->watch_dog_timer,
-		  jiffies + MSECS(IEEE80211_WATCH_DOG_TIME));
+		  jiffies + msecs_to_jiffies(IEEE80211_WATCH_DOG_TIME));
 }
 static int _rtl8192_up(struct net_device *dev)
 {
--

2.1.4

--
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/1445438958-7663-1-git-send-email-shraddha.6596%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 6 lines · Julia Lawall
Quoted 4 lines · Shraddha Barke

Use msecs_to_jiffies instead of driver specific macro MSECS. This is done using Coccinelle and semantic patch used for this is as follows:

Quoted 6 lines
Quoted 4 lines

@@expression t;@@

- MSECS(t)
+ msecs_to_jiffies(t)

Can you now get rid of the marco?

This change has been made in rtl8192e and rtl8188e. I'm a bit confused as to whether it can be made in this driver as well and if not why?

Thanks,

Shraddha

Quoted 34 lines

julia

Quoted 29 lines
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/r8192U_core.c +1 -2
index 678ecf6..e06864f 100644
@@ -3516,7 +3516,7 @@ static void watch_dog_timer_callback(unsigned long data)
 
 	queue_delayed_work(priv->priv_wq, &priv->watch_dog_wq, 0);
 	mod_timer(&priv->watch_dog_timer,
-		  jiffies + MSECS(IEEE80211_WATCH_DOG_TIME));
+		  jiffies + msecs_to_jiffies(IEEE80211_WATCH_DOG_TIME));
 }
 static int _rtl8192_up(struct net_device *dev)
 {
--

2.1.4

--
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/1445438958-7663-1-git-send-email-shraddha.6596%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 12 lines · Shraddha Barke
Quoted 8 lines · Julia Lawall
Quoted 6 lines · Shraddha Barke

Use msecs_to_jiffies instead of driver specific macro MSECS. This is done using Coccinelle and semantic patch used for this is as follows:

@@expression t;@@

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

- MSECS(t)
+ msecs_to_jiffies(t)

Can you now get rid of the marco?

This change has been made in rtl8192e and rtl8188e. I'm a bit confused as to whether it can be made in this driver as well and if not why?

Not sure to understand the question. I wasn't suggesting that there was a problem with the change. I meant that maybe you could now get rid of the definition as well?

julia

Quoted 44 lines

Thanks,

Shraddha

Quoted 39 lines

julia

Quoted 34 lines
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index 678ecf6..e06864f 100644
@@ -3516,7 +3516,7 @@ static void watch_dog_timer_callback(unsigned long
 data)
 
 	queue_delayed_work(priv->priv_wq, &priv->watch_dog_wq, 0);
 	mod_timer(&priv->watch_dog_timer,
-		  jiffies + MSECS(IEEE80211_WATCH_DOG_TIME));
+		  jiffies + msecs_to_jiffies(IEEE80211_WATCH_DOG_TIME));
 }
 static int _rtl8192_up(struct net_device *dev)

{
--
2.1.4

--
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/1445438958-7663-1-git-send-email-shraddha.6596%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw
Quoted 19 lines · Julia Lawall
Quoted 15 lines · Shraddha Barke
Quoted 11 lines · Julia Lawall
Quoted 8 lines · Shraddha Barke

Use msecs_to_jiffies instead of driver specific macro MSECS. This is done using Coccinelle and semantic patch used for this is as follows:

@@expression t;@@

- MSECS(t)
+ msecs_to_jiffies(t)

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Can you now get rid of the marco?

This change has been made in rtl8192e and rtl8188e. I'm a bit confused as to whether it can be made in this driver as well and if not why?

Not sure to understand the question. I wasn't suggesting that there was a problem with the change. I meant that maybe you could now get rid of the definition as well?

Oh! I'm sorry I misunderstood the question. The macro is used at some other places , once I change them too, I can get rid of the definition :)

Quoted 49 lines

julia

Quoted 44 lines

Thanks,

Shraddha

Quoted 39 lines

julia

Quoted 34 lines
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index 678ecf6..e06864f 100644
@@ -3516,7 +3516,7 @@ static void watch_dog_timer_callback(unsigned long
 data)
 
 	queue_delayed_work(priv->priv_wq, &priv->watch_dog_wq, 0);
 	mod_timer(&priv->watch_dog_timer,
-		  jiffies + MSECS(IEEE80211_WATCH_DOG_TIME));
+		  jiffies + msecs_to_jiffies(IEEE80211_WATCH_DOG_TIME));
 }
 static int _rtl8192_up(struct net_device *dev)

{
--
2.1.4

--
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/1445438958-7663-1-git-send-email-shraddha.6596%40gmail.com.
For more options, visit https://groups.google.com/d/optout.