From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932346AbdJXKER (ORCPT ); Tue, 24 Oct 2017 06:04:17 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:25727 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751604AbdJXKEP (ORCPT ); Tue, 24 Oct 2017 06:04:15 -0400 Date: Tue, 24 Oct 2017 13:03:59 +0300 From: Dan Carpenter To: Kees Cook Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Johan Hovold , linux-kernel@vger.kernel.org, greybus-dev@lists.linaro.org Subject: Re: [PATCH] staging: greybus: Convert timers to use timer_setup() Message-ID: <20171024100358.p5jsvxdfitt4dvt4@mwanda> References: <20171024082550.GA142933@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171024082550.GA142933@beast> User-Agent: NeoMutt/20170609 (1.8.3) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 24, 2017 at 01:25:50AM -0700, Kees Cook wrote: > 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: Greg Kroah-Hartman > Cc: "Bryan O'Donoghue" > Cc: Johan Hovold > Cc: Alex Elder > Cc: greybus-dev@lists.linaro.org > Cc: devel@driverdev.osuosl.org > Signed-off-by: Kees Cook > --- > drivers/staging/greybus/loopback.c | 14 ++++---------- > drivers/staging/greybus/operation.c | 7 +++---- > 2 files changed, 7 insertions(+), 14 deletions(-) > > diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c > index 08e255884206..045aaf81113a 100644 > --- a/drivers/staging/greybus/loopback.c > +++ b/drivers/staging/greybus/loopback.c > @@ -572,16 +572,11 @@ static void gb_loopback_async_operation_work(struct work_struct *work) > gb_loopback_async_operation_put(op_async); > } > > -static void gb_loopback_async_operation_timeout(unsigned long data) > +static void gb_loopback_async_operation_timeout(struct timer_list *t) > { > - struct gb_loopback_async_operation *op_async; > - u16 id = data; > + struct gb_loopback_async_operation *op_async = > + from_timer(op_async, t, timer); > Since this one needs to be re-sent any way, could you do this instead of breaking up the line? struct gb_loopback_async_operation *op_async; op_async = from_timer(op_async, t, timer); regards, dan carpenter