Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1255340 > unrolled thread

[PATCH 2/3] staging: hfi1: driver: Use setup_timer

Started byMuhammad Falak R Wani <falakreyaz@gmail.com>
First post2015-10-25 11:40 +0100
Last post2015-10-25 11:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] staging: hfi1: driver: Use setup_timer Muhammad Falak R Wani <falakreyaz@gmail.com> - 2015-10-25 11:40 +0100

#1255340 — [PATCH 2/3] staging: hfi1: driver: Use setup_timer

FromMuhammad Falak R Wani <falakreyaz@gmail.com>
Date2015-10-25 11:40 +0100
Subject[PATCH 2/3] staging: hfi1: driver: Use setup_timer
Message-ID<qnqSt-1xp-1@gated-at.bofh.it>
Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.

<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
	->make subject line more specific

 drivers/staging/rdma/hfi1/driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/driver.c b/drivers/staging/rdma/hfi1/driver.c
index c0a5900..ef4e0c5 100644
--- a/drivers/staging/rdma/hfi1/driver.c
+++ b/drivers/staging/rdma/hfi1/driver.c
@@ -1062,9 +1062,9 @@ void hfi1_set_led_override(struct hfi1_pportdata *ppd, unsigned int val)
 	 */
 	if (atomic_inc_return(&ppd->led_override_timer_active) == 1) {
 		/* Need to start timer */
-		init_timer(&ppd->led_override_timer);
-		ppd->led_override_timer.function = run_led_override;
-		ppd->led_override_timer.data = (unsigned long) ppd;
+		setup_timer(&ppd->led_override_timer, run_led_override,
+				(unsigned long)ppd);
+
 		ppd->led_override_timer.expires = jiffies + 1;
 		add_timer(&ppd->led_override_timer);
 	} else {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web