test_numa_migrate.c: In function 'parse_memory_numa_stat.isra':
  test_numa_migrate.c:521:34: warning: 'node' may be used uninitialized 
[-Wmaybe-uninitialized]
    521 |                         node_stat[node] = node_bytes;
        |                                  ^
  test_numa_migrate.c:485:16: note: 'node' was declared here
    485 |         size_t node;
        |                ^~~~

Initialize 'node' to 0 to silence the -Wmaybe-uninitialized warning.
The variable is always set inside the loop before use in the else branch,
but GCC cannot prove this statically.

https://virtuozzo.atlassian.net/browse/VSTOR-127529
Signed-off-by: Konstantin Khorenko <[email protected]>

Feature: fix selftests
---
 tools/testing/selftests/cgroup/test_numa_migrate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/cgroup/test_numa_migrate.c 
b/tools/testing/selftests/cgroup/test_numa_migrate.c
index e5119da4fc01..5f4a55684f61 100644
--- a/tools/testing/selftests/cgroup/test_numa_migrate.c
+++ b/tools/testing/selftests/cgroup/test_numa_migrate.c
@@ -510,6 +510,7 @@ static int parse_memory_numa_stat(struct test_context *ctx, 
const char *cgroup,
        token = strtok(stat_str, node_delim);
        /* skip the key itself */
        token = strtok(NULL, node_delim);
+       node = 0;
        step = 1;
        while (token != NULL) {
                if (step % 2) {
-- 
2.47.1

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to