[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-5cd79d6abd2c142352dead0e3df04e86ee32f5d3@git.kernel.org>
Date: Thu, 5 Oct 2017 06:05:49 -0700
From: tip-bot for Kees Cook <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: akpm@...ux-foundation.org, jejb@...ux.vnet.ibm.com,
kvalo@....qualcomm.com, sudipm.mukherjee@...il.com, arnd@...db.de,
manish.chopra@...ium.com, sre@...nel.org, jwi@...ux.vnet.ibm.com,
sboyd@...eaurora.org, stefanr@...6.in-berlin.de,
len.brown@...el.com, linux@...ck-us.net, mingo@...nel.org,
schwidefsky@...ibm.com, gregkh@...uxfoundation.org,
mpe@...erman.id.au, pmladek@...e.com, geert@...ux-m68k.org,
oleg@...hat.com, rjw@...ysocki.net, mdr@....com, pavel@....cz,
paulus@...ba.org, harish.patil@...ium.com, mark.gross@...el.com,
john.stultz@...aro.org, ralf@...ux-mips.org,
heiko.carstens@...ibm.com, wim@...ana.be, cmetcalf@...lanox.com,
linux-kernel@...r.kernel.org, benh@...nel.crashing.org,
ubraun@...ux.vnet.ibm.com, viresh.kumar@...aro.org, tj@...nel.org,
martin.petersen@...cle.com, keescook@...omium.org,
jiangshanlai@...il.com, tglx@...utronix.de, hpa@...or.com
Subject: [tip:timers/core] timer: Remove users of TIMER_DEFERRED_INITIALIZER
Commit-ID: 5cd79d6abd2c142352dead0e3df04e86ee32f5d3
Gitweb: https://git.kernel.org/tip/5cd79d6abd2c142352dead0e3df04e86ee32f5d3
Author: Kees Cook <keescook@...omium.org>
AuthorDate: Wed, 4 Oct 2017 16:27:00 -0700
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 5 Oct 2017 15:01:18 +0200
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.
Signed-off-by: Kees Cook <keescook@...omium.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-mips@...ux-mips.org
Cc: Petr Mladek <pmladek@...e.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Lai Jiangshan <jiangshanlai@...il.com>
Cc: Sebastian Reichel <sre@...nel.org>
Cc: Kalle Valo <kvalo@....qualcomm.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Pavel Machek <pavel@....cz>
Cc: linux1394-devel@...ts.sourceforge.net
Cc: Chris Metcalf <cmetcalf@...lanox.com>
Cc: linux-s390@...r.kernel.org
Cc: linux-wireless@...r.kernel.org
Cc: "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>
Cc: Wim Van Sebroeck <wim@...ana.be>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Ursula Braun <ubraun@...ux.vnet.ibm.com>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Harish Patil <harish.patil@...ium.com>
Cc: Stephen Boyd <sboyd@...eaurora.org>
Cc: Guenter Roeck <linux@...ck-us.net>
Cc: Manish Chopra <manish.chopra@...ium.com>
Cc: Len Brown <len.brown@...el.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: linux-pm@...r.kernel.org
Cc: Heiko Carstens <heiko.carstens@...ibm.com>
Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
Cc: Julian Wiedmann <jwi@...ux.vnet.ibm.com>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Mark Gross <mark.gross@...el.com>
Cc: linux-watchdog@...r.kernel.org
Cc: linux-scsi@...r.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@...cle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Oleg Nesterov <oleg@...hat.com>
Cc: Ralf Baechle <ralf@...ux-mips.org>
Cc: Stefan Richter <stefanr@...6.in-berlin.de>
Cc: Michael Reed <mdr@....com>
Cc: netdev@...r.kernel.org
Cc: Tejun Heo <tj@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: linuxppc-dev@...ts.ozlabs.org
Cc: Sudip Mukherjee <sudipm.mukherjee@...il.com>
Link: https://lkml.kernel.org/r/1507159627-127660-7-git-send-email-keescook@chromium.org
---
arch/s390/kernel/lgr.c | 6 +++---
arch/s390/kernel/topology.c | 6 +++---
kernel/workqueue.c | 8 +++-----
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/arch/s390/kernel/lgr.c b/arch/s390/kernel/lgr.c
index ae7dff1..bf9622f 100644
--- a/arch/s390/kernel/lgr.c
+++ b/arch/s390/kernel/lgr.c
@@ -153,14 +153,13 @@ static void lgr_timer_set(void);
/*
* LGR timer callback
*/
-static void lgr_timer_fn(unsigned long ignored)
+static void lgr_timer_fn(struct timer_list *unused)
{
lgr_info_log();
lgr_timer_set();
}
-static struct timer_list lgr_timer =
- TIMER_DEFERRED_INITIALIZER(lgr_timer_fn, 0, 0);
+static struct timer_list lgr_timer;
/*
* Setup next LGR timer
@@ -181,6 +180,7 @@ static int __init lgr_init(void)
debug_register_view(lgr_dbf, &debug_hex_ascii_view);
lgr_info_get(&lgr_info_last);
debug_event(lgr_dbf, 1, &lgr_info_last, sizeof(lgr_info_last));
+ timer_setup(&lgr_timer, lgr_timer_fn, TIMER_DEFERRABLE);
lgr_timer_set();
return 0;
}
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index ed0bdd2..d7ece98 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -320,15 +320,14 @@ static void topology_flush_work(void)
flush_work(&topology_work);
}
-static void topology_timer_fn(unsigned long ignored)
+static void topology_timer_fn(struct timer_list *unused)
{
if (ptf(PTF_CHECK))
topology_schedule_update();
set_topology_timer();
}
-static struct timer_list topology_timer =
- TIMER_DEFERRED_INITIALIZER(topology_timer_fn, 0, 0);
+static struct timer_list topology_timer;
static atomic_t topology_poll = ATOMIC_INIT(0);
@@ -597,6 +596,7 @@ static struct ctl_table topology_dir_table[] = {
static int __init topology_init(void)
{
+ timer_setup(&topology_timer, topology_timer_fn, TIMER_DEFERRABLE);
if (MACHINE_HAS_TOPOLOGY)
set_topology_timer();
else
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 64d0edf..a5361fc 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5390,11 +5390,8 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq) { }
*/
#ifdef CONFIG_WQ_WATCHDOG
-static void wq_watchdog_timer_fn(unsigned long data);
-
static unsigned long wq_watchdog_thresh = 30;
-static struct timer_list wq_watchdog_timer =
- TIMER_DEFERRED_INITIALIZER(wq_watchdog_timer_fn, 0, 0);
+static struct timer_list wq_watchdog_timer;
static unsigned long wq_watchdog_touched = INITIAL_JIFFIES;
static DEFINE_PER_CPU(unsigned long, wq_watchdog_touched_cpu) = INITIAL_JIFFIES;
@@ -5408,7 +5405,7 @@ static void wq_watchdog_reset_touched(void)
per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies;
}
-static void wq_watchdog_timer_fn(unsigned long data)
+static void wq_watchdog_timer_fn(struct timer_list *unused)
{
unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ;
bool lockup_detected = false;
@@ -5510,6 +5507,7 @@ module_param_cb(watchdog_thresh, &wq_watchdog_thresh_ops, &wq_watchdog_thresh,
static void wq_watchdog_init(void)
{
+ timer_setup(&wq_watchdog_timer, wq_watchdog_timer_fn, TIMER_DEFERRABLE);
wq_watchdog_set_thresh(wq_watchdog_thresh);
}
Powered by blists - more mailing lists