Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751993AbdHaXaQ (ORCPT ); Thu, 31 Aug 2017 19:30:16 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:34768 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbdHaXaB (ORCPT ); Thu, 31 Aug 2017 19:30:01 -0400 X-Google-Smtp-Source: ADKCNb5REm8eGNTYE6xqBdfdYjp03W0rEyUR3l58h3XGWwR950SmDNTqh2cYJc+y1rzB3T/e70ThhA== From: Kees Cook To: Thomas Gleixner Cc: Kees Cook , linux-kernel@vger.kernel.org Subject: [PATCH 08/31] timer: Remove users of TIMER_INITIALIZER Date: Thu, 31 Aug 2017 16:29:20 -0700 Message-Id: <1504222183-61202-9-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504222183-61202-1-git-send-email-keescook@chromium.org> References: <1504222183-61202-1-git-send-email-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1975 Lines: 56 Drops the last user of TIMER_INITIALIZER and adapts timer.h to use the internal version. Signed-off-by: Kees Cook --- drivers/char/tlclk.c | 7 +++---- include/linux/timer.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index 572a51704e67..f01efaa46f8e 100644 --- a/drivers/char/tlclk.c +++ b/drivers/char/tlclk.c @@ -185,8 +185,7 @@ 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 struct timer_list switchover_timer; static unsigned long tlclk_timer_data; static struct tlclk_alarms *alarm_events; @@ -805,7 +804,8 @@ static int __init tlclk_init(void) goto out3; } - init_timer(&switchover_timer); + setup_timer(&switchover_timer, switchover_timeout, + (unsigned long)&tlclk_timer_data); ret = misc_register(&tlclk_miscdev); if (ret < 0) { @@ -922,7 +922,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; diff --git a/include/linux/timer.h b/include/linux/timer.h index 491dfdda4acf..3f54800962aa 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -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); -- 2.7.4