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:
parent
af9e8d12b1
commit
f69d34e8f2
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user