public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Allen Pais <allen.lkml@gmail.com>
Cc: linux-kernel@vger.kernel.org, johan@kernel.org,
	gregkh@linuxfoundation.org, Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH 1/1] driver:garmin gps: use setup_timer
Date: Mon, 9 Oct 2017 15:59:05 +0200	[thread overview]
Message-ID: <20171009135905.GA5174@localhost> (raw)
In-Reply-To: <1505993064-30745-1-git-send-email-allen.lkml@gmail.com>

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 <allen.lkml@gmail.com>
> ---
>  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.

Thanks,
Johan

  reply	other threads:[~2017-10-09 13:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 11:24 [PATCH 1/1] driver:garmin gps: use setup_timer Allen Pais
2017-10-09 13:59 ` Johan Hovold [this message]
2017-10-09 16:34   ` Kees Cook
2017-10-10  6:54     ` Johan Hovold
2017-10-10 14:23       ` Kees Cook
2017-10-10 16:17         ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171009135905.GA5174@localhost \
    --to=johan@kernel.org \
    --cc=allen.lkml@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox