History

timer: Remove users of TIMER_DEFERRED_INITIALIZER

This removes uses of TIMER_DEFERRED_INITIALIZER and chooses a location to call timer_setup() from before add_timer() or mod_timer() is called. Adjusts callbacks to use from_timer() as needed.

Kees Cook committed 9 years ago

Commit 5cd79d61 parent df7e8283 files · +9 −11Browse files

Showing the changes to kernel/workqueue.c (1 of 3 files). Show all

Unified · Split

kernel/workqueue.c+3−5
@@ -5390,11 +5390,8 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq) { } · 5389 unmodified lines
53905390 */
53915391 #ifdef CONFIG_WQ_WATCHDOG
53925392
5393−static void wq_watchdog_timer_fn(unsigned long data);
5394−
53955393 static unsigned long wq_watchdog_thresh = 30;
5396−static struct timer_list wq_watchdog_timer =
5397− TIMER_DEFERRED_INITIALIZER(wq_watchdog_timer_fn, 0, 0);
5394+static struct timer_list wq_watchdog_timer;
53985395
53995396 static unsigned long wq_watchdog_touched = INITIAL_JIFFIES;
54005397 static DEFINE_PER_CPU(unsigned long, wq_watchdog_touched_cpu) = INITIAL_JIFFIES;
@@ -5408,7 +5405,7 @@ static void wq_watchdog_reset_touched(void) · 7 unmodified lines
54085405 per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies;
54095406 }
54105407
5411−static void wq_watchdog_timer_fn(unsigned long data)
5408+static void wq_watchdog_timer_fn(struct timer_list *unused)
54125409 {
54135410 unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ;
54145411 bool lockup_detected = false;
@@ -5510,6 +5507,7 @@ module_param_cb(watchdog_thresh, &wq_watchdog_thresh_ops, &wq_watchdog_thresh, · 95 unmodified lines
55105507
55115508 static void wq_watchdog_init(void)
55125509 {
5510+ timer_setup(&wq_watchdog_timer, wq_watchdog_timer_fn, TIMER_DEFERRABLE);
55135511 wq_watchdog_set_thresh(wq_watchdog_thresh);
55145512 }
55155513

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t