Skip to contentSkip to conversation

mld: use mca_{get | put} instead of refcount_{dec | inc}

PATCH Superseded Taehee Yoo 1 participant 1 message Feb 8, 2021

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Taehee Yoo

author
#0 lore raw

PATCH 3/8 mld: use mca_{get | put} instead of refcount_{dec | inc}

mca_{get | put} are wrapper function of refcount_{dec | inc}. And using only wrapper functions is more readable.

---
 net/ipv6/mcast.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
net/ipv6/mcast.c +6 -6
index 9c4dc4c2ff01..45a983ed091e 100644
@@ -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);
 }
Signature · 1 line
2.17.1