* [PATCH 0/27] Use setup_timer
@ 2014-12-26 14:35 Julia Lawall
2014-12-26 14:35 ` [PATCH 8/27] wireless: cw1200: " Julia Lawall
` (11 more replies)
0 siblings, 12 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: wil6210
Cc: kernel-janitors, linux-wireless, netdev, linux-kernel,
linux-media, linux-usb
These patches group a call to init_timer and initialization of the function
and data fields into a call to setup_timer. Is there is no initialization
of the data field before add_timer is called, the the data value is set to
0UL. If the data value has a cast to something other than unsigned long,
it is changes to a cast to unsigned long, which is the type of the data
field.
The semantic patch that performs this change is shown below
(http://coccinelle.lip6.fr/). This semantic patch is fairly restrictive on
what appears between the init_timer call and the two field initializations,
to ensure that the there is no code that the initializations depend on.
// <smpl>
@@
expression t,d,f,e1,e2;
identifier x1,x2;
statement S1,S2;
@@
(
-t.data = d;
|
-t.function = f;
|
-init_timer(&t);
+setup_timer(&t,f,d);
|
-init_timer_on_stack(&t);
+setup_timer_on_stack(&t,f,d);
)
<... when != S1
t.x1 = e1;
...>
(
-t.data = d;
|
-t.function = f;
|
-init_timer(&t);
+setup_timer(&t,f,d);
|
-init_timer_on_stack(&t);
+setup_timer_on_stack(&t,f,d);
)
<... when != S2
t.x2 = e2;
...>
(
-t.data = d;
|
-t.function = f;
|
-init_timer(&t);
+setup_timer(&t,f,d);
|
-init_timer_on_stack(&t);
+setup_timer_on_stack(&t,f,d);
)
// ----------------------
@@
expression t,d,f,e1,e2;
identifier x1,x2;
statement S1,S2;
@@
(
-t->data = d;
|
-t->function = f;
|
-init_timer(t);
+setup_timer(t,f,d);
|
-init_timer_on_stack(t);
+setup_timer_on_stack(t,f,d);
)
<... when != S1
t->x1 = e1;
...>
(
-t->data = d;
|
-t->function = f;
|
-init_timer(t);
+setup_timer(t,f,d);
|
-init_timer_on_stack(t);
+setup_timer_on_stack(t,f,d);
)
<... when != S2
t->x2 = e2;
...>
(
-t->data = d;
|
-t->function = f;
|
-init_timer(t);
+setup_timer(t,f,d);
|
-init_timer_on_stack(t);
+setup_timer_on_stack(t,f,d);
)
// ---------------------------------------------------------------------
// no initialization of data field
@@
expression t,d1,d2,f;
@@
(
-init_timer(&t);
+setup_timer(&t,f,0UL);
|
-init_timer_on_stack(&t);
+setup_timer_on_stack(&t,f,0UL);
)
... when != t.data = d1;
-t.function = f;
... when != t.data = d2;
add_timer(&t);
@@
expression t,d,f,fn;
type T;
@@
-t.function = f;
... when != t.data
when != fn(...,(T)t,...)
(
-init_timer(&t);
+setup_timer(&t,f,d);
|
-init_timer_on_stack(&t);
+setup_timer_on_stack(&t,f,0UL);
)
... when != t.data = d;
add_timer(&t);
// ----------------------
@@
expression t,d1,d2,f;
@@
(
-init_timer(t);
+setup_timer(t,f,0UL);
|
-init_timer_on_stack(t);
+setup_timer_on_stack(t,f,0UL);
)
... when != t->data = d1;
-t->function = f;
... when != t->data = d2;
add_timer(t);
@@
expression t,d,f,fn;
type T;
@@
-t->function = f;
... when != t.data
when != fn(...,(T)t,...)
(
-init_timer(t);
+setup_timer(t,f,d);
|
-init_timer_on_stack(t);
+setup_timer_on_stack(t,f,0UL);
)
... when != t->data = d;
add_timer(t);
// ---------------------------------------------------------------------
// change data field type
@@
expression d;
type T;
@@
(
setup_timer
|
setup_timer_on_stack
)
(...,
(
(unsigned long)d
|
- (T)
+ (unsigned long)
d
)
)
// </smpl>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 8/27] wireless: cw1200: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2015-01-07 17:53 ` Kalle Valo
2014-12-26 14:35 ` [PATCH 7/27] cw1200: main: " Julia Lawall
` (10 subsequent siblings)
11 siblings, 1 reply; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Solomon Peachy
Cc: kernel-janitors, Kalle Valo, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/cw1200/pm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/cw1200/pm.c b/drivers/net/wireless/cw1200/pm.c
index 6907c8f..d2202ae 100644
--- a/drivers/net/wireless/cw1200/pm.c
+++ b/drivers/net/wireless/cw1200/pm.c
@@ -101,9 +101,8 @@ int cw1200_pm_init(struct cw1200_pm_state *pm,
{
spin_lock_init(&pm->lock);
- init_timer(&pm->stay_awake);
- pm->stay_awake.data = (unsigned long)pm;
- pm->stay_awake.function = cw1200_pm_stay_awake_tmo;
+ setup_timer(&pm->stay_awake, cw1200_pm_stay_awake_tmo,
+ (unsigned long)pm);
return 0;
}
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 7/27] cw1200: main: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
2014-12-26 14:35 ` [PATCH 8/27] wireless: cw1200: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 6/27] cw1200: queue: " Julia Lawall
` (9 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Solomon Peachy
Cc: kernel-janitors, Kalle Valo, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/cw1200/main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/cw1200/main.c b/drivers/net/wireless/cw1200/main.c
index 3e78cc3..fa965ee 100644
--- a/drivers/net/wireless/cw1200/main.c
+++ b/drivers/net/wireless/cw1200/main.c
@@ -374,9 +374,8 @@ static struct ieee80211_hw *cw1200_init_common(const u8 *macaddr,
INIT_WORK(&priv->update_filtering_work, cw1200_update_filtering_work);
INIT_WORK(&priv->set_beacon_wakeup_period_work,
cw1200_set_beacon_wakeup_period_work);
- init_timer(&priv->mcast_timeout);
- priv->mcast_timeout.data = (unsigned long)priv;
- priv->mcast_timeout.function = cw1200_mcast_timeout;
+ setup_timer(&priv->mcast_timeout, cw1200_mcast_timeout,
+ (unsigned long)priv);
if (cw1200_queue_stats_init(&priv->tx_queue_stats,
CW1200_LINK_ID_MAX,
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 6/27] cw1200: queue: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
2014-12-26 14:35 ` [PATCH 8/27] wireless: cw1200: " Julia Lawall
2014-12-26 14:35 ` [PATCH 7/27] cw1200: main: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 13/27] iwlwifi: dvm: tt: " Julia Lawall
` (8 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Solomon Peachy
Cc: kernel-janitors, Kalle Valo, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/cw1200/queue.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/wireless/cw1200/queue.c b/drivers/net/wireless/cw1200/queue.c
index 9c3925f..0ba5ef9 100644
--- a/drivers/net/wireless/cw1200/queue.c
+++ b/drivers/net/wireless/cw1200/queue.c
@@ -179,9 +179,7 @@ int cw1200_queue_init(struct cw1200_queue *queue,
INIT_LIST_HEAD(&queue->pending);
INIT_LIST_HEAD(&queue->free_pool);
spin_lock_init(&queue->lock);
- init_timer(&queue->gc);
- queue->gc.data = (unsigned long)queue;
- queue->gc.function = cw1200_queue_gc;
+ setup_timer(&queue->gc, cw1200_queue_gc, (unsigned long)queue);
queue->pool = kzalloc(sizeof(struct cw1200_queue_item) * capacity,
GFP_KERNEL);
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 13/27] iwlwifi: dvm: tt: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (2 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 6/27] cw1200: queue: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 12/27] iwlwifi: dvm: main: " Julia Lawall
` (7 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Johannes Berg
Cc: kernel-janitors, Emmanuel Grumbach, Intel Linux Wireless,
Kalle Valo, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/iwlwifi/dvm/tt.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/dvm/tt.c b/drivers/net/wireless/iwlwifi/dvm/tt.c
index acb981a..c4736c8 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tt.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tt.c
@@ -612,15 +612,10 @@ void iwl_tt_initialize(struct iwl_priv *priv)
memset(tt, 0, sizeof(struct iwl_tt_mgmt));
tt->state = IWL_TI_0;
- init_timer(&priv->thermal_throttle.ct_kill_exit_tm);
- priv->thermal_throttle.ct_kill_exit_tm.data = (unsigned long)priv;
- priv->thermal_throttle.ct_kill_exit_tm.function =
- iwl_tt_check_exit_ct_kill;
- init_timer(&priv->thermal_throttle.ct_kill_waiting_tm);
- priv->thermal_throttle.ct_kill_waiting_tm.data =
- (unsigned long)priv;
- priv->thermal_throttle.ct_kill_waiting_tm.function =
- iwl_tt_ready_for_ct_kill;
+ setup_timer(&priv->thermal_throttle.ct_kill_exit_tm,
+ iwl_tt_check_exit_ct_kill, (unsigned long)priv);
+ setup_timer(&priv->thermal_throttle.ct_kill_waiting_tm,
+ iwl_tt_ready_for_ct_kill, (unsigned long)priv);
/* setup deferred ct kill work */
INIT_WORK(&priv->tt_work, iwl_bg_tt_work);
INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter);
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 12/27] iwlwifi: dvm: main: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (3 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 13/27] iwlwifi: dvm: tt: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-27 19:55 ` Grumbach, Emmanuel
2014-12-26 14:35 ` [PATCH 16/27] ath6kl: " Julia Lawall
` (6 subsequent siblings)
11 siblings, 1 reply; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Johannes Berg
Cc: kernel-janitors, Emmanuel Grumbach, Intel Linux Wireless,
Kalle Valo, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/iwlwifi/dvm/main.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index 0b7f46f..75ec691 100644
--- a/drivers/net/wireless/iwlwifi/dvm/main.c
+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
@@ -1011,13 +1011,11 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
if (priv->lib->bt_params)
iwlagn_bt_setup_deferred_work(priv);
- init_timer(&priv->statistics_periodic);
- priv->statistics_periodic.data = (unsigned long)priv;
- priv->statistics_periodic.function = iwl_bg_statistics_periodic;
+ setup_timer(&priv->statistics_periodic, iwl_bg_statistics_periodic,
+ (unsigned long)priv);
- init_timer(&priv->ucode_trace);
- priv->ucode_trace.data = (unsigned long)priv;
- priv->ucode_trace.function = iwl_bg_ucode_trace;
+ setup_timer(&priv->ucode_trace, iwl_bg_ucode_trace,
+ (unsigned long)priv);
}
void iwl_cancel_deferred_work(struct iwl_priv *priv)
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 16/27] ath6kl: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (4 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 12/27] iwlwifi: dvm: main: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 18/27] iwl4965: " Julia Lawall
` (5 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Kalle Valo; +Cc: kernel-janitors, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/ath/ath6kl/txrx.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index 40432fe..3bc3aa7 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -1757,9 +1757,7 @@ void aggr_conn_init(struct ath6kl_vif *vif, struct aggr_info *aggr_info,
aggr_conn->aggr_sz = AGGR_SZ_DEFAULT;
aggr_conn->dev = vif->ndev;
- init_timer(&aggr_conn->timer);
- aggr_conn->timer.function = aggr_timeout;
- aggr_conn->timer.data = (unsigned long) aggr_conn;
+ setup_timer(&aggr_conn->timer, aggr_timeout, (unsigned long)aggr_conn);
aggr_conn->aggr_info = aggr_info;
aggr_conn->timer_scheduled = false;
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 18/27] iwl4965: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (5 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 16/27] ath6kl: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 17/27] iwl3945: " Julia Lawall
` (4 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: kernel-janitors, Kalle Valo, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 2748fde..976f65f 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -6247,13 +6247,10 @@ il4965_setup_deferred_work(struct il_priv *il)
INIT_WORK(&il->txpower_work, il4965_bg_txpower_work);
- init_timer(&il->stats_periodic);
- il->stats_periodic.data = (unsigned long)il;
- il->stats_periodic.function = il4965_bg_stats_periodic;
+ setup_timer(&il->stats_periodic, il4965_bg_stats_periodic,
+ (unsigned long)il);
- init_timer(&il->watchdog);
- il->watchdog.data = (unsigned long)il;
- il->watchdog.function = il_bg_watchdog;
+ setup_timer(&il->watchdog, il_bg_watchdog, (unsigned long)il);
tasklet_init(&il->irq_tasklet,
(void (*)(unsigned long))il4965_irq_tasklet,
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 17/27] iwl3945: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (6 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 18/27] iwl4965: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 24/27] orinoco_usb: " Julia Lawall
` (3 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: kernel-janitors, Kalle Valo, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index dc1d20c..e566580 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3429,9 +3429,7 @@ il3945_setup_deferred_work(struct il_priv *il)
il3945_hw_setup_deferred_work(il);
- init_timer(&il->watchdog);
- il->watchdog.data = (unsigned long)il;
- il->watchdog.function = il_bg_watchdog;
+ setup_timer(&il->watchdog, il_bg_watchdog, (unsigned long)il);
tasklet_init(&il->irq_tasklet,
(void (*)(unsigned long))il3945_irq_tasklet,
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 24/27] orinoco_usb: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (7 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 17/27] iwl3945: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 27/27] mwifiex: main: " Julia Lawall
` (2 subsequent siblings)
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Kalle Valo; +Cc: kernel-janitors, linux-wireless, netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/orinoco/orinoco_usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c
index 9958464..61612a6 100644
--- a/drivers/net/wireless/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/orinoco/orinoco_usb.c
@@ -364,9 +364,7 @@ static struct request_context *ezusb_alloc_ctx(struct ezusb_priv *upriv,
atomic_set(&ctx->refcount, 1);
init_completion(&ctx->done);
- init_timer(&ctx->timer);
- ctx->timer.function = ezusb_request_timerfn;
- ctx->timer.data = (u_long) ctx;
+ setup_timer(&ctx->timer, ezusb_request_timerfn, (u_long)ctx);
return ctx;
}
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 27/27] mwifiex: main: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (8 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 24/27] orinoco_usb: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 26/27] mwifiex: 11n_rxreorder: " Julia Lawall
2014-12-26 14:35 ` [PATCH 25/27] mwifiex: tdls: " Julia Lawall
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: kernel-janitors, Avinash Patil, Kalle Valo, linux-wireless,
netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/mwifiex/main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index d4d2223..53f4202 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -83,9 +83,8 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
}
mwifiex_init_lock_list(adapter);
- init_timer(&adapter->cmd_timer);
- adapter->cmd_timer.function = mwifiex_cmd_timeout_func;
- adapter->cmd_timer.data = (unsigned long) adapter;
+ setup_timer(&adapter->cmd_timer, mwifiex_cmd_timeout_func,
+ (unsigned long)adapter);
return 0;
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 26/27] mwifiex: 11n_rxreorder: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (9 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 27/27] mwifiex: main: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
2014-12-26 14:35 ` [PATCH 25/27] mwifiex: tdls: " Julia Lawall
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: kernel-janitors, Avinash Patil, Kalle Valo, linux-wireless,
netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/mwifiex/11n_rxreorder.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index d73fda3..f33dc81 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -391,10 +391,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
new_node->timer_context.priv = priv;
new_node->timer_context.timer_is_set = false;
- init_timer(&new_node->timer_context.timer);
- new_node->timer_context.timer.function = mwifiex_flush_data;
- new_node->timer_context.timer.data =
- (unsigned long) &new_node->timer_context;
+ setup_timer(&new_node->timer_context.timer, mwifiex_flush_data,
+ (unsigned long)&new_node->timer_context);
for (i = 0; i < win_size; ++i)
new_node->rx_reorder_ptr[i] = NULL;
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 25/27] mwifiex: tdls: Use setup_timer
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
` (10 preceding siblings ...)
2014-12-26 14:35 ` [PATCH 26/27] mwifiex: 11n_rxreorder: " Julia Lawall
@ 2014-12-26 14:35 ` Julia Lawall
11 siblings, 0 replies; 15+ messages in thread
From: Julia Lawall @ 2014-12-26 14:35 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: kernel-janitors, Avinash Patil, Kalle Valo, linux-wireless,
netdev, linux-kernel
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/mwifiex/tdls.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/tdls.c b/drivers/net/wireless/mwifiex/tdls.c
index 22884b4..5a64681 100644
--- a/drivers/net/wireless/mwifiex/tdls.c
+++ b/drivers/net/wireless/mwifiex/tdls.c
@@ -1367,9 +1367,8 @@ void mwifiex_check_auto_tdls(unsigned long context)
void mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv)
{
- init_timer(&priv->auto_tdls_timer);
- priv->auto_tdls_timer.function = mwifiex_check_auto_tdls;
- priv->auto_tdls_timer.data = (unsigned long)priv;
+ setup_timer(&priv->auto_tdls_timer, mwifiex_check_auto_tdls,
+ (unsigned long)priv);
priv->auto_tdls_timer_active = true;
mod_timer(&priv->auto_tdls_timer,
jiffies + msecs_to_jiffies(MWIFIEX_TIMER_10S));
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 12/27] iwlwifi: dvm: main: Use setup_timer
2014-12-26 14:35 ` [PATCH 12/27] iwlwifi: dvm: main: " Julia Lawall
@ 2014-12-27 19:55 ` Grumbach, Emmanuel
0 siblings, 0 replies; 15+ messages in thread
From: Grumbach, Emmanuel @ 2014-12-27 19:55 UTC (permalink / raw)
To: Julia.Lawall@lip6.fr
Cc: linux-wireless@vger.kernel.org, kvalo@codeaurora.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
ilw@linux.intel.com, Berg, Johannes,
kernel-janitors@vger.kernel.org
T24gRnJpLCAyMDE0LTEyLTI2IGF0IDE1OjM1ICswMTAwLCBKdWxpYSBMYXdhbGwgd3JvdGU6DQo+
IENvbnZlcnQgYSBjYWxsIHRvIGluaXRfdGltZXIgYW5kIGFjY29tcGFueWluZyBpbnRpYWxpemF0
aW9ucyBvZg0KPiB0aGUgdGltZXIncyBkYXRhIGFuZCBmdW5jdGlvbiBmaWVsZHMgdG8gYSBjYWxs
IHRvIHNldHVwX3RpbWVyLg0KPiANCj4gQSBzaW1wbGlmaWVkIHZlcnNpb24gb2YgdGhlIHNlbWFu
dGljIG1hdGNoIHRoYXQgZml4ZXMgdGhpcyBwcm9ibGVtIGlzIGFzDQo+IGZvbGxvd3M6IChodHRw
Oi8vY29jY2luZWxsZS5saXA2LmZyLykNCj4gDQo+IC8vIDxzbXBsPg0KPiBAQA0KPiBleHByZXNz
aW9uIHQsZixkOw0KPiBAQA0KPiANCj4gLWluaXRfdGltZXIoJnQpOw0KPiArc2V0dXBfdGltZXIo
JnQsZixkKTsNCj4gLXQuZGF0YSA9IGQ7DQo+IC10LmZ1bmN0aW9uID0gZjsNCj4gLy8gPC9zbXBs
Pg0KPiANCj4gU2lnbmVkLW9mZi1ieTogSnVsaWEgTGF3YWxsIDxKdWxpYS5MYXdhbGxAbGlwNi5m
cj4NCj4gDQoNCkJvdGggYXBwbGllZCAtIHRoYW5rcy4NCg==
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 8/27] wireless: cw1200: Use setup_timer
2014-12-26 14:35 ` [PATCH 8/27] wireless: cw1200: " Julia Lawall
@ 2015-01-07 17:53 ` Kalle Valo
0 siblings, 0 replies; 15+ messages in thread
From: Kalle Valo @ 2015-01-07 17:53 UTC (permalink / raw)
To: Julia Lawall
Cc: Solomon Peachy, kernel-janitors, linux-wireless, netdev,
linux-kernel
Julia Lawall <Julia.Lawall@lip6.fr> writes:
> Convert a call to init_timer and accompanying intializations of
> the timer's data and function fields to a call to setup_timer.
>
> A simplified version of the semantic match that fixes this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression t,f,d;
> @@
>
> -init_timer(&t);
> +setup_timer(&t,f,d);
> -t.data = d;
> -t.function = f;
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Thanks, I applied the wireless-drivers patches below to
wireless-drivers-next.git.
e4a1c3f88e65 mwifiex: 11n_rxreorder: Use setup_timer
c6c33e772407 mwifiex: main: Use setup_timer
99a1b74395a5 orinoco_usb: Use setup_timer
1a94ace406ad iwl3945: Use setup_timer
af68b87f7211 iwl4965: Use setup_timer
0be01bf29721 cw1200: queue: Use setup_timer
dabefea6937d cw1200: main: Use setup_timer
983988ec0a24 wireless: cw1200: Use setup_timer
--
Kalle Valo
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2015-01-07 17:54 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-26 14:35 [PATCH 0/27] Use setup_timer Julia Lawall
2014-12-26 14:35 ` [PATCH 8/27] wireless: cw1200: " Julia Lawall
2015-01-07 17:53 ` Kalle Valo
2014-12-26 14:35 ` [PATCH 7/27] cw1200: main: " Julia Lawall
2014-12-26 14:35 ` [PATCH 6/27] cw1200: queue: " Julia Lawall
2014-12-26 14:35 ` [PATCH 13/27] iwlwifi: dvm: tt: " Julia Lawall
2014-12-26 14:35 ` [PATCH 12/27] iwlwifi: dvm: main: " Julia Lawall
2014-12-27 19:55 ` Grumbach, Emmanuel
2014-12-26 14:35 ` [PATCH 16/27] ath6kl: " Julia Lawall
2014-12-26 14:35 ` [PATCH 18/27] iwl4965: " Julia Lawall
2014-12-26 14:35 ` [PATCH 17/27] iwl3945: " Julia Lawall
2014-12-26 14:35 ` [PATCH 24/27] orinoco_usb: " Julia Lawall
2014-12-26 14:35 ` [PATCH 27/27] mwifiex: main: " Julia Lawall
2014-12-26 14:35 ` [PATCH 26/27] mwifiex: 11n_rxreorder: " Julia Lawall
2014-12-26 14:35 ` [PATCH 25/27] mwifiex: tdls: " Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).