From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbdJYM6q (ORCPT ); Wed, 25 Oct 2017 08:58:46 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:49161 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750765AbdJYM6o (ORCPT ); Wed, 25 Oct 2017 08:58:44 -0400 X-Google-Smtp-Source: ABhQp+SGRRR/asVpgGo0KPdpM1KIAfgjCyXfKHt10lXOq1YHvj01u5swYMN0+ubX5B5WghciYQt3Rg== From: Jes Sorensen X-Google-Original-From: Jes Sorensen Subject: Re: [PATCH] drivers/net: hippi: Convert timers to use timer_setup() To: Kees Cook , "David S. Miller" Cc: Jes Sorensen , linux-hippi@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171025105129.GA146547@beast> Message-ID: <7bfcf28f-749c-8b7a-a999-54054d15c766@gmail.com> Date: Wed, 25 Oct 2017 08:58:41 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171025105129.GA146547@beast> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: linux-hippi@sunsite.dk > Cc: netdev@vger.kernel.org > Signed-off-by: Kees Cook > --- > 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); > >