From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932553AbdJXKJR (ORCPT ); Tue, 24 Oct 2017 06:09:17 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:49808 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932490AbdJXKJH (ORCPT ); Tue, 24 Oct 2017 06:09:07 -0400 X-Google-Smtp-Source: ABhQp+TFacvoILLniRyGDvqcFmA/wBuNPh4qhjPA3z8T9rwdta+BAHfTYB3knSwKo9ppjR4JDGiaJg== Date: Tue, 24 Oct 2017 03:09:05 -0700 From: Kees Cook To: Greg Kroah-Hartman Cc: Valentina Manea , Shuah Khan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: usbip: Convert timers to use timer_setup() Message-ID: <20171024100905.GA69140@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: Valentina Manea Cc: Shuah Khan Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook --- drivers/usb/usbip/vudc_transfer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/usbip/vudc_transfer.c b/drivers/usb/usbip/vudc_transfer.c index 4cfd475ee865..718f1595a18e 100644 --- a/drivers/usb/usbip/vudc_transfer.c +++ b/drivers/usb/usbip/vudc_transfer.c @@ -311,9 +311,9 @@ static int transfer(struct vudc *udc, return sent; } -static void v_timer(unsigned long _vudc) +static void v_timer(struct timer_list *t) { - struct vudc *udc = (struct vudc *) _vudc; + struct vudc *udc = from_timer(udc, t, tr_timer.timer); struct transfer_timer *timer = &udc->tr_timer; struct urbp *urb_p, *tmp; unsigned long flags; @@ -459,7 +459,7 @@ void v_init_timer(struct vudc *udc) { struct transfer_timer *t = &udc->tr_timer; - setup_timer(&t->timer, v_timer, (unsigned long) udc); + timer_setup(&t->timer, v_timer, 0); t->state = VUDC_TR_STOPPED; } -- 2.7.4 -- Kees Cook Pixel Security