Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d694234 authored by Kees Cook's avatar Kees Cook Committed by Jonathan Corbet
Browse files

samples: Convert timers to use timer_setup()



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: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 7d7363e4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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",