summaryrefslogtreecommitdiff
path: root/datapath/flow_table.c
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2014-06-23 23:00:55 -0700
committerAndy Zhou <azhou@nicira.com>2014-06-25 14:20:40 -0700
commit5c75f4beed9b3e540d8be0f31947c7d8e3271703 (patch)
tree0ffd97840a45924c2ce4c91a64c408b4b9debb13 /datapath/flow_table.c
parent1ffd16af7074915642d3d03e561ea007ffbbc765 (diff)
downloadopenvswitch-5c75f4beed9b3e540d8be0f31947c7d8e3271703.tar.gz
datapath: fix sparse warning in function tbl_mask_array_delete_mask()
Sparse gives "incompatible types in comparison expression (different address spaces)" warning messages. Fix this by add rcu_dereference() wrappers. Reported-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'datapath/flow_table.c')
-rw-r--r--datapath/flow_table.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/datapath/flow_table.c b/datapath/flow_table.c
index 41f7cb86e..9746822e5 100644
--- a/datapath/flow_table.c
+++ b/datapath/flow_table.c
@@ -286,10 +286,10 @@ static void tbl_mask_array_delete_mask(struct mask_array *ma,
* </Note>
*/
for (i = 0; i < ma->count; i++)
- if (mask == ma->masks[i]) {
+ if (mask == ovsl_dereference(ma->masks[i])) {
struct sw_flow_mask *last;
- last = ma->masks[ma->count - 1];
+ last = ovsl_dereference(ma->masks[ma->count - 1]);
rcu_assign_pointer(ma->masks[i], last);
ma->count--;
break;
@@ -297,7 +297,7 @@ static void tbl_mask_array_delete_mask(struct mask_array *ma,
/* Remove the deleted mask pointers from the invalid section. */
for (i = ma->count; i < ma->max; i++)
- if (mask == ma->masks[i])
+ if (mask == ovsl_dereference(ma->masks[i]))
RCU_INIT_POINTER(ma->masks[i], NULL);
}