mirror of
https://github.com/torvalds/linux.git
synced 2026-01-12 00:42:35 +08: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user