From ed0ed4ea7755559ee04aab8695cb91610f5e539a Mon Sep 17 00:00:00 2001 From: Somya Anand Date: Wed, 11 Mar 2015 17:02:15 +0530 Subject: [PATCH] Staging: lustre: Use setup_timer to combine initialization The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. So, this patch combines the multiline code for timer initialization using the function setup_timer. This issue is identified via coccinelle script. @@ expression E1, E2, E3; type T; @@ - init_timer(&E1); ... ( - E1.function = E2; ... - E1.data = (T)E3; + setup_timer(&E1, E2, (T)E3); | - E1.data = (T)E3; ... - E1.function = E2; + setup_timer(&E1, E2, (T)E3); | - E1.function = E2; + setup_timer(&E1, E2, 0); ) Signed-off-by: Somya Anand Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/llite/super25.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c index 7c1e02a031ba..a494f6271fa0 100644 --- a/drivers/staging/lustre/lustre/llite/super25.c +++ b/drivers/staging/lustre/lustre/llite/super25.c @@ -152,9 +152,7 @@ static int __init init_lustre_lite(void) do_gettimeofday(&tv); cfs_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]); - - init_timer(&ll_capa_timer); - ll_capa_timer.function = ll_capa_timer_callback; + setup_timer(&ll_capa_timer, ll_capa_timer_callback, 0); rc = ll_capa_thread_start(); if (rc != 0) goto out_proc; -- 2.20.1