From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754226AbdJJGyx (ORCPT ); Tue, 10 Oct 2017 02:54:53 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:48440 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbdJJGyw (ORCPT ); Tue, 10 Oct 2017 02:54:52 -0400 X-Google-Smtp-Source: AOwi7QB4RE4sTzdgYP6e6OocBmnbDFZi6cOM8GVD716BxNKKSxC2TTBEmusUDfguKL3uX/WxIJoG1g== Date: Tue, 10 Oct 2017 08:54:50 +0200 From: Johan Hovold To: Kees Cook Cc: Johan Hovold , Allen Pais , LKML , Greg KH Subject: Re: [PATCH 1/1] driver:garmin gps: use setup_timer Message-ID: <20171010065450.GG4269@localhost> References: <1505993064-30745-1-git-send-email-allen.lkml@gmail.com> <20171009135905.GA5174@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 09, 2017 at 09:34:05AM -0700, Kees Cook wrote: > On Mon, Oct 9, 2017 at 6:59 AM, Johan Hovold wrote: > > On Thu, Sep 21, 2017 at 04:54:24PM +0530, Allen Pais wrote: > >> Use setup_timer function instead of initializing timer with the > >> function and data fields. > > > > Why the odd indentation here? > > > >> Signed-off-by: Allen Pais > >> --- > >> drivers/usb/serial/garmin_gps.c | 5 ++--- > >> 1 file changed, 2 insertions(+), 3 deletions(-) > >> > >> diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c > >> index b2f2e87..2dbc1bed 100644 > >> --- a/drivers/usb/serial/garmin_gps.c > >> +++ b/drivers/usb/serial/garmin_gps.c > >> @@ -1391,12 +1391,11 @@ static int garmin_port_probe(struct usb_serial_port *port) > >> if (!garmin_data_p) > >> return -ENOMEM; > >> > >> - init_timer(&garmin_data_p->timer); > >> + setup_timer(&garmin_data_p->timer, timeout_handler, > >> + (unsigned long)garmin_data_p); > >> spin_lock_init(&garmin_data_p->lock); > >> INIT_LIST_HEAD(&garmin_data_p->pktlist); > >> /* garmin_data_p->timer.expires = jiffies + session_timeout; */ > >> - garmin_data_p->timer.data = (unsigned long)garmin_data_p; > >> - garmin_data_p->timer.function = timeout_handler; > >> garmin_data_p->port = port; > >> garmin_data_p->state = 0; > >> garmin_data_p->flags = 0; > > > > Kees submitted the exact same change the day before you as part of a > > larger patch resulting from running coccinelle and replacing all > > open-coded versions of setup_timer in go, something which seems > > preferable. > > > > Not sure who is expected to pick that patch up, but I'll hold off on > > this one for a while still waiting to see what happens to Kees's series. > > Hi, actually, "setup_timer" is the old api ("init_timer" is the > ancient api), "timer_setup" (to match hrtimer_setup) is the current > future approach here... So your patch from 20/9 ("[PATCH v2 02/31] timer: Convert open-coded init_timer() to setup_timer()") has been superseded? Or do you still expect that one to be applied (by tglx?)? Johan