mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
perf pmu: Simplify an asprintf error message
Use ifs rather than ?: to avoid a large compound statement. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20241002032016.333748-2-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
c7c1bb78f3
commit
c051220d38
|
|
@ -1466,13 +1466,12 @@ static int pmu_config_term(const struct perf_pmu *pmu,
|
|||
if (err) {
|
||||
char *err_str;
|
||||
|
||||
parse_events_error__handle(err, term->err_val,
|
||||
asprintf(&err_str,
|
||||
"value too big for format (%s), maximum is %llu",
|
||||
format->name, (unsigned long long)max_val) < 0
|
||||
? strdup("value too big for format")
|
||||
: err_str,
|
||||
NULL);
|
||||
if (asprintf(&err_str,
|
||||
"value too big for format (%s), maximum is %llu",
|
||||
format->name, (unsigned long long)max_val) < 0) {
|
||||
err_str = strdup("value too big for format");
|
||||
}
|
||||
parse_events_error__handle(err, term->err_val, err_str, /*help=*/NULL);
|
||||
return -EINVAL;
|
||||
}
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user