Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752084AbdHaXkJ (ORCPT ); Thu, 31 Aug 2017 19:40:09 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:36606 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933AbdHaXjZ (ORCPT ); Thu, 31 Aug 2017 19:39:25 -0400 X-Google-Smtp-Source: ADKCNb5df2cupjmS9xA0pC1SN3xqp9wCGRgM8j1S4knwz4Pr+XVxmrh4IViRt+fq7s32hVLpFwwZKA== From: Kees Cook To: Thomas Gleixner Cc: Kees Cook , Ralf Baechle , Ingo Molnar , Arnd Bergmann , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: [PATCH 23/31] mips/sgi-ip32: Use separate static data field with with static timer Date: Thu, 31 Aug 2017 16:29:35 -0700 Message-Id: <1504222183-61202-24-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: 2275 Lines: 72 In preparation for changing the timer callback argument to the timer pointer, move to a separate static data variable. Cc: Ralf Baechle Cc: Ingo Molnar Cc: Arnd Bergmann Cc: linux-mips@linux-mips.org Signed-off-by: Kees Cook --- arch/mips/sgi-ip32/ip32-reset.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/mips/sgi-ip32/ip32-reset.c b/arch/mips/sgi-ip32/ip32-reset.c index 4e263fd4deff..6636a9c686cd 100644 --- a/arch/mips/sgi-ip32/ip32-reset.c +++ b/arch/mips/sgi-ip32/ip32-reset.c @@ -38,6 +38,7 @@ extern struct platform_device ip32_rtc_device; static struct timer_list power_timer, blink_timer; +static unsigned long blink_timer_timeout; static int has_panicked, shutting_down; static __noreturn void ip32_poweroff(void *data) @@ -71,11 +72,11 @@ static void ip32_machine_restart(char *cmd) unreachable(); } -static void blink_timeout(unsigned long data) +static void blink_timeout(unsigned long unused) { unsigned long led = mace->perif.ctrl.misc ^ MACEISA_LED_RED; mace->perif.ctrl.misc = led; - mod_timer(&blink_timer, jiffies + data); + mod_timer(&blink_timer, jiffies + blink_timer_timeout); } static void ip32_machine_halt(void) @@ -99,8 +100,8 @@ void ip32_prepare_poweroff(void) } shutting_down = 1; - blink_timer.data = POWERDOWN_FREQ; - blink_timeout(POWERDOWN_FREQ); + blink_timer_timeout = POWERDOWN_FREQ; + blink_timeout(0); setup_timer(&power_timer, power_timeout, 0UL); power_timer.expires = jiffies + POWERDOWN_TIMEOUT * HZ; @@ -120,8 +121,8 @@ static int panic_event(struct notifier_block *this, unsigned long event, led = mace->perif.ctrl.misc | MACEISA_LED_GREEN; mace->perif.ctrl.misc = led; - blink_timer.data = PANIC_FREQ; - blink_timeout(PANIC_FREQ); + blink_timer_timeout = PANIC_FREQ; + blink_timeout(0); return NOTIFY_DONE; } @@ -142,8 +143,7 @@ static __init int ip32_reboot_setup(void) _machine_halt = ip32_machine_halt; pm_power_off = ip32_machine_halt; - init_timer(&blink_timer); - blink_timer.function = blink_timeout; + setup_timer(&blink_timer, blink_timeout, 0); atomic_notifier_chain_register(&panic_notifier_list, &panic_block); return 0; -- 2.7.4