summaryrefslogtreecommitdiff
path: root/include/linux/once.h
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2017-11-28 18:06:34 +0300
committerTony Lindgren <tony@atomide.com>2017-11-28 18:06:34 +0300
commit2db57789e6612ce0cf2fcbb577a1c8307b708566 (patch)
treedd9f9e3dffabbf5cb932fcf5055ab329ca940fa0 /include/linux/once.h
parentf0c96c6d40312b1a76cd36709dc3eb5948c1b97f (diff)
parente9a9bb4e4779ca74cb52a6e2f8acbc0881d3bb18 (diff)
downloadlinux-2db57789e6612ce0cf2fcbb577a1c8307b708566.tar.xz
Merge branch 'soc-fixes' into omap-for-v4.15/fixes
Diffstat (limited to 'include/linux/once.h')
-rw-r--r--include/linux/once.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/once.h b/include/linux/once.h
index 9c98aaa87cbc..9225ee6d96c7 100644
--- a/include/linux/once.h
+++ b/include/linux/once.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_ONCE_H
#define _LINUX_ONCE_H
@@ -5,7 +6,7 @@
#include <linux/jump_label.h>
bool __do_once_start(bool *done, unsigned long *flags);
-void __do_once_done(bool *done, struct static_key *once_key,
+void __do_once_done(bool *done, struct static_key_true *once_key,
unsigned long *flags);
/* Call a function exactly once. The idea of DO_ONCE() is to perform
@@ -38,8 +39,8 @@ void __do_once_done(bool *done, struct static_key *once_key,
({ \
bool ___ret = false; \
static bool ___done = false; \
- static struct static_key ___once_key = STATIC_KEY_INIT_TRUE; \
- if (static_key_true(&___once_key)) { \
+ static DEFINE_STATIC_KEY_TRUE(___once_key); \
+ if (static_branch_unlikely(&___once_key)) { \
unsigned long ___flags; \
___ret = __do_once_start(&___done, &___flags); \
if (unlikely(___ret)) { \