summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50c2ffd)
raw | patch | inline | side by side (parent: 50c2ffd)
author | Vincent Brillault <git@lerya.net> | |
Sat, 20 Sep 2014 17:08:40 +0000 (19:08 +0200) | ||
committer | Vincent Brillault <git@lerya.net> | |
Sat, 28 Feb 2015 06:35:41 +0000 (07:35 +0100) |
src/turbostat.c | patch | blob | history |
diff --git a/src/turbostat.c b/src/turbostat.c
index 6995df55a550235a894f9576e848ad85d0c80e27..328d129d0fb6eab4e3eb1536fd7d1a3e4baff56b 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
}
static int __attribute__((warn_unused_result))
-allocate_cpu_set(cpu_set_t * set, size_t * size) {
- set = CPU_ALLOC(topology.max_cpu_id + 1);
- if (set == NULL) {
+allocate_cpu_set(cpu_set_t ** set, size_t * size) {
+ *set = CPU_ALLOC(topology.max_cpu_id + 1);
+ if (*set == NULL) {
ERROR("Unable to allocate CPU state");
return -ERR_CPU_ALLOC;
}
*size = CPU_ALLOC_SIZE(topology.max_cpu_id + 1);
- CPU_ZERO_S(*size, set);
+ CPU_ZERO_S(*size, *set);
return 0;
}
return -ERR_CALLOC;
}
- ret = allocate_cpu_set(cpu_present_set, &cpu_present_setsize);
+ ret = allocate_cpu_set(&cpu_present_set, &cpu_present_setsize);
if (ret != 0)
goto err;
- ret = allocate_cpu_set(cpu_affinity_set, &cpu_affinity_setsize);
+ ret = allocate_cpu_set(&cpu_affinity_set, &cpu_affinity_setsize);
if (ret != 0)
goto err;
- ret = allocate_cpu_set(cpu_saved_affinity_set, &cpu_saved_affinity_setsize);
+ ret = allocate_cpu_set(&cpu_saved_affinity_set, &cpu_saved_affinity_setsize);
if (ret != 0)
goto err;