From b79e6862b1bd258fb05ba7205fde98fea261664d Mon Sep 17 00:00:00 2001 From: Tuukka Tikkanen Date: Fri, 2 Jan 2015 09:56:43 +0200 Subject: Idlestat: Remove unused function cluster_data() The function cluster_data() has no callers, remove it. Signed-off-by: Tuukka Tikkanen --- idlestat.c | 69 -------------------------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/idlestat.c b/idlestat.c index bcaf122..f9fe6b4 100644 --- a/idlestat.c +++ b/idlestat.c @@ -1005,75 +1005,6 @@ struct cpuidle_datas *idlestat_load(const char *filename) return ptrerror(NULL); } -struct cpuidle_datas *cluster_data(struct cpuidle_datas *datas) -{ - struct cpuidle_cstate *c1, *cstates, *tmp; - struct cpuidle_datas *result; - int i, j; - int cstate_max = -1; - - result = calloc(sizeof(*result), 1); - if (!result) - return NULL; - - result->nrcpus = -1; /* the cluster */ - result->pstates = NULL; - result->cstates = calloc(sizeof(*result->cstates), 1); - if (!result->cstates) { - free(result); - return NULL; - } - - /* hack but negligible overhead */ - for (i = 0; i < datas->nrcpus; i++) - cstate_max = MAX(cstate_max, datas->cstates[i].cstate_max); - result->cstates[0].cstate_max = cstate_max; - - for (i = 0; i < cstate_max + 1; i++) { - - for (j = 0, cstates = NULL; j < datas->nrcpus; j++) { - - c1 = &datas->cstates[j].cstate[i]; - - tmp = inter(cstates, c1); - if (cstates && cstates != tmp && - cstates->inter_result) { - free(cstates->data); - free(cstates); - } - cstates = tmp; - - if (!cstates) - continue; - if (is_err(cstates)) { - release_cstate_info(result->cstates, 1); - free(result); - return ptrerror(NULL); - } - } - - /* copy state names from the first cpu */ - cstates->name = strdup(datas->cstates[0].cstate[i].name); - - result->cstates[0].cstate[i] = *cstates; - result->cstates[0].cstate[i].inter_result = 0; - - /* - * Free cstates if it has been allocated by inter() - * Do not free things pointed to by members of cstates - * even if you free cstates itself. - */ - if (cstates && cstates->inter_result) { - free(cstates); - } else { - fprintf(stderr, "Warning: %s aliased cstates at %p\n", - __func__, cstates); - } - } - - return result; -} - struct cpuidle_cstates *core_cluster_data(struct cpu_core *s_core) { struct cpuidle_cstate *c1, *cstates, *tmp; -- cgit v1.2.3