From 633d3ac7dc4ac473a4e2a4f7bff32f3023b45cf6 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Wed, 29 Dec 2010 15:05:02 -0800 Subject: [PATCH] datapath: Don't check for RCU in free_buckets in table. free_buckets() is only called in places where the lifetime of its container has ended: on allocation failure and on deletion after a grace period. If the container can no longer be referenced then neither can the buckets, so it is safe to directly free them. sparse complains if the pointer is directly dereferenced and lockdep complains if the RCU functions are used without some type of lock, both of which are fine in this case. This adds an explicit cast to avoid the complaints. Found with lockdep. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- datapath/table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/table.c b/datapath/table.c index 5c1b82a4..b54534a6 100644 --- a/datapath/table.c +++ b/datapath/table.c @@ -51,7 +51,7 @@ static void free_buckets(struct tbl_bucket __rcu ***l1, unsigned int j; for (j = 0; j < TBL_L2_SIZE; j++) { - struct tbl_bucket *bucket = rcu_dereference(l2[j]); + struct tbl_bucket *bucket = (struct tbl_bucket __force *)l2[j]; if (!bucket) continue; -- 2.30.2