Skip to content

Commit 51487d9

Browse files
keesKAGA-KOKO
authored andcommitted
timer: Remove last user of TIMER_INITIALIZER
Drops the last user of TIMER_INITIALIZER and adapts timer.h to use the internal version. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-mips@linux-mips.org Cc: Petr Mladek <pmladek@suse.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Cc: Sebastian Reichel <sre@kernel.org> Cc: Kalle Valo <kvalo@qca.qualcomm.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: linux1394-devel@lists.sourceforge.net Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: linux-s390@vger.kernel.org Cc: linux-wireless@vger.kernel.org Cc: Mark Gross <mark.gross@intel.com> Cc: Wim Van Sebroeck <wim@iguana.be> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Ursula Braun <ubraun@linux.vnet.ibm.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: Harish Patil <harish.patil@cavium.com> Cc: Stephen Boyd <sboyd@codeaurora.org> Cc: Michael Reed <mdr@sgi.com> Cc: Manish Chopra <manish.chopra@cavium.com> Cc: Len Brown <len.brown@intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-pm@vger.kernel.org Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Tejun Heo <tj@kernel.org> Cc: Julian Wiedmann <jwi@linux.vnet.ibm.com> Cc: John Stultz <john.stultz@linaro.org> Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Guenter Roeck <linux@roeck-us.net> Cc: netdev@vger.kernel.org Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linuxppc-dev@lists.ozlabs.org Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Link: https://lkml.kernel.org/r/1507159627-127660-8-git-send-email-keescook@chromium.org
1 parent 5cd79d6 commit 51487d9

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

‎drivers/char/tlclk.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,8 @@ static unsigned int telclk_interrupt;
184184
static int int_events; /* Event that generate a interrupt */
185185
static int got_event; /* if events processing have been done */
186186

187-
static void switchover_timeout(unsigned long data);
188-
static struct timer_list switchover_timer =
189-
TIMER_INITIALIZER(switchover_timeout , 0, 0);
187+
static void switchover_timeout(struct timer_list *t);
188+
static struct timer_list switchover_timer;
190189
static unsigned long tlclk_timer_data;
191190

192191
static struct tlclk_alarms *alarm_events;
@@ -805,7 +804,7 @@ static int __init tlclk_init(void)
805804
goto out3;
806805
}
807806

808-
init_timer(&switchover_timer);
807+
timer_setup(&switchover_timer, switchover_timeout, 0);
809808

810809
ret = misc_register(&tlclk_miscdev);
811810
if (ret < 0) {
@@ -855,9 +854,9 @@ static void __exit tlclk_cleanup(void)
855854

856855
}
857856

858-
static void switchover_timeout(unsigned long data)
857+
static void switchover_timeout(struct timer_list *unused)
859858
{
860-
unsigned long flags = *(unsigned long *) data;
859+
unsigned long flags = tlclk_timer_data;
861860

862861
if ((flags & 1)) {
863862
if ((inb(TLCLK_REG1) & 0x08) != (flags & 0x08))
@@ -922,7 +921,6 @@ static irqreturn_t tlclk_interrupt(int irq, void *dev_id)
922921
/* TIMEOUT in ~10ms */
923922
switchover_timer.expires = jiffies + msecs_to_jiffies(10);
924923
tlclk_timer_data = inb(TLCLK_REG1);
925-
switchover_timer.data = (unsigned long) &tlclk_timer_data;
926924
mod_timer(&switchover_timer, switchover_timer.expires);
927925
} else {
928926
got_event = 1;

‎include/linux/timer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ struct timer_list {
8787

8888
#define DEFINE_TIMER(_name, _function, _expires, _data) \
8989
struct timer_list _name = \
90-
TIMER_INITIALIZER(_function, _expires, _data)
90+
__TIMER_INITIALIZER(_function, _expires, _data, 0)
9191

9292
void init_timer_key(struct timer_list *timer, unsigned int flags,
9393
const char *name, struct lock_class_key *key);

0 commit comments

Comments
 (0)