linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: serio: Convert timers to use timer_setup()
@ 2017-10-24 14:18 Kees Cook
  2017-10-24 17:04 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2017-10-24 14:18 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Al Viro, Helge Deller, linux-input, linux-kernel

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-input@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/input/serio/hp_sdc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
index 8eef6849d066..1d7c7d81a5ef 100644
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -794,7 +794,7 @@ int hp_sdc_release_cooked_irq(hp_sdc_irqhook *callback)
 
 /************************* Keepalive timer task *********************/
 
-static void hp_sdc_kicker(unsigned long data)
+static void hp_sdc_kicker(struct timer_list *unused)
 {
 	tasklet_schedule(&hp_sdc.task);
 	/* Re-insert the periodic task. */
@@ -909,9 +909,8 @@ static int __init hp_sdc_init(void)
 	down(&s_sync); /* Wait for t_sync to complete */
 
 	/* Create the keepalive task */
-	init_timer(&hp_sdc.kicker);
+	timer_setup(&hp_sdc.kicker, hp_sdc_kicker, 0);
 	hp_sdc.kicker.expires = jiffies + HZ;
-	hp_sdc.kicker.function = &hp_sdc_kicker;
 	add_timer(&hp_sdc.kicker);
 
 	hp_sdc.dev_err = 0;
-- 
2.7.4


-- 
Kees Cook
Pixel Security

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: serio: Convert timers to use timer_setup()
  2017-10-24 14:18 [PATCH] Input: serio: Convert timers to use timer_setup() Kees Cook
@ 2017-10-24 17:04 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2017-10-24 17:04 UTC (permalink / raw)
  To: Kees Cook; +Cc: Al Viro, Helge Deller, linux-input, linux-kernel

On Tue, Oct 24, 2017 at 07:18:45AM -0700, Kees Cook wrote:
> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Helge Deller <deller@gmx.de>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>

Applied, thank you.

> ---
>  drivers/input/serio/hp_sdc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
> index 8eef6849d066..1d7c7d81a5ef 100644
> --- a/drivers/input/serio/hp_sdc.c
> +++ b/drivers/input/serio/hp_sdc.c
> @@ -794,7 +794,7 @@ int hp_sdc_release_cooked_irq(hp_sdc_irqhook *callback)
>  
>  /************************* Keepalive timer task *********************/
>  
> -static void hp_sdc_kicker(unsigned long data)
> +static void hp_sdc_kicker(struct timer_list *unused)
>  {
>  	tasklet_schedule(&hp_sdc.task);
>  	/* Re-insert the periodic task. */
> @@ -909,9 +909,8 @@ static int __init hp_sdc_init(void)
>  	down(&s_sync); /* Wait for t_sync to complete */
>  
>  	/* Create the keepalive task */
> -	init_timer(&hp_sdc.kicker);
> +	timer_setup(&hp_sdc.kicker, hp_sdc_kicker, 0);
>  	hp_sdc.kicker.expires = jiffies + HZ;
> -	hp_sdc.kicker.function = &hp_sdc_kicker;
>  	add_timer(&hp_sdc.kicker);
>  
>  	hp_sdc.dev_err = 0;
> -- 
> 2.7.4
> 
> 
> -- 
> Kees Cook
> Pixel Security

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-24 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24 14:18 [PATCH] Input: serio: Convert timers to use timer_setup() Kees Cook
2017-10-24 17:04 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).