staging: ipath: ipath_driver: Use setup_timer
authorMuhammad Falak R Wani <falakreyaz@gmail.com>
Sun, 25 Oct 2015 10:17:30 +0000 (15:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Oct 2015 19:09:16 +0000 (04:09 +0900)
Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.
The simplified semantic patch used is :-
<smpl>

@timer@
expression e1,e2,e3,fn_ptr;
@@
-init_timer(&e1);
+setup_timer(&e1, fn_ptr, e2);
... when != fn_ptr = e3
-e1.function = fn_ptr;
-e1.data = e2;

</smpl>

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rdma/ipath/ipath_driver.c

index dfcfaa5e811ef6f375c62fb6bd558115df70f94b..2ab22f98e3ba0e81a7d8968aabf97d7601be2d8b 100644 (file)
@@ -2306,10 +2306,9 @@ void ipath_set_led_override(struct ipath_devdata *dd, unsigned int val)
         */
        if (atomic_inc_return(&dd->ipath_led_override_timer_active) == 1) {
                /* Need to start timer */
-               init_timer(&dd->ipath_led_override_timer);
-               dd->ipath_led_override_timer.function =
-                                                ipath_run_led_override;
-               dd->ipath_led_override_timer.data = (unsigned long) dd;
+               setup_timer(&dd->ipath_led_override_timer,
+                               ipath_run_led_override, (unsigned long)dd);
+
                dd->ipath_led_override_timer.expires = jiffies + 1;
                add_timer(&dd->ipath_led_override_timer);
        } else