Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbdITXbJ (ORCPT ); Wed, 20 Sep 2017 19:31:09 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:49762 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751973AbdITX2L (ORCPT ); Wed, 20 Sep 2017 19:28:11 -0400 X-Google-Smtp-Source: AOwi7QA+LWK+DA9daphsUAiJgAGYtTGpd1CokCHzF7KaltiABYaaNwFNaAMXDS6k/bvdukcWUy7TzQ== From: Kees Cook To: Thomas Gleixner Cc: Kees Cook , linux-kernel@vger.kernel.org Subject: [PATCH v2 08/31] timer: Remove users of TIMER_INITIALIZER Date: Wed, 20 Sep 2017 16:27:32 -0700 Message-Id: <1505950075-50223-9-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505950075-50223-1-git-send-email-keescook@chromium.org> References: <1505950075-50223-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 6210bff46341..390505d1ecba 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