public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Kees Cook <keescook@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	James Hogan <james.hogan@imgtec.com>,
	Ingo Molnar <mingo@kernel.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 24/31] mips/sgi-ip22: Use separate static data field with with static timer
Date: Fri, 1 Sep 2017 08:59:47 +0200	[thread overview]
Message-ID: <20170901065947.GA32117@linux-mips.org> (raw)
In-Reply-To: <1504222183-61202-25-git-send-email-keescook@chromium.org>

On Thu, Aug 31, 2017 at 04:29:36PM -0700, Kees Cook wrote:

> In preparation for changing the timer callback argument to the timer
> pointer, move to a separate static data variable.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: James Hogan <james.hogan@imgtec.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> Cc: linux-mips@linux-mips.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  arch/mips/sgi-ip22/ip22-reset.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/mips/sgi-ip22/ip22-reset.c b/arch/mips/sgi-ip22/ip22-reset.c
> index 196b041866ac..5cc32610e6d3 100644
> --- a/arch/mips/sgi-ip22/ip22-reset.c
> +++ b/arch/mips/sgi-ip22/ip22-reset.c
> @@ -38,6 +38,7 @@
>  #define PANIC_FREQ		(HZ / 8)
>  
>  static struct timer_list power_timer, blink_timer, debounce_timer;
> +static unsigned long blink_timer_timeout;

You're removing power_timer and debounce_timer ...

>  #define MACHINE_PANICED		1
>  #define MACHINE_SHUTTING_DOWN	2
> @@ -86,13 +87,13 @@ static void power_timeout(unsigned long data)
>  	sgi_machine_power_off();
>  }
>  
> -static void blink_timeout(unsigned long data)
> +static void blink_timeout(unsigned long unused)
>  {
>  	/* XXX fix this for fullhouse  */
>  	sgi_ioc_reset ^= (SGIOC_RESET_LC0OFF|SGIOC_RESET_LC1OFF);
>  	sgioc->reset = sgi_ioc_reset;
>  
> -	mod_timer(&blink_timer, jiffies + data);
> +	mod_timer(&blink_timer, jiffies + blink_timer_timeout);
>  }
>  
>  static void debounce(unsigned long data)
> @@ -128,8 +129,8 @@ static inline void power_button(void)
>  	}
>  
>  	machine_state |= MACHINE_SHUTTING_DOWN;
> -	blink_timer.data = POWERDOWN_FREQ;
> -	blink_timeout(POWERDOWN_FREQ);
> +	blink_timer_timeout = POWERDOWN_FREQ;
> +	blink_timeout(0);
>  
>  	setup_timer(&power_timer, power_timeout, 0UL);

... but don't remove the reference to power_timer nor use of debounce_timer.

>  	power_timer.expires = jiffies + POWERDOWN_TIMEOUT * HZ;
> @@ -169,8 +170,8 @@ static int panic_event(struct notifier_block *this, unsigned long event,
>  		return NOTIFY_DONE;
>  	machine_state |= MACHINE_PANICED;
>  
> -	blink_timer.data = PANIC_FREQ;
> -	blink_timeout(PANIC_FREQ);
> +	blink_timer_timeout = PANIC_FREQ;
> +	blink_timeout(0);
>  
>  	return NOTIFY_DONE;
>  }
> @@ -193,8 +194,7 @@ static int __init reboot_setup(void)
>  		return res;
>  	}
>  
> -	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;

  Ralf

  reply	other threads:[~2017-09-01  7:00 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 23:29 [PATCH 00/31] struct timer_list callback argument conversion, step 1 Kees Cook
2017-08-31 23:29 ` [PATCH 01/31] coccinelle: Improve setup_timer.cocci matching Kees Cook
2017-08-31 23:29 ` [PATCH 02/31] timer: Convert open-coded init_timer() to setup_timer() Kees Cook
2017-08-31 23:29 ` [PATCH 03/31] timer: Remove init_timer_pinned_deferrable() in favor of setup_pinned_deferrable_timer() Kees Cook
2017-08-31 23:29 ` [PATCH 04/31] timer: Remove init_timer_on_stack() in favor of setup_timer_on_stack() Kees Cook
2017-08-31 23:29 ` [PATCH 05/31] timer: Remove init_timer_pinned() in favor of setup_pinned_timer() Kees Cook
2017-08-31 23:29 ` [PATCH 06/31] timer: Remove init_timer_deferrable() in favor of setup_deferrable_timer() Kees Cook
2017-08-31 23:29 ` [PATCH 07/31] timer: Remove users of TIMER_DEFERRED_INITIALIZER Kees Cook
2017-08-31 23:29 ` [PATCH 08/31] timer: Remove users of TIMER_INITIALIZER Kees Cook
2017-08-31 23:29 ` [PATCH 09/31] timer: Remove unused static initializer macros Kees Cook
2017-08-31 23:29 ` [PATCH 10/31] timer: Remove users of expire and data arguments to DEFINE_TIMER Kees Cook
2017-08-31 23:29 ` [PATCH 11/31] timer: Remove expires and data arguments from DEFINE_TIMER Kees Cook
2017-09-01  7:26   ` Geert Uytterhoeven
2017-08-31 23:29 ` [PATCH 12/31] timer: Remove expires argument from __TIMER_INITIALIZER() Kees Cook
2017-08-31 23:29 ` [PATCH 13/31] timer: Remove meaningless .data/.function assignments Kees Cook
2017-09-01  5:09   ` Greg Kroah-Hartman
2017-09-01 17:59   ` Krzysztof Halasa
2017-09-01 20:07   ` Jens Axboe
2017-08-31 23:29 ` [PATCH 14/31] timer: Collapse cross-function single-assignment .data into setup_timer() Kees Cook
2017-08-31 23:29 ` [PATCH 15/31] timer: Additional init_timer() -> setup_timer() conversions Kees Cook
2017-08-31 23:29 ` [PATCH 16/31] usb/phy-isp1301-omap: Remove .data assignment Kees Cook
2017-08-31 23:29 ` [PATCH 17/31] media/i2c/tc358743: Initialize timer Kees Cook
2017-08-31 23:29 ` [PATCH 18/31] scsi/aic7xxx: Clean up timer usage Kees Cook
2017-08-31 23:29 ` [PATCH 19/31] timer: Remove open-coded casts for .data and .function Kees Cook
2017-09-01  0:28   ` Tyrel Datwyler
2017-09-01  0:29   ` Tyrel Datwyler
2017-08-31 23:29 ` [PATCH 20/31] net/core: Collapse redundant sk_timer callback data assignments Kees Cook
2017-08-31 23:29 ` [PATCH 21/31] s390/char/sclp: Use separate static data field with with static timer Kees Cook
2017-08-31 23:29 ` [PATCH 22/31] sparc/led: " Kees Cook
2017-08-31 23:29 ` [PATCH 23/31] mips/sgi-ip32: " Kees Cook
2017-09-01  7:04   ` Ralf Baechle
2017-09-01 22:56   ` Ralf Baechle
2017-08-31 23:29 ` [PATCH 24/31] mips/sgi-ip22: " Kees Cook
2017-09-01  6:59   ` Ralf Baechle [this message]
2017-09-01 16:57     ` Kees Cook
2017-09-01 22:56   ` Ralf Baechle
2017-08-31 23:29 ` [PATCH 25/31] net/atm/mpc: " Kees Cook
2017-08-31 23:29 ` [PATCH 26/31] staging/comedi/das16: Make timer initialization unconditional Kees Cook
2017-09-01  5:09   ` Greg Kroah-Hartman
2017-09-01  9:29   ` Ian Abbott
2017-09-01  9:38     ` Ian Abbott
2017-09-01 17:53       ` Kees Cook
2017-08-31 23:29 ` [PATCH 27/31] usb/gadget/snps_udc_core: Move timer initialization earlier Kees Cook
2017-09-03 21:12   ` Michal Nazarewicz
2017-09-06 23:23     ` Kees Cook
2017-08-31 23:29 ` [PATCH 28/31] infiniband/rdmavt: Remove redundant timer initialization Kees Cook
2017-08-31 23:29 ` [PATCH 29/31] scsi/bnx2i: Initialize timer Kees Cook
2017-08-31 23:29 ` [PATCH 30/31] appletalk: Remove unneeded synchronization Kees Cook
2017-08-31 23:29 ` [PATCH 31/31] timer: Switch to testing for .function instead of .data Kees Cook
2017-08-31 23:45   ` Dmitry Torokhov
2017-08-31 23:59     ` Kees Cook
2017-09-01  1:06       ` Dmitry Torokhov
2017-09-01 21:34   ` Jeff Kirsher
2017-09-02 13:47   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170901065947.GA32117@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=james.hogan@imgtec.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mingo@kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox