From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757451AbdJPX2k (ORCPT ); Mon, 16 Oct 2017 19:28:40 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:55042 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757405AbdJPX2j (ORCPT ); Mon, 16 Oct 2017 19:28:39 -0400 X-Google-Smtp-Source: AOwi7QBjltW49wZLJiLSQ3M/h/lTs2XEirULvP3yU/jYn+Xke0vdmglWWdQvmMClWTFm4Jf0QY839A== Date: Mon, 16 Oct 2017 16:28:36 -0700 From: Kees Cook To: Greg Kroah-Hartman Cc: James Hogan , Jiri Slaby , linux-metag@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] tty: metag_da: Convert timers to use timer_setup() Message-ID: <20171016232836.GA101212@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. Cc: James Hogan Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-metag@vger.kernel.org Signed-off-by: Kees Cook --- drivers/tty/metag_da.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/tty/metag_da.c b/drivers/tty/metag_da.c index 25ccef2fe748..82ccf3982b25 100644 --- a/drivers/tty/metag_da.c +++ b/drivers/tty/metag_da.c @@ -309,7 +309,7 @@ static int put_data(void *arg) /* * This gets called every DA_TTY_POLL and polls the channels for data */ -static void dashtty_timer(unsigned long ignored) +static void dashtty_timer(struct timer_list *poll_timer) { int channel; @@ -323,12 +323,12 @@ static void dashtty_timer(unsigned long ignored) if (channel >= 0) fetch_data(channel); - mod_timer(&poll_timer, jiffies + DA_TTY_POLL); + mod_timer(poll_timer, jiffies + DA_TTY_POLL); } static void add_poll_timer(struct timer_list *poll_timer) { - setup_pinned_timer(poll_timer, dashtty_timer, 0); + timer_setup(poll_timer, dashtty_timer, TIMER_PINNED); poll_timer->expires = jiffies + DA_TTY_POLL; /* @@ -461,7 +461,7 @@ static void dashtty_hangup(struct tty_struct *tty) * buffers. It is used to delay the expensive writeout until the writer has * stopped writing. */ -static void dashtty_put_timer(unsigned long ignored) +static void dashtty_put_timer(struct timer_list *unused) { if (atomic_read(&dashtty_xmit_cnt)) wake_up_interruptible(&dashtty_waitqueue); @@ -603,7 +603,7 @@ static int __init dashtty_init(void) complete(&dport->xmit_empty); } - setup_timer(&put_timer, dashtty_put_timer, 0); + timer_setup(&put_timer, dashtty_put_timer, 0); init_waitqueue_head(&dashtty_waitqueue); dashtty_thread = kthread_create(put_data, NULL, "ttyDA"); -- 2.7.4 -- Kees Cook Pixel Security