2a83b538dd6ac23b87bc93e57fbfef4ff7aafab1
[deliverable/linux.git] / include / linux / once.h
1 #ifndef _LINUX_ONCE_H
2 #define _LINUX_ONCE_H
3
4 #include <linux/types.h>
5 #include <linux/jump_label.h>
6
7 bool __get_random_once(void *buf, int nbytes, bool *done,
8 struct static_key *once_key);
9
10 #define get_random_once(buf, nbytes) \
11 ({ \
12 bool ___ret = false; \
13 static bool ___done = false; \
14 static struct static_key ___once_key = \
15 STATIC_KEY_INIT_TRUE; \
16 if (static_key_true(&___once_key)) \
17 ___ret = __get_random_once((buf), \
18 (nbytes), \
19 &___done, \
20 &___once_key); \
21 ___ret; \
22 })
23
24 #endif /* _LINUX_ONCE_H */
This page took 0.034404 seconds and 4 git commands to generate.