mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jes Sorensen <jes.sorensen@gmail.com>
To: Kees Cook <keescook@chromium.org>,
	"David S. Miller" <davem@davemloft.net>
Cc: Jes Sorensen <jes@trained-monkey.org>,
	linux-hippi@sunsite.dk, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/net: hippi: Convert timers to use timer_setup()
Date: Wed, 25 Oct 2017 08:58:41 -0400	[thread overview]
Message-ID: <7bfcf28f-749c-8b7a-a999-54054d15c766@gmail.com> (raw)
In-Reply-To: <20171025105129.GA146547@beast>

On 10/25/2017 06:51 AM, 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: Jes Sorensen <jes@trained-monkey.org>
> Cc: linux-hippi@sunsite.dk
> Cc: netdev@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>   drivers/net/hippi/rrunner.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Looks good to me.

Jes

> diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
> index 76cc140774a2..8483f03d5a41 100644
> --- a/drivers/net/hippi/rrunner.c
> +++ b/drivers/net/hippi/rrunner.c
> @@ -1146,10 +1146,10 @@ static inline void rr_raz_rx(struct rr_private *rrpriv,
>   	}
>   }
>   
> -static void rr_timer(unsigned long data)
> +static void rr_timer(struct timer_list *t)
>   {
> -	struct net_device *dev = (struct net_device *)data;
> -	struct rr_private *rrpriv = netdev_priv(dev);
> +	struct rr_private *rrpriv = from_timer(rrpriv, t, timer);
> +	struct net_device *dev = pci_get_drvdata(rrpriv->pci_dev);
>   	struct rr_regs __iomem *regs = rrpriv->regs;
>   	unsigned long flags;
>   
> @@ -1229,7 +1229,7 @@ static int rr_open(struct net_device *dev)
>   
>   	/* Set the timer to switch to check for link beat and perhaps switch
>   	   to an alternate media type. */
> -	setup_timer(&rrpriv->timer, rr_timer, (unsigned long)dev);
> +	timer_setup(&rrpriv->timer, rr_timer, 0);
>   	rrpriv->timer.expires = RUN_AT(5*HZ);           /* 5 sec. watchdog */
>   	add_timer(&rrpriv->timer);
>   
> 

  reply	other threads:[~2017-10-25 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 10:51 Kees Cook
2017-10-25 12:58 ` Jes Sorensen [this message]
2017-10-27  3:09 ` David Miller

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=7bfcf28f-749c-8b7a-a999-54054d15c766@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jes@trained-monkey.org \
    --cc=keescook@chromium.org \
    --cc=linux-hippi@sunsite.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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

all inboxes | Powered by JetHome®