drivers/net: nuvoton: Convert timers to use timer_setup()
Subsystems (2)
PATCH 1/1 drivers/net: nuvoton: Convert timers to use timer_setup()
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 Wan ZongShun <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc netdev at vger.kernel.org
Signed-off-by Kees Cook <[email protected]>
--- drivers/net/ethernet/nuvoton/w90p910_ether.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/ethernet/nuvoton/w90p910_ether.c +4 -5
@@ -253,10 +253,10 @@ static void update_linkspeed(struct net_device *dev)netif_carrier_on (dev); } -static void w90p910_check_link (unsigned long dev_id) +static void w90p910_check_link (struct timer_list *t) { -struct net_device *dev = (struct net_device *) dev_id; -struct w90p910_ether *ether =netdev_priv (dev); +struct w90p910_ether *ether =from_timer (ether, t, check_timer); +struct net_device *dev = ether->mii.dev;update_linkspeed (dev);mod_timer (ðer->check_timer, jiffies +msecs_to_jiffies (1000 ));
@@ -957,8 +957,7 @@ static int w90p910_ether_setup(struct net_device *dev) ether->mii.mdio_read = w90p910_mdio_read; ether->mii.mdio_write = w90p910_mdio_write; -setup_timer (ðer->check_timer, w90p910_check_link, - (unsigned long )dev); +timer_setup (ðer->check_timer, w90p910_check_link,0 );return 0 ; }
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security
From: Kees Cook <[email protected]>
Date: Wed, 25 Oct 2017 03:51:58 -0700
Quoted 8 lines
In preparation for unconditionally passing the struct
timer_listpointer to all timer callbacks, switch to using the newtimer_setup()andfrom_timer()to pass the timer pointer explicitly.Cc Wan ZongShun <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc netdev at vger.kernel.orgSigned-off-by Kees Cook <[email protected]>
Applied.