linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4 v2] staging: ipath: ipath_driver: Use setup_timer
@ 2015-10-25 10:17 Muhammad Falak R Wani
  2015-10-25 10:17 ` [PATCH 2/4 v2] staging: ipath: ipath_init_chip: " Muhammad Falak R Wani
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Muhammad Falak R Wani @ 2015-10-25 10:17 UTC (permalink / raw)
  To: Mike Marciniszyn, Doug Ledford, Sean Hefty, Hal Rosenstock,
	Greg Kroah-Hartman, linux-rdma, devel, linux-kernel
  Cc: Muhammad Falak R Wani

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>
---
v2 changes:
	-> Change the subject line to a be more specific
	-> Add details about coccinelle in the commit log

mfrw

 drivers/staging/rdma/ipath/ipath_driver.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rdma/ipath/ipath_driver.c b/drivers/staging/rdma/ipath/ipath_driver.c
index 46d9898..577704a 100644
--- a/drivers/staging/rdma/ipath/ipath_driver.c
+++ b/drivers/staging/rdma/ipath/ipath_driver.c
@@ -2307,10 +2307,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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-27 14:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-25 10:17 [PATCH 1/4 v2] staging: ipath: ipath_driver: Use setup_timer Muhammad Falak R Wani
2015-10-25 10:17 ` [PATCH 2/4 v2] staging: ipath: ipath_init_chip: " Muhammad Falak R Wani
2015-10-25 10:17 ` [PATCH 3/4 v2] staging: ipath: ipath_sdma: " Muhammad Falak R Wani
2015-10-25 10:17 ` [PATCH 4/4 v2] staging: ipath: ipath_verbs: " Muhammad Falak R Wani
2015-10-25 11:21 ` [PATCH 1/4 v2] staging: ipath: ipath_driver: " Leon Romanovsky
2015-10-27  9:19   ` Dan Carpenter
2015-10-27  9:45     ` Leon Romanovsky
2015-10-27 11:10       ` Dan Carpenter
2015-10-27 14:12         ` Muhammad Falak R Wani

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).