From: Geliang Tang <geliangtang@gmail.com>
To: Philipp Reisner <philipp.reisner@linbit.com>,
Lars Ellenberg <lars.ellenberg@linbit.com>
Cc: Geliang Tang <geliangtang@gmail.com>,
drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org
Subject: [PATCH] drbd: use setup_timer
Date: Fri, 24 Mar 2017 22:15:11 +0800 [thread overview]
Message-ID: <88d743591c2bd5e0c46009f7ec33fa326bf2db5e.1490341364.git.geliangtang@gmail.com> (raw)
In-Reply-To: <4841d2c2936addc27a2e774041d04ec16885ba03.1490341208.git.geliangtang@gmail.com>
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
drivers/block/drbd/drbd_main.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 92c60cb..09846fc 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2011,18 +2011,14 @@ void drbd_init_set_defaults(struct drbd_device *device)
device->unplug_work.cb = w_send_write_hint;
device->bm_io_work.w.cb = w_bitmap_io;
- init_timer(&device->resync_timer);
- init_timer(&device->md_sync_timer);
- init_timer(&device->start_resync_timer);
- init_timer(&device->request_timer);
- device->resync_timer.function = resync_timer_fn;
- device->resync_timer.data = (unsigned long) device;
- device->md_sync_timer.function = md_sync_timer_fn;
- device->md_sync_timer.data = (unsigned long) device;
- device->start_resync_timer.function = start_resync_timer_fn;
- device->start_resync_timer.data = (unsigned long) device;
- device->request_timer.function = request_timer_fn;
- device->request_timer.data = (unsigned long) device;
+ setup_timer(&device->resync_timer, resync_timer_fn,
+ (unsigned long)device);
+ setup_timer(&device->md_sync_timer, md_sync_timer_fn,
+ (unsigned long)device);
+ setup_timer(&device->start_resync_timer, start_resync_timer_fn,
+ (unsigned long)device);
+ setup_timer(&device->request_timer, request_timer_fn,
+ (unsigned long)device);
init_waitqueue_head(&device->misc_wait);
init_waitqueue_head(&device->state_wait);
--
2.9.3
next prev parent reply other threads:[~2017-03-24 14:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-24 14:15 [PATCH] aoe: " Geliang Tang
2017-03-24 14:15 ` [PATCH] block: floppy: " Geliang Tang
2017-03-24 14:23 ` Jens Axboe
2017-03-24 14:15 ` Geliang Tang [this message]
2017-03-24 14:15 ` [PATCH] ipmi_ssif: " Geliang Tang
2017-03-25 2:59 ` Corey Minyard
2017-03-24 14:15 ` [PATCH] mg_disk: " Geliang Tang
2017-03-24 14:15 ` [PATCH] x86/pci-calgary: " Geliang Tang
2017-03-31 8:24 ` [tip:x86/cleanups] x86/pci-calgary: Use setup_timer() instead of open coding it tip-bot for Geliang Tang
2017-03-25 19:32 ` [PATCH] aoe: use setup_timer Ed Cashin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=88d743591c2bd5e0c46009f7ec33fa326bf2db5e.1490341364.git.geliangtang@gmail.com \
--to=geliangtang@gmail.com \
--cc=drbd-dev@lists.linbit.com \
--cc=lars.ellenberg@linbit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=philipp.reisner@linbit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®