From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753089AbdJEAxs (ORCPT ); Wed, 4 Oct 2017 20:53:48 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:49053 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047AbdJEAxq (ORCPT ); Wed, 4 Oct 2017 20:53:46 -0400 X-Google-Smtp-Source: AOwi7QD0gvCQ/M3DrAQgxupOsnZOmBc/5nNtygnM8bMfLd39a2kh7Shaj1IyHTiGnEQzyDXWryVzwg== Date: Wed, 4 Oct 2017 17:53:43 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Stefan Richter , linux1394-devel@lists.sourceforge.net, Thomas Gleixner Subject: [PATCH] firewire: Convert timers to use timer_setup() Message-ID: <20171005005343.GA23824@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: Stefan Richter Cc: linux1394-devel@lists.sourceforge.net Cc: Thomas Gleixner Signed-off-by: Kees Cook --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. --- drivers/firewire/core-transaction.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index d6a09b9cd8cc..6c4994487d49 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -137,9 +137,10 @@ int fw_cancel_transaction(struct fw_card *card, } EXPORT_SYMBOL(fw_cancel_transaction); -static void split_transaction_timeout_callback(unsigned long data) +static void split_transaction_timeout_callback(struct timer_list *timer) { - struct fw_transaction *t = (struct fw_transaction *)data; + struct fw_transaction *t = from_timer(t, timer, + split_timeout_timer); struct fw_card *card = t->card; unsigned long flags; @@ -373,8 +374,8 @@ void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode, t->tlabel = tlabel; t->card = card; t->is_split_transaction = false; - setup_timer(&t->split_timeout_timer, - split_transaction_timeout_callback, (unsigned long)t); + timer_setup(&t->split_timeout_timer, + split_transaction_timeout_callback, 0); t->callback = callback; t->callback_data = callback_data; -- 2.7.4 -- Kees Cook Pixel Security