summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/compiler.h5
-rw-r--r--lib/test_context-analysis.c11
2 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index af16624b29fd..cb2f6050bdf7 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -149,10 +149,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
#endif
#ifndef RELOC_HIDE
-# define RELOC_HIDE(ptr, off) \
- ({ unsigned long __ptr; \
- __ptr = (unsigned long) (ptr); \
- (typeof(ptr)) (__ptr + (off)); })
+# define RELOC_HIDE(ptr, off) ((typeof(ptr))((unsigned long)(ptr) + (off)))
#endif
#define absolute_pointer(val) RELOC_HIDE((void *)(val), 0)
diff --git a/lib/test_context-analysis.c b/lib/test_context-analysis.c
index 140efa8a9763..06b4a6a028e0 100644
--- a/lib/test_context-analysis.c
+++ b/lib/test_context-analysis.c
@@ -596,3 +596,14 @@ static void __used test_ww_mutex_lock_ctx(struct test_ww_mutex_data *d)
ww_mutex_destroy(&d->mtx);
}
+
+static DEFINE_PER_CPU(raw_spinlock_t, test_per_cpu_lock);
+
+static void __used test_per_cpu(int cpu)
+{
+ raw_spin_lock(&per_cpu(test_per_cpu_lock, cpu));
+ raw_spin_unlock(&per_cpu(test_per_cpu_lock, cpu));
+
+ raw_spin_lock(per_cpu_ptr(&test_per_cpu_lock, cpu));
+ raw_spin_unlock(per_cpu_ptr(&test_per_cpu_lock, cpu));
+}