diff options
author | Kees Cook <keescook@chromium.org> | 2017-08-29 00:03:41 +0200 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-11-22 00:46:44 +0100 |
commit | bca237a52ca0035b0a0380003283d8bf590188d5 (patch) | |
tree | d689ceca871d6c703871a6738a696a3091886a82 /block | |
parent | net/atm/mpc: Avoid open-coded assignment of timer callback function (diff) | |
download | linux-bca237a52ca0035b0a0380003283d8bf590188d5.tar.xz linux-bca237a52ca0035b0a0380003283d8bf590188d5.zip |
block/laptop_mode: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Jeff Layton <jlayton@redhat.com>
Cc: linux-block@vger.kernel.org
Cc: linux-mm@kvack.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 1038706edd87..b8881750a3ac 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -863,9 +863,9 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref) wake_up_all(&q->mq_freeze_wq); } -static void blk_rq_timed_out_timer(unsigned long data) +static void blk_rq_timed_out_timer(struct timer_list *t) { - struct request_queue *q = (struct request_queue *)data; + struct request_queue *q = from_timer(q, t, timeout); kblockd_schedule_work(&q->timeout_work); } @@ -901,9 +901,9 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) q->backing_dev_info->name = "block"; q->node = node_id; - setup_timer(&q->backing_dev_info->laptop_mode_wb_timer, - laptop_mode_timer_fn, (unsigned long) q); - setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q); + timer_setup(&q->backing_dev_info->laptop_mode_wb_timer, + laptop_mode_timer_fn, 0); + timer_setup(&q->timeout, blk_rq_timed_out_timer, 0); INIT_WORK(&q->timeout_work, NULL); INIT_LIST_HEAD(&q->queue_head); INIT_LIST_HEAD(&q->timeout_list); |