treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / testing / selftests / rcutorture / formal / srcu-cbmc / src / misc.h
blobaca50030f954f9a7d9d6fb94c3d79a29f163fe03
1 #ifndef MISC_H
2 #define MISC_H
4 #include "assume.h"
5 #include "int_typedefs.h"
6 #include "locks.h"
8 #include <linux/types.h>
10 /* Probably won't need to deal with bottom halves. */
11 static inline void local_bh_disable(void) {}
12 static inline void local_bh_enable(void) {}
14 #define MODULE_ALIAS(X)
15 #define module_param(...)
16 #define EXPORT_SYMBOL_GPL(x)
18 #define container_of(ptr, type, member) ({ \
19 const typeof(((type *)0)->member) *__mptr = (ptr); \
20 (type *)((char *)__mptr - offsetof(type, member)); \
23 #ifndef USE_SIMPLE_SYNC_SRCU
24 /* Abuse udelay to make sure that busy loops terminate. */
25 #define udelay(x) assume(0)
27 #else
29 /* The simple custom synchronize_srcu is ok with try_check_zero failing. */
30 #define udelay(x) do { } while (0)
31 #endif
33 #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
34 do { } while (0)
36 #define notrace
38 /* Avoid including rcupdate.h */
39 struct rcu_synchronize {
40 struct rcu_head head;
41 struct completion completion;
44 void wakeme_after_rcu(struct rcu_head *head);
46 #define rcu_lock_acquire(a) do { } while (0)
47 #define rcu_lock_release(a) do { } while (0)
48 #define rcu_lockdep_assert(c, s) do { } while (0)
49 #define RCU_LOCKDEP_WARN(c, s) do { } while (0)
51 /* Let CBMC non-deterministically choose switch between normal and expedited. */
52 bool rcu_gp_is_normal(void);
53 bool rcu_gp_is_expedited(void);
55 /* Do the same for old versions of rcu. */
56 #define rcu_expedited (rcu_gp_is_expedited())
58 #endif