[PATCH] perf_event.h: Add RCU Annotation to struct ring_buffer in perf_event
From: madhuparnabhowmik10
Date: Thu Jan 30 2020 - 09:47:53 EST
From: Madhuparna Bhowmik <madhuparnabhowmik10@xxxxxxxxx>
This patch fixes the following sparse errors in events/core.c
and events/ring_buffer.c by adding RCU Annotation to struct
ring_buffer in perf_event:
kernel/events/core.c:5597:9: error: incompatible types in comparison expression
kernel/events/core.c:5303:22: error: incompatible types in comparison expression
kernel/events/core.c:5439:14: error: incompatible types in comparison expression
kernel/events/core.c:5472:14: error: incompatible types in comparison expression
kernel/events/core.c:5529:14: error: incompatible types in comparison expression
kernel/events/core.c:5615:14: error: incompatible types in comparison expression
kernel/events/core.c:5615:14: error: incompatible types in comparison expression
kernel/events/core.c:7183:13: error: incompatible types in comparison expression
kernel/events/ring_buffer.c:169:14: error: incompatible types in comparison expression
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@xxxxxxxxx>
---
include/linux/perf_event.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 6d4c22aee384..1691107d2800 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -694,7 +694,7 @@ struct perf_event {
struct mutex mmap_mutex;
atomic_t mmap_count;
- struct ring_buffer *rb;
+ struct ring_buffer __rcu *rb;
struct list_head rb_entry;
unsigned long rcu_batches;
int rcu_pending;
--
2.17.1