1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 01:20:14 +00:00

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: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
Ian Rogers 2025-11-13 10:05:08 -08:00 committed by Namhyung Kim
parent af9e8d12b1
commit f69d34e8f2
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;