Skip to contentSkip to conversation

tests: fix counting typo error

PATCH In review Tianjia Zhang 3 participants 3 messages Oct 10, 2019 – Oct 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: fix counting typo error

Instead of global variables, local variables should be incrementing, This is a typo fix.

---
 tests/test-rcu-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-rcu-list.c +1 -1
index 6f076473e0..c0fc47ded4 100644
@@ -219,7 +219,7 @@ static void *rcu_q_updater(void *arg)
             j++;
             if (target_el == j) {
                 struct list_element *new_el = g_new(struct list_element, 1);
-                n_nodes += n_nodes_local;
+                n_nodes_local++;
                 TEST_LIST_INSERT_AFTER_RCU(el, new_el, entry);
                 break;
             }
Signature · 1 line
2.17.1
#1 lore raw
Quoted 7 lines · Tianjia Zhang

Instead of global variables, local variables should be incrementing, This is a typo fix.

---
 tests/test-rcu-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

CCing Paolo Bonzini, author of the RCU code.

Quoted 18 lines
tests/test-rcu-list.c +1 -1
index 6f076473e0..c0fc47ded4 100644
@@ -219,7 +219,7 @@ static void *rcu_q_updater(void *arg)
             j++;
             if (target_el == j) {
                 struct list_element *new_el = g_new(struct list_element, 1);
-                n_nodes += n_nodes_local;
+                n_nodes_local++;
                 TEST_LIST_INSERT_AFTER_RCU(el, new_el, entry);
                 break;
             }
Signature · 1 line
2.17.1
#2 lore raw
In reply to Tianjia Zhang
Quoted 2 lines · Tianjia Zhang

Instead of global variables, local variables should be incrementing, This is a typo fix.

Impact?

The commit message calls it a "typo", which suggests there is none. The patch makes me suspect the bug is more serious than that.

Quoted 19 lines
---
 tests/test-rcu-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-rcu-list.c +1 -1
index 6f076473e0..c0fc47ded4 100644
@@ -219,7 +219,7 @@ static void *rcu_q_updater(void *arg)
             j++;
             if (target_el == j) {
                 struct list_element *new_el = g_new(struct list_element, 1);
-                n_nodes += n_nodes_local;
+                n_nodes_local++;
                 TEST_LIST_INSERT_AFTER_RCU(el, new_el, entry);
                 break;
             }