@@ -1635,14 +1635,8 @@ static void esas2r_timer_callback(unsigned long context);
void esas2r_kickoff_timer(struct esas2r_adapter *a)
{
- init_timer(&a->timer);
-
- a->timer.function = esas2r_timer_callback;
- a->timer.data = (unsigned long)a;
- a->timer.expires = jiffies +
- msecs_to_jiffies(100);
-
- add_timer(&a->timer);
+ setup_timer(&a->timer, esas2r_timer_callback, (unsigned long)a);
+ mod_timer(&a->timer, jiffies + msecs_to_jiffies(100));
}
static void esas2r_timer_callback(unsigned long context)
Use setup_timer and mod_timer API instead of structure assignments. This is done using Coccinelle and semantic patch used for this as follows: @@ expression x,y,z,a,b; @@ -init_timer (&x); +setup_timer (&x, y, z); +mod_timer (&a, b); -x.function = y; -x.data = z; -x.expires = b; -add_timer(&a); Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> --- drivers/scsi/esas2r/esas2r_main.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)