diff mbox series

[net-next,3/8] mld: use mca_{get | put} instead of refcount_{dec | inc}

Message ID 20210208175421.5126-1-ap420073@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series mld: change context from atomic to sleepable | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 1 maintainers not CCed: yoshfuji@linux-ipv6.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 11 this patch: 11
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 46 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 11 this patch: 11
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Taehee Yoo Feb. 8, 2021, 5:54 p.m. UTC
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 mbox series

Patch

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);
 }