From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932720AbdJPXC2 (ORCPT ); Mon, 16 Oct 2017 19:02:28 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:53527 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932440AbdJPXC1 (ORCPT ); Mon, 16 Oct 2017 19:02:27 -0400 X-Google-Smtp-Source: AOwi7QAyATEgAZWQhnQ4haGvlRfMu6Z44MANTNbJEkiWJm5XjehktQD4zroQFt7nEp4UJKqAoCcFdA== Date: Mon, 16 Oct 2017 16:02:25 -0700 From: Kees Cook To: Jonathan Corbet Cc: linux-kernel@vger.kernel.org Subject: [PATCH] samples: Convert timers to use timer_setup() Message-ID: <20171016230225.GA99271@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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