timer: Remove last user of TIMER_INITIALIZER
authorKees Cook <[email protected]>
Wed, 4 Oct 2017 23:27:01 +0000 (16:27 -0700)
committerThomas Gleixner <[email protected]>
Thu, 5 Oct 2017 13:01:18 +0000 (15:01 +0200)
Drops the last user of TIMER_INITIALIZER and adapts timer.h to use the
internal version.

Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: Petr Mladek <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: [email protected]
Cc: Chris Metcalf <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Mark Gross <[email protected]>
Cc: Wim Van Sebroeck <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Ursula Braun <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Harish Patil <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Michael Reed <[email protected]>
Cc: Manish Chopra <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: [email protected]
Cc: Heiko Carstens <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Julian Wiedmann <[email protected]>
Cc: John Stultz <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: "Martin K. Petersen" <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Stefan Richter <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: [email protected]
Cc: Martin Schwidefsky <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: [email protected]
Cc: Sudip Mukherjee <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
drivers/char/tlclk.c
include/linux/timer.h

index 6210bff46341e88b2eb2b19028f41004849cf2bc..8eeb4190207d1ac7ac024433f043ae59f2b0cd71 100644 (file)
@@ -184,9 +184,8 @@ static unsigned int telclk_interrupt;
 static int int_events;         /* Event that generate a interrupt */
 static int got_event;          /* if events processing have been done */
 
-static void switchover_timeout(unsigned long data);
-static struct timer_list switchover_timer =
-       TIMER_INITIALIZER(switchover_timeout , 0, 0);
+static void switchover_timeout(struct timer_list *t);
+static struct timer_list switchover_timer;
 static unsigned long tlclk_timer_data;
 
 static struct tlclk_alarms *alarm_events;
@@ -805,7 +804,7 @@ static int __init tlclk_init(void)
                goto out3;
        }
 
-       init_timer(&switchover_timer);
+       timer_setup(&switchover_timer, switchover_timeout, 0);
 
        ret = misc_register(&tlclk_miscdev);
        if (ret < 0) {
@@ -855,9 +854,9 @@ static void __exit tlclk_cleanup(void)
 
 }
 
-static void switchover_timeout(unsigned long data)
+static void switchover_timeout(struct timer_list *unused)
 {
-       unsigned long flags = *(unsigned long *) data;
+       unsigned long flags = tlclk_timer_data;
 
        if ((flags & 1)) {
                if ((inb(TLCLK_REG1) & 0x08) != (flags & 0x08))
@@ -922,7 +921,6 @@ static irqreturn_t tlclk_interrupt(int irq, void *dev_id)
                /* TIMEOUT in ~10ms */
                switchover_timer.expires = jiffies + msecs_to_jiffies(10);
                tlclk_timer_data = inb(TLCLK_REG1);
-               switchover_timer.data = (unsigned long) &tlclk_timer_data;
                mod_timer(&switchover_timer, switchover_timer.expires);
        } else {
                got_event = 1;
index 10cc45ca58035d60fa4cde4664322b0535587e27..4f7476e4a727850ddc2b948080eb4d6d8c6fca62 100644 (file)
@@ -87,7 +87,7 @@ struct timer_list {
 
 #define DEFINE_TIMER(_name, _function, _expires, _data)                \
        struct timer_list _name =                               \
-               TIMER_INITIALIZER(_function, _expires, _data)
+               __TIMER_INITIALIZER(_function, _expires, _data, 0)
 
 void init_timer_key(struct timer_list *timer, unsigned int flags,
                    const char *name, struct lock_class_key *key);