diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-03-16 17:06:21 +0100 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-03-16 17:06:21 +0100 |
commit | 99c9e3033abe511190bcf86c9d7578c6d8026b85 (patch) | |
tree | 7cb147f0d40538a848c26ef0fd241eab7aab7512 | |
parent | 46c917dd2b4f2e126f6dbe074803323200a11d55 (diff) |
flowtop: rcu: omit rcu_assign_pointer
If the new pointer is NULL anyway, this results in a constant expression
during compile time (NULL != NULL) where a barrier is left out. Thus, it
will have no different effect using rcu_assign_pointer() than assigning
it directly.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-rw-r--r-- | flowtop.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -366,13 +366,12 @@ static void flow_list_destroy_entry(struct flow_list *fl, n2 = flow_list_find_prev_id(fl, id); if (n2) { rcu_assign_pointer(n2->next, n1->next); - rcu_assign_pointer(n1->next, NULL); + n1->next = NULL; flow_entry_xfree(n1); } else { flow_entry_xfree(fl->head); - - rcu_assign_pointer(fl->head, NULL); + fl->head = NULL; } } } @@ -383,7 +382,7 @@ static void flow_list_destroy(struct flow_list *fl) while (fl->head != NULL) { n = rcu_dereference(fl->head->next); - rcu_assign_pointer(fl->head->next, NULL); + fl->head->next = NULL; flow_entry_xfree(fl->head); rcu_assign_pointer(fl->head, n); |