lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210208175421.5126-1-ap420073@gmail.com>
Date:   Mon,  8 Feb 2021 17:54:21 +0000
From:   Taehee Yoo <ap420073@...il.com>
To:     davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org,
        dsahern@...nel.org, xiyou.wangcong@...il.com
Cc:     ap420073@...il.com
Subject: [PATCH net-next 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.

Signed-off-by: Taehee Yoo <ap420073@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ