mm/page-writeback.c: use setup_deferrable_timer
authorGeliang Tang <geliangtang@gmail.com>
Wed, 3 May 2017 21:52:19 +0000 (14:52 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 May 2017 22:52:08 +0000 (15:52 -0700)
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.

Link: http://lkml.kernel.org/r/e8e3d4280a34facbc007346f31df833cec28801e.1488070291.git.geliangtang@gmail.com
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page-writeback.c

index d8ac2a7fb9e7b6db9de3755ab7898095f70f8383..33df0583edb935896ef8eb1be88536e6820f3dfd 100644 (file)
@@ -650,9 +650,8 @@ int wb_domain_init(struct wb_domain *dom, gfp_t gfp)
 
        spin_lock_init(&dom->lock);
 
-       init_timer_deferrable(&dom->period_timer);
-       dom->period_timer.function = writeout_period;
-       dom->period_timer.data = (unsigned long)dom;
+       setup_deferrable_timer(&dom->period_timer, writeout_period,
+                              (unsigned long)dom);
 
        dom->dirty_limit_tstamp = jiffies;