From 0441d713c248a778f090e5f105606c6bfff79ff9 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 15 Dec 2018 18:36:36 +0100 Subject: [PATCH] intel_pmu plugin: fix some minor style issues --- src/intel_pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/intel_pmu.c b/src/intel_pmu.c index c9bbb50c..ff92beed 100644 --- a/src/intel_pmu.c +++ b/src/intel_pmu.c @@ -267,7 +267,7 @@ static int pmu_config_hw_events(oconfig_item_t *ci) { return -EINVAL; } - g_ctx.hw_events = calloc(ci->values_num, sizeof(char *)); + g_ctx.hw_events = calloc(ci->values_num, sizeof(*g_ctx.hw_events)); if (g_ctx.hw_events == NULL) { ERROR(PMU_PLUGIN ": Failed to allocate hw events."); return -ENOMEM; @@ -446,7 +446,7 @@ static int pmu_add_events(struct eventlist *el, uint32_t type, /* Allocate memory for event struct that contains array of efd structs for all cores */ struct event *e = - calloc(sizeof(struct event) + sizeof(struct efd) * el->num_cpus, 1); + calloc(1, sizeof(struct event) + sizeof(struct efd) * el->num_cpus); if (e == NULL) { ERROR(PMU_PLUGIN ": Failed to allocate event structure"); return -ENOMEM; @@ -482,7 +482,7 @@ static int pmu_add_hw_events(struct eventlist *el, char **e, size_t count) { /* Allocate memory for event struct that contains array of efd structs for all cores */ struct event *e = - calloc(sizeof(struct event) + sizeof(struct efd) * el->num_cpus, 1); + calloc(1, sizeof(struct event) + sizeof(struct efd) * el->num_cpus); if (e == NULL) { free(events); return -ENOMEM; -- 2.11.0