diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-16 20:29:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-18 07:40:27 -0400 |
commit | ba421793505f91026cccbf9398ff866dd308036d (patch) | |
tree | e9bbcadbd1034d82be5d1811578536baca3eb5b9 /net/atm | |
parent | 99767f278ccf74a1857069bb3eec991e572f94cd (diff) |
net: atm: 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. Also drops a redundant initialization
that is already set up by DEFINE_TIMER.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Hans Liljestrand <ishkamiel@gmail.com>
Cc: "Reshetova, Elena" <elena.reshetova@intel.com>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Roopa Prabhu <roopa@cumulusnetworks.com>
Cc: Augusto Mecking Caringi <augustocaringi@gmail.com>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm')
-rw-r--r-- | net/atm/clip.c | 4 | ||||
-rw-r--r-- | net/atm/lec.c | 19 | ||||
-rw-r--r-- | net/atm/mpc.c | 1 |
3 files changed, 11 insertions, 13 deletions
diff --git a/net/atm/clip.c b/net/atm/clip.c index 65f706e4344c..d4f6029d5109 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -153,7 +153,7 @@ static int neigh_check_cb(struct neighbour *n) | |||
153 | return 1; | 153 | return 1; |
154 | } | 154 | } |
155 | 155 | ||
156 | static void idle_timer_check(unsigned long dummy) | 156 | static void idle_timer_check(struct timer_list *unused) |
157 | { | 157 | { |
158 | write_lock(&arp_tbl.lock); | 158 | write_lock(&arp_tbl.lock); |
159 | __neigh_for_each_release(&arp_tbl, neigh_check_cb); | 159 | __neigh_for_each_release(&arp_tbl, neigh_check_cb); |
@@ -887,7 +887,7 @@ static int __init atm_clip_init(void) | |||
887 | register_netdevice_notifier(&clip_dev_notifier); | 887 | register_netdevice_notifier(&clip_dev_notifier); |
888 | register_inetaddr_notifier(&clip_inet_notifier); | 888 | register_inetaddr_notifier(&clip_inet_notifier); |
889 | 889 | ||
890 | setup_timer(&idle_timer, idle_timer_check, 0); | 890 | timer_setup(&idle_timer, idle_timer_check, 0); |
891 | 891 | ||
892 | #ifdef CONFIG_PROC_FS | 892 | #ifdef CONFIG_PROC_FS |
893 | { | 893 | { |
diff --git a/net/atm/lec.c b/net/atm/lec.c index a3d93a1bb133..c976196da3ea 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -1232,7 +1232,7 @@ static void lane2_associate_ind(struct net_device *dev, const u8 *mac_addr, | |||
1232 | #define LEC_ARP_REFRESH_INTERVAL (3*HZ) | 1232 | #define LEC_ARP_REFRESH_INTERVAL (3*HZ) |
1233 | 1233 | ||
1234 | static void lec_arp_check_expire(struct work_struct *work); | 1234 | static void lec_arp_check_expire(struct work_struct *work); |
1235 | static void lec_arp_expire_arp(unsigned long data); | 1235 | static void lec_arp_expire_arp(struct timer_list *t); |
1236 | 1236 | ||
1237 | /* | 1237 | /* |
1238 | * Arp table funcs | 1238 | * Arp table funcs |
@@ -1559,8 +1559,7 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv, | |||
1559 | } | 1559 | } |
1560 | ether_addr_copy(to_return->mac_addr, mac_addr); | 1560 | ether_addr_copy(to_return->mac_addr, mac_addr); |
1561 | INIT_HLIST_NODE(&to_return->next); | 1561 | INIT_HLIST_NODE(&to_return->next); |
1562 | setup_timer(&to_return->timer, lec_arp_expire_arp, | 1562 | timer_setup(&to_return->timer, lec_arp_expire_arp, 0); |
1563 | (unsigned long)to_return); | ||
1564 | to_return->last_used = jiffies; | 1563 | to_return->last_used = jiffies; |
1565 | to_return->priv = priv; | 1564 | to_return->priv = priv; |
1566 | skb_queue_head_init(&to_return->tx_wait); | 1565 | skb_queue_head_init(&to_return->tx_wait); |
@@ -1569,11 +1568,11 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv, | |||
1569 | } | 1568 | } |
1570 | 1569 | ||
1571 | /* Arp sent timer expired */ | 1570 | /* Arp sent timer expired */ |
1572 | static void lec_arp_expire_arp(unsigned long data) | 1571 | static void lec_arp_expire_arp(struct timer_list *t) |
1573 | { | 1572 | { |
1574 | struct lec_arp_table *entry; | 1573 | struct lec_arp_table *entry; |
1575 | 1574 | ||
1576 | entry = (struct lec_arp_table *)data; | 1575 | entry = from_timer(entry, t, timer); |
1577 | 1576 | ||
1578 | pr_debug("\n"); | 1577 | pr_debug("\n"); |
1579 | if (entry->status == ESI_ARP_PENDING) { | 1578 | if (entry->status == ESI_ARP_PENDING) { |
@@ -1591,10 +1590,10 @@ static void lec_arp_expire_arp(unsigned long data) | |||
1591 | } | 1590 | } |
1592 | 1591 | ||
1593 | /* Unknown/unused vcc expire, remove associated entry */ | 1592 | /* Unknown/unused vcc expire, remove associated entry */ |
1594 | static void lec_arp_expire_vcc(unsigned long data) | 1593 | static void lec_arp_expire_vcc(struct timer_list *t) |
1595 | { | 1594 | { |
1596 | unsigned long flags; | 1595 | unsigned long flags; |
1597 | struct lec_arp_table *to_remove = (struct lec_arp_table *)data; | 1596 | struct lec_arp_table *to_remove = from_timer(to_remove, t, timer); |
1598 | struct lec_priv *priv = to_remove->priv; | 1597 | struct lec_priv *priv = to_remove->priv; |
1599 | 1598 | ||
1600 | del_timer(&to_remove->timer); | 1599 | del_timer(&to_remove->timer); |
@@ -1799,7 +1798,7 @@ static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv, | |||
1799 | else | 1798 | else |
1800 | send_to_lecd(priv, l_arp_xmt, mac_to_find, NULL, NULL); | 1799 | send_to_lecd(priv, l_arp_xmt, mac_to_find, NULL, NULL); |
1801 | entry->timer.expires = jiffies + (1 * HZ); | 1800 | entry->timer.expires = jiffies + (1 * HZ); |
1802 | entry->timer.function = lec_arp_expire_arp; | 1801 | entry->timer.function = (TIMER_FUNC_TYPE)lec_arp_expire_arp; |
1803 | add_timer(&entry->timer); | 1802 | add_timer(&entry->timer); |
1804 | found = priv->mcast_vcc; | 1803 | found = priv->mcast_vcc; |
1805 | } | 1804 | } |
@@ -1999,7 +1998,7 @@ lec_vcc_added(struct lec_priv *priv, const struct atmlec_ioc *ioc_data, | |||
1999 | entry->old_recv_push = old_push; | 1998 | entry->old_recv_push = old_push; |
2000 | entry->status = ESI_UNKNOWN; | 1999 | entry->status = ESI_UNKNOWN; |
2001 | entry->timer.expires = jiffies + priv->vcc_timeout_period; | 2000 | entry->timer.expires = jiffies + priv->vcc_timeout_period; |
2002 | entry->timer.function = lec_arp_expire_vcc; | 2001 | entry->timer.function = (TIMER_FUNC_TYPE)lec_arp_expire_vcc; |
2003 | hlist_add_head(&entry->next, &priv->lec_no_forward); | 2002 | hlist_add_head(&entry->next, &priv->lec_no_forward); |
2004 | add_timer(&entry->timer); | 2003 | add_timer(&entry->timer); |
2005 | dump_arp_table(priv); | 2004 | dump_arp_table(priv); |
@@ -2083,7 +2082,7 @@ lec_vcc_added(struct lec_priv *priv, const struct atmlec_ioc *ioc_data, | |||
2083 | entry->status = ESI_UNKNOWN; | 2082 | entry->status = ESI_UNKNOWN; |
2084 | hlist_add_head(&entry->next, &priv->lec_arp_empty_ones); | 2083 | hlist_add_head(&entry->next, &priv->lec_arp_empty_ones); |
2085 | entry->timer.expires = jiffies + priv->vcc_timeout_period; | 2084 | entry->timer.expires = jiffies + priv->vcc_timeout_period; |
2086 | entry->timer.function = lec_arp_expire_vcc; | 2085 | entry->timer.function = (TIMER_FUNC_TYPE)lec_arp_expire_vcc; |
2087 | add_timer(&entry->timer); | 2086 | add_timer(&entry->timer); |
2088 | pr_debug("After vcc was added\n"); | 2087 | pr_debug("After vcc was added\n"); |
2089 | dump_arp_table(priv); | 2088 | dump_arp_table(priv); |
diff --git a/net/atm/mpc.c b/net/atm/mpc.c index 5677147209e8..b43d99430eb6 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c | |||
@@ -799,7 +799,6 @@ static int atm_mpoa_mpoad_attach(struct atm_vcc *vcc, int arg) | |||
799 | int err; | 799 | int err; |
800 | 800 | ||
801 | if (mpcs == NULL) { | 801 | if (mpcs == NULL) { |
802 | init_timer(&mpc_timer); | ||
803 | mpc_timer_refresh(); | 802 | mpc_timer_refresh(); |
804 | 803 | ||
805 | /* This lets us now how our LECs are doing */ | 804 | /* This lets us now how our LECs are doing */ |