* [PATCH net-next 3/8] mld: use mca_{get | put} instead of refcount_{dec | inc}
@ 2021-02-08 17:54 Taehee Yoo
0 siblings, 0 replies; only message in thread
From: Taehee Yoo @ 2021-02-08 17:54 UTC (permalink / raw)
To: davem, kuba, netdev, dsahern, xiyou.wangcong; +Cc: ap420073
mca_{get | put} are wrapper function of refcount_{dec | inc}.
And using only wrapper functions is more readable.
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
net/ipv6/mcast.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 9c4dc4c2ff01..45a983ed091e 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -723,7 +723,7 @@ static void igmp6_group_dropped(struct ifmcaddr6 *mc)
spin_lock_bh(&mc->mca_lock);
if (del_timer(&mc->mca_timer))
- refcount_dec(&mc->mca_refcnt);
+ mca_put(mc);
spin_unlock_bh(&mc->mca_lock);
}
@@ -1089,7 +1089,7 @@ static void igmp6_group_queried(struct ifmcaddr6 *mc, unsigned long resptime)
return;
if (del_timer(&mc->mca_timer)) {
- refcount_dec(&mc->mca_refcnt);
+ mca_put(mc);
delay = mc->mca_timer.expires - jiffies;
}
@@ -1098,7 +1098,7 @@ static void igmp6_group_queried(struct ifmcaddr6 *mc, unsigned long resptime)
mc->mca_timer.expires = jiffies + delay;
if (!mod_timer(&mc->mca_timer, jiffies + delay))
- refcount_inc(&mc->mca_refcnt);
+ mca_get(mc);
mc->mca_flags |= MAF_TIMER_RUNNING;
}
@@ -1493,7 +1493,7 @@ int igmp6_event_report(struct sk_buff *skb)
if (ipv6_addr_equal(&mc->mca_addr, &mld->mld_mca)) {
spin_lock(&mc->mca_lock);
if (del_timer(&mc->mca_timer))
- refcount_dec(&mc->mca_refcnt);
+ mca_put(mc);
mc->mca_flags &= ~(MAF_LAST_REPORTER | MAF_TIMER_RUNNING);
spin_unlock(&mc->mca_lock);
break;
@@ -2446,12 +2446,12 @@ static void igmp6_join_group(struct ifmcaddr6 *mc)
spin_lock_bh(&mc->mca_lock);
if (del_timer(&mc->mca_timer)) {
- refcount_dec(&mc->mca_refcnt);
+ mca_put(mc);
delay = mc->mca_timer.expires - jiffies;
}
if (!mod_timer(&mc->mca_timer, jiffies + delay))
- refcount_inc(&mc->mca_refcnt);
+ mca_get(mc);
mc->mca_flags |= MAF_TIMER_RUNNING | MAF_LAST_REPORTER;
spin_unlock_bh(&mc->mca_lock);
}
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-08 17:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 17:54 [PATCH net-next 3/8] mld: use mca_{get | put} instead of refcount_{dec | inc} Taehee Yoo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).