lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 25 Oct 2017 08:58:41 -0400
From:   Jes Sorensen <jes.sorensen@...il.com>
To:     Kees Cook <keescook@...omium.org>,
        "David S. Miller" <davem@...emloft.net>
Cc:     Jes Sorensen <jes@...ined-monkey.org>, linux-hippi@...site.dk,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/net: hippi: Convert timers to use timer_setup()

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@...ined-monkey.org>
> Cc: linux-hippi@...site.dk
> Cc: netdev@...r.kernel.org
> Signed-off-by: Kees Cook <keescook@...omium.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);
>   
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ