Commit 4fde58bb authored by Aya Mahfouz's avatar Aya Mahfouz Committed by Greg Kroah-Hartman

staging: rtl8192u: ieee80211: replace init_timer by setup_timer

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: default avatarAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f6e36c5
...@@ -2722,13 +2722,11 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee) ...@@ -2722,13 +2722,11 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
ieee->enable_rx_imm_BA = 1; ieee->enable_rx_imm_BA = 1;
ieee->tx_pending.txb = NULL; ieee->tx_pending.txb = NULL;
init_timer(&ieee->associate_timer); setup_timer(&ieee->associate_timer, ieee80211_associate_abort_cb,
ieee->associate_timer.data = (unsigned long)ieee; (unsigned long)ieee);
ieee->associate_timer.function = ieee80211_associate_abort_cb;
init_timer(&ieee->beacon_timer); setup_timer(&ieee->beacon_timer, ieee80211_send_beacon_cb,
ieee->beacon_timer.data = (unsigned long) ieee; (unsigned long)ieee);
ieee->beacon_timer.function = ieee80211_send_beacon_cb;
ieee->wq = create_workqueue(DRV_NAME); ieee->wq = create_workqueue(DRV_NAME);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment