public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] samples: Convert timers to use timer_setup()
@ 2017-10-16 23:02 Kees Cook
  2017-10-19 19:06 ` Jonathan Corbet
  0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2017-10-16 23:02 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: 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.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 samples/connector/cn_test.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/connector/cn_test.c b/samples/connector/cn_test.c
index d12cc944b696..95cd06f4ec1e 100644
--- a/samples/connector/cn_test.c
+++ b/samples/connector/cn_test.c
@@ -125,12 +125,12 @@ static int cn_test_want_notify(void)
 #endif
 
 static u32 cn_test_timer_counter;
-static void cn_test_timer_func(unsigned long __data)
+static void cn_test_timer_func(struct timer_list *unused)
 {
 	struct cn_msg *m;
 	char data[32];
 
-	pr_debug("%s: timer fired with data %lu\n", __func__, __data);
+	pr_debug("%s: timer fired\n", __func__);
 
 	m = kzalloc(sizeof(*m) + sizeof(data), GFP_ATOMIC);
 	if (m) {
@@ -168,7 +168,7 @@ static int cn_test_init(void)
 		goto err_out;
 	}
 
-	setup_timer(&cn_test_timer, cn_test_timer_func, 0);
+	timer_setup(&cn_test_timer, cn_test_timer_func, 0);
 	mod_timer(&cn_test_timer, jiffies + msecs_to_jiffies(1000));
 
 	pr_info("initialized with id={%u.%u}\n",
-- 
2.7.4


-- 
Kees Cook
Pixel Security

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

* Re: [PATCH] samples: Convert timers to use timer_setup()
  2017-10-16 23:02 [PATCH] samples: Convert timers to use timer_setup() Kees Cook
@ 2017-10-19 19:06 ` Jonathan Corbet
  2017-10-19 20:03   ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Corbet @ 2017-10-19 19:06 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-kernel

On Mon, 16 Oct 2017 16:02:25 -0700
Kees Cook <keescook@chromium.org> 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.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>

Argh, so I'm the samples/ maintainer too now? :)

Applied, thanks.

jon

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

* Re: [PATCH] samples: Convert timers to use timer_setup()
  2017-10-19 19:06 ` Jonathan Corbet
@ 2017-10-19 20:03   ` Kees Cook
  0 siblings, 0 replies; 3+ messages in thread
From: Kees Cook @ 2017-10-19 20:03 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: LKML

On Thu, Oct 19, 2017 at 12:06 PM, Jonathan Corbet <corbet@lwn.net> wrote:
> On Mon, 16 Oct 2017 16:02:25 -0700
> Kees Cook <keescook@chromium.org> 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.
>>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>
> Argh, so I'm the samples/ maintainer too now? :)

Well, other subdirectories appear to have separate maintainers, but
since you touched this last, it seemed best?

> Applied, thanks.

Thanks! FWIW, if I ever direct stuff your way and you'd rather I carry
it, just let me know. :)

-Kees

-- 
Kees Cook
Pixel Security

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

end of thread, other threads:[~2017-10-19 20:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-16 23:02 [PATCH] samples: Convert timers to use timer_setup() Kees Cook
2017-10-19 19:06 ` Jonathan Corbet
2017-10-19 20:03   ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox