Commit f69d34e8 authored by Ian Rogers's avatar Ian Rogers Committed by Namhyung Kim
Browse files

perf pmu: perf_cpu_map__new_int to avoid parsing a string



Prefer perf_cpu_map__new_int(0) to perf_cpu_map__new("0") as it avoids
strings parsing.

Signed-off-by: default avatarIan Rogers <irogers@google.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent af9e8d12
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ static struct drm_pmu *add_drm_pmu(struct list_head *pmus, char *line, size_t li
		return NULL;
	}

	drm->pmu.cpus = perf_cpu_map__new("0");
	drm->pmu.cpus = perf_cpu_map__new_int(0);
	if (!drm->pmu.cpus) {
		perf_pmu__delete(&drm->pmu);
		return NULL;
+1 −1
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ struct perf_pmu *hwmon_pmu__new(struct list_head *pmus, const char *hwmon_dir,
		perf_pmu__delete(&hwm->pmu);
		return NULL;
	}
	hwm->pmu.cpus = perf_cpu_map__new("0");
	hwm->pmu.cpus = perf_cpu_map__new_int(0);
	if (!hwm->pmu.cpus) {
		perf_pmu__delete(&hwm->pmu);
		return NULL;