* [PATCH 0/5] replace init_timer by setup_timer
@ 2015-02-19 5:50 Aya Mahfouz
2015-02-19 5:55 ` [PATCH 1/5] staging: wlan-ng: " Aya Mahfouz
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Aya Mahfouz @ 2015-02-19 5:50 UTC (permalink / raw)
To: outreachy-kernel
This patch replaces init_timer and the 2 step initialization of
function and data by setup_timer in 5 different files. This is done to
make the code look more concise. Each file resides in a different driver.
Aya Mahfouz (5):
staging: wlan-ng: replace init_timer by setup_timer
staging: dgnc: replace init_timer by setup_timer
staging: panel: replace init_timer by setup_timer
staging: rtl8192u: ieee80211: replace init_timer by setup_timer
staging: slicloss: replace init_timer by setup_timer
drivers/staging/dgnc/dgnc_driver.c | 8 ++------
drivers/staging/panel/panel.c | 4 +---
.../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 10 ++++------
drivers/staging/slicoss/slicoss.c | 9 +++------
drivers/staging/wlan-ng/hfa384x_usb.c | 19 +++++++------------
5 files changed, 17 insertions(+), 33 deletions(-)
--
1.9.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] staging: wlan-ng: replace init_timer by setup_timer
2015-02-19 5:50 [PATCH 0/5] replace init_timer by setup_timer Aya Mahfouz
@ 2015-02-19 5:55 ` Aya Mahfouz
2015-02-19 5:57 ` [PATCH 2/5] staging: dgnc: " Aya Mahfouz
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Aya Mahfouz @ 2015-02-19 5:55 UTC (permalink / raw)
To: outreachy-kernel
This patch replaces init_timer and the 2 step initialization of function
and data by setup_timer to make the code more concise.
The issue was discovered using the following coccinelle script:
@@
expression ds, e1, e2;
@@
-init_timer (&ds);
+setup_timer (&ds, e1, e2);
...
(
-ds.function = e1;
...
-ds.data = e2;
|
-ds.data = e2;
...
-ds.function = e1;
)
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
drivers/staging/wlan-ng/hfa384x_usb.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 28cd1c4..c85b1b5 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -557,17 +557,13 @@ void hfa384x_create(hfa384x_t *hw, struct usb_device *usb)
INIT_WORK(&hw->link_bh, prism2sta_processing_defer);
INIT_WORK(&hw->usb_work, hfa384x_usb_defer);
- init_timer(&hw->throttle);
- hw->throttle.function = hfa384x_usb_throttlefn;
- hw->throttle.data = (unsigned long)hw;
+ setup_timer(&hw->throttle, hfa384x_usb_throttlefn, (unsigned long)hw);
- init_timer(&hw->resptimer);
- hw->resptimer.function = hfa384x_usbctlx_resptimerfn;
- hw->resptimer.data = (unsigned long)hw;
+ setup_timer(&hw->resptimer, hfa384x_usbctlx_resptimerfn,
+ (unsigned long)hw);
- init_timer(&hw->reqtimer);
- hw->reqtimer.function = hfa384x_usbctlx_reqtimerfn;
- hw->reqtimer.data = (unsigned long)hw;
+ setup_timer(&hw->reqtimer, hfa384x_usbctlx_reqtimerfn,
+ (unsigned long)hw);
usb_init_urb(&hw->rx_urb);
usb_init_urb(&hw->tx_urb);
@@ -577,9 +573,8 @@ void hfa384x_create(hfa384x_t *hw, struct usb_device *usb)
hw->state = HFA384x_STATE_INIT;
INIT_WORK(&hw->commsqual_bh, prism2sta_commsqual_defer);
- init_timer(&hw->commsqual_timer);
- hw->commsqual_timer.data = (unsigned long)hw;
- hw->commsqual_timer.function = prism2sta_commsqual_timer;
+ setup_timer(&hw->commsqual_timer, prism2sta_commsqual_timer,
+ (unsigned long)hw);
}
/*----------------------------------------------------------------
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] staging: dgnc: replace init_timer by setup_timer
2015-02-19 5:50 [PATCH 0/5] replace init_timer by setup_timer Aya Mahfouz
2015-02-19 5:55 ` [PATCH 1/5] staging: wlan-ng: " Aya Mahfouz
@ 2015-02-19 5:57 ` Aya Mahfouz
2015-02-19 5:58 ` [PATCH 3/5] staging: panel: " Aya Mahfouz
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Aya Mahfouz @ 2015-02-19 5:57 UTC (permalink / raw)
To: outreachy-kernel
This patch replaces init_timer and the 2 step initialization of function
and data by setup_timer to make the code more concise.
The issue was discovered using the following coccinelle script:
@@
expression ds, e1, e2;
@@
-init_timer (&ds);
+setup_timer (&ds, e1, e2);
...
(
-ds.function = e1;
...
-ds.data = e2;
|
-ds.data = e2;
...
-ds.function = e1;
)
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
drivers/staging/dgnc/dgnc_driver.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index f177d3a..5d47c61 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -285,9 +285,7 @@ static int dgnc_start(void)
/* Start the poller */
spin_lock_irqsave(&dgnc_poll_lock, flags);
- init_timer(&dgnc_poll_timer);
- dgnc_poll_timer.function = dgnc_poll_handler;
- dgnc_poll_timer.data = 0;
+ setup_timer(&dgnc_poll_timer, dgnc_poll_handler, 0);
dgnc_poll_time = jiffies + dgnc_jiffies_from_ms(dgnc_poll_tick);
dgnc_poll_timer.expires = dgnc_poll_time;
spin_unlock_irqrestore(&dgnc_poll_lock, flags);
@@ -731,9 +729,7 @@ static void dgnc_poll_handler(ulong dummy)
if ((ulong) new_time >= 2 * dgnc_poll_tick)
dgnc_poll_time = jiffies + dgnc_jiffies_from_ms(dgnc_poll_tick);
- init_timer(&dgnc_poll_timer);
- dgnc_poll_timer.function = dgnc_poll_handler;
- dgnc_poll_timer.data = 0;
+ setup_timer(&dgnc_poll_timer, dgnc_poll_handler, 0);
dgnc_poll_timer.expires = dgnc_poll_time;
spin_unlock_irqrestore(&dgnc_poll_lock, flags);
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] staging: panel: replace init_timer by setup_timer
2015-02-19 5:50 [PATCH 0/5] replace init_timer by setup_timer Aya Mahfouz
2015-02-19 5:55 ` [PATCH 1/5] staging: wlan-ng: " Aya Mahfouz
2015-02-19 5:57 ` [PATCH 2/5] staging: dgnc: " Aya Mahfouz
@ 2015-02-19 5:58 ` Aya Mahfouz
2015-02-19 5:59 ` [PATCH 4/5] staging: rtl8192u: ieee80211: " Aya Mahfouz
2015-02-19 6:00 ` [PATCH 5/5] staging: slicloss: " Aya Mahfouz
4 siblings, 0 replies; 6+ messages in thread
From: Aya Mahfouz @ 2015-02-19 5:58 UTC (permalink / raw)
To: outreachy-kernel
This patch replaces init_timer and the 2 step initialization of function
and data by setup_timer to make the code more concise.
The issue was discovered using the following coccinelle script:
@@
expression ds, e1, e2;
@@
-init_timer (&ds);
+setup_timer (&ds, e1, e2);
...
(
-ds.function = e1;
...
-ds.data = e2;
|
-ds.data = e2;
...
-ds.function = e1;
)
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
drivers/staging/panel/panel.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 6ed35b6..4da854c 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -2010,10 +2010,8 @@ static void init_scan_timer(void)
if (scan_timer.function != NULL)
return; /* already started */
- init_timer(&scan_timer);
+ setup_timer(&scan_timer, (void *)&panel_scan_timer, 0);
scan_timer.expires = jiffies + INPUT_POLL_TIME;
- scan_timer.data = 0;
- scan_timer.function = (void *)&panel_scan_timer;
add_timer(&scan_timer);
}
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] staging: rtl8192u: ieee80211: replace init_timer by setup_timer
2015-02-19 5:50 [PATCH 0/5] replace init_timer by setup_timer Aya Mahfouz
` (2 preceding siblings ...)
2015-02-19 5:58 ` [PATCH 3/5] staging: panel: " Aya Mahfouz
@ 2015-02-19 5:59 ` Aya Mahfouz
2015-02-19 6:00 ` [PATCH 5/5] staging: slicloss: " Aya Mahfouz
4 siblings, 0 replies; 6+ messages in thread
From: Aya Mahfouz @ 2015-02-19 5:59 UTC (permalink / raw)
To: outreachy-kernel
This patch replaces init_timer and the 2 step initialization of function
and data by setup_timer to make the code more concise.
The issue was discovered using the following coccinelle script:
@@
expression ds, e1, e2;
@@
-init_timer (&ds);
+setup_timer (&ds, e1, e2);
...
(
-ds.function = e1;
...
-ds.data = e2;
|
-ds.data = e2;
...
-ds.function = e1;
)
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d147187..3a54071 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -2722,13 +2722,11 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
ieee->enable_rx_imm_BA = 1;
ieee->tx_pending.txb = NULL;
- init_timer(&ieee->associate_timer);
- ieee->associate_timer.data = (unsigned long)ieee;
- ieee->associate_timer.function = ieee80211_associate_abort_cb;
+ setup_timer(&ieee->associate_timer, ieee80211_associate_abort_cb,
+ (unsigned long)ieee);
- init_timer(&ieee->beacon_timer);
- ieee->beacon_timer.data = (unsigned long) ieee;
- ieee->beacon_timer.function = ieee80211_send_beacon_cb;
+ setup_timer(&ieee->beacon_timer, ieee80211_send_beacon_cb,
+ (unsigned long)ieee);
ieee->wq = create_workqueue(DRV_NAME);
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] staging: slicloss: replace init_timer by setup_timer
2015-02-19 5:50 [PATCH 0/5] replace init_timer by setup_timer Aya Mahfouz
` (3 preceding siblings ...)
2015-02-19 5:59 ` [PATCH 4/5] staging: rtl8192u: ieee80211: " Aya Mahfouz
@ 2015-02-19 6:00 ` Aya Mahfouz
4 siblings, 0 replies; 6+ messages in thread
From: Aya Mahfouz @ 2015-02-19 6:00 UTC (permalink / raw)
To: outreachy-kernel
This patch replaces init_timer and the 2 step initialization of function
and data by setup_timer to make the code more concise.
The issue was discovered using the following coccinelle script:
@@
expression ds, e1, e2;
@@
-init_timer (&ds);
+setup_timer (&ds, e1, e2);
...
(
-ds.function = e1;
...
-ds.data = e2;
|
-ds.data = e2;
...
-ds.function = e1;
)
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
drivers/staging/slicoss/slicoss.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 42d62ef..1248f62 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -2362,22 +2362,19 @@ static int slic_if_init(struct adapter *adapter)
adapter->state = ADAPT_UP;
if (!card->loadtimerset) {
- init_timer(&card->loadtimer);
+ setup_timer(&card->loadtimer, &slic_timer_load_check,
+ (ulong)card);
card->loadtimer.expires =
jiffies + (SLIC_LOADTIMER_PERIOD * HZ);
- card->loadtimer.data = (ulong) card;
- card->loadtimer.function = &slic_timer_load_check;
add_timer(&card->loadtimer);
card->loadtimerset = 1;
}
if (!adapter->pingtimerset) {
- init_timer(&adapter->pingtimer);
+ setup_timer(&adapter->pingtimer, &slic_timer_ping, (ulong)dev);
adapter->pingtimer.expires =
jiffies + (PING_TIMER_INTERVAL * HZ);
- adapter->pingtimer.data = (ulong) dev;
- adapter->pingtimer.function = &slic_timer_ping;
add_timer(&adapter->pingtimer);
adapter->pingtimerset = 1;
adapter->card->pingstatus = ISR_PINGMASK;
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-02-19 6:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-19 5:50 [PATCH 0/5] replace init_timer by setup_timer Aya Mahfouz
2015-02-19 5:55 ` [PATCH 1/5] staging: wlan-ng: " Aya Mahfouz
2015-02-19 5:57 ` [PATCH 2/5] staging: dgnc: " Aya Mahfouz
2015-02-19 5:58 ` [PATCH 3/5] staging: panel: " Aya Mahfouz
2015-02-19 5:59 ` [PATCH 4/5] staging: rtl8192u: ieee80211: " Aya Mahfouz
2015-02-19 6:00 ` [PATCH 5/5] staging: slicloss: " Aya Mahfouz
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.