Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Kees Cook and committed by
Thomas Gleixner
51487d9e 5cd79d6a

+6 -8
+5 -7
drivers/char/tlclk.c
··· 184 184 static int int_events; /* Event that generate a interrupt */ 185 185 static int got_event; /* if events processing have been done */ 186 186 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; 190 189 static unsigned long tlclk_timer_data; 191 190 192 191 static struct tlclk_alarms *alarm_events; ··· 804 805 goto out3; 805 806 } 806 807 807 - init_timer(&switchover_timer); 808 + timer_setup(&switchover_timer, switchover_timeout, 0); 808 809 809 810 ret = misc_register(&tlclk_miscdev); 810 811 if (ret < 0) { ··· 854 855 855 856 } 856 857 857 - static void switchover_timeout(unsigned long data) 858 + static void switchover_timeout(struct timer_list *unused) 858 859 { 859 - unsigned long flags = *(unsigned long *) data; 860 + unsigned long flags = tlclk_timer_data; 860 861 861 862 if ((flags & 1)) { 862 863 if ((inb(TLCLK_REG1) & 0x08) != (flags & 0x08)) ··· 921 922 /* TIMEOUT in ~10ms */ 922 923 switchover_timer.expires = jiffies + msecs_to_jiffies(10); 923 924 tlclk_timer_data = inb(TLCLK_REG1); 924 - switchover_timer.data = (unsigned long) &tlclk_timer_data; 925 925 mod_timer(&switchover_timer, switchover_timer.expires); 926 926 } else { 927 927 got_event = 1;
+1 -1
include/linux/timer.h
··· 87 87 88 88 #define DEFINE_TIMER(_name, _function, _expires, _data) \ 89 89 struct timer_list _name = \ 90 - TIMER_INITIALIZER(_function, _expires, _data) 90 + __TIMER_INITIALIZER(_function, _expires, _data, 0) 91 91 92 92 void init_timer_key(struct timer_list *timer, unsigned int flags, 93 93 const char *name, struct lock_class_key *key);