Skip to content

Commit 3bd3b9e

Browse files
himanshujha199640davem330
authored andcommitted
net: bcm63xx_enet: Use setup_timer and mod_timer
Use setup_timer and mod_timer API instead of structure assignments. This is done using Coccinelle and semantic patch used for this as follows: @@ expression x,y,z,a,b; @@ -init_timer (&x); +setup_timer (&x, y, z); +mod_timer (&a, b); -x.function = y; -x.data = z; -x.expires = b; -add_timer(&a); Signed-off-by: Himanshu Jha <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5b2ef20 commit 3bd3b9e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/net/ethernet/broadcom/bcm63xx_enet.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,11 +2331,8 @@ static int bcm_enetsw_open(struct net_device *dev)
23312331
}
23322332

23332333
/* start phy polling timer */
2334-
init_timer(&priv->swphy_poll);
2335-
priv->swphy_poll.function = swphy_poll_timer;
2336-
priv->swphy_poll.data = (unsigned long)priv;
2337-
priv->swphy_poll.expires = jiffies;
2338-
add_timer(&priv->swphy_poll);
2334+
setup_timer(&priv->swphy_poll, swphy_poll_timer, (unsigned long)priv);
2335+
mod_timer(&priv->swphy_poll, jiffies);
23392336
return 0;
23402337

23412338
out:

0 commit comments

Comments
 (0)