linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: peterz@infradead.org, mingo@kernel.org, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Davidlohr Bueso <dave@stgolabs.net>,
	"David S . Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: [PATCH 5/6] net/ipv4: Update ip_tunnel_metadata_cnt static key to modern api
Date: Mon, 26 Mar 2018 14:09:28 -0700	[thread overview]
Message-ID: <20180326210929.5244-6-dave@stgolabs.net> (raw)
In-Reply-To: <20180326210929.5244-1-dave@stgolabs.net>

No changes in refcount semantics -- key init is false; replace

static_key_slow_inc|dec   with   static_branch_inc|dec
static_key_false          with   static_branch_unlikely

Added a '_key' suffix to i2c_trace_msg, for better self
documentation.

Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
 include/net/ip_tunnels.h  | 4 ++--
 net/ipv4/ip_tunnel_core.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 540a4b4417bf..fc494b48a64a 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -466,12 +466,12 @@ static inline struct ip_tunnel_info *lwt_tun_info(struct lwtunnel_state *lwtstat
 	return (struct ip_tunnel_info *)lwtstate->data;
 }
 
-extern struct static_key ip_tunnel_metadata_cnt;
+DECLARE_STATIC_KEY_FALSE(ip_tunnel_metadata_cnt);
 
 /* Returns > 0 if metadata should be collected */
 static inline int ip_tunnel_collect_metadata(void)
 {
-	return static_key_false(&ip_tunnel_metadata_cnt);
+	return static_branch_unlikely(&ip_tunnel_metadata_cnt);
 }
 
 void __init ip_tunnel_core_init(void);
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 2f39479be92f..dde671e97829 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -423,17 +423,17 @@ void __init ip_tunnel_core_init(void)
 	lwtunnel_encap_add_ops(&ip6_tun_lwt_ops, LWTUNNEL_ENCAP_IP6);
 }
 
-struct static_key ip_tunnel_metadata_cnt = STATIC_KEY_INIT_FALSE;
+DEFINE_STATIC_KEY_FALSE(ip_tunnel_metadata_cnt);
 EXPORT_SYMBOL(ip_tunnel_metadata_cnt);
 
 void ip_tunnel_need_metadata(void)
 {
-	static_key_slow_inc(&ip_tunnel_metadata_cnt);
+	static_branch_inc(&ip_tunnel_metadata_cnt);
 }
 EXPORT_SYMBOL_GPL(ip_tunnel_need_metadata);
 
 void ip_tunnel_unneed_metadata(void)
 {
-	static_key_slow_dec(&ip_tunnel_metadata_cnt);
+	static_branch_dec(&ip_tunnel_metadata_cnt);
 }
 EXPORT_SYMBOL_GPL(ip_tunnel_unneed_metadata);
-- 
2.13.6

  parent reply	other threads:[~2018-03-26 21:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 21:09 [PATCH v2 -next 0/6] update static key users to modern api Davidlohr Bueso
2018-03-26 21:09 ` [PATCH 1/6] drivers/i2c: Update i2c_trace_msg static key " Davidlohr Bueso
2018-04-03 13:20   ` Wolfram Sang
2018-04-03 14:00   ` David Howells
2018-04-03 14:49   ` Wolfram Sang
2018-03-26 21:09 ` [PATCH 2/6] drivers/irqchip: Update supports_deactivate " Davidlohr Bueso
2018-03-28 13:47   ` Marc Zyngier
2018-03-28 13:46     ` Davidlohr Bueso
2018-03-26 21:09 ` [PATCH 3/6] sched/core: Update preempt_notifier_key " Davidlohr Bueso
2018-03-27  7:46   ` [tip:sched/core] sched/core: Update preempt_notifier_key to modern API tip-bot for Davidlohr Bueso
2018-03-26 21:09 ` [PATCH 4/6] perf,x86: Update rdpmc_always_available static key to modern api Davidlohr Bueso
2018-03-27  7:47   ` [tip:perf/core] perf/x86: Update rdpmc_always_available static key to the modern API tip-bot for Davidlohr Bueso
2018-03-26 21:09 ` Davidlohr Bueso [this message]
2018-03-27 15:44   ` [PATCH 5/6] net/ipv4: Update ip_tunnel_metadata_cnt static key to modern api David Miller
2018-03-27 15:37     ` Davidlohr Bueso
2018-03-26 21:09 ` [PATCH 6/6] net/sock: Update memalloc_socks " Davidlohr Bueso
2018-03-27  7:36 ` [PATCH v2 -next 0/6] update static key users " Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180326210929.5244-6-dave@stgolabs.net \
    --to=dave@stgolabs.net \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).