diff options
author | Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> | 2015-02-19 08:00:56 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-02-26 13:12:40 -0800 |
commit | 7d2b3cf7cfb328cc494cc4775c60bbf5f2fa2ce2 (patch) | |
tree | f9ca87c5830fdcd0e3b83975b3062aae13c811e7 | |
parent | 4fde58bb43512fc283ea76e90d20198da177fb69 (diff) | |
download | op-kernel-dev-7d2b3cf7cfb328cc494cc4775c60bbf5f2fa2ce2.zip op-kernel-dev-7d2b3cf7cfb328cc494cc4775c60bbf5f2fa2ce2.tar.gz |
staging: slicloss: 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: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/slicoss/slicoss.c | 9 |
1 files 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; |