diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-03-05 19:41:44 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-03-08 19:10:30 +0100 |
commit | 4c324548f09fec413b4ee589174dabacfe17d953 (patch) | |
tree | 43db312324b6fccc184402a163c06debbec484a9 /drivers/acpi/processor_throttling.c | |
parent | a030fee8db446aaf928c9c0960a21e319886ffdc (diff) | |
download | lwn-4c324548f09fec413b4ee589174dabacfe17d953.tar.gz lwn-4c324548f09fec413b4ee589174dabacfe17d953.zip |
ACPI: utils: Introduce acpi_evaluation_failure_warn()
Quite a few users of ACPI objects want to log a warning message if
the evaluation fails which is a repeating pattern, so introduce a
helper function for that purpose and convert some code where it is
open-coded to using it.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/processor_throttling.c')
-rw-r--r-- | drivers/acpi/processor_throttling.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index fb6834cb0882..e61b8f038364 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -281,9 +281,7 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) - acpi_handle_warn(pr->handle, - "_TPC evaluation failed: %s\n", - acpi_format_exception(status)); + acpi_evaluation_failure_warn(pr->handle, "_TPC", status); return -ENODEV; } @@ -416,9 +414,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer); if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) - acpi_handle_warn(pr->handle, - "_PTC evaluation failed: %s\n", - acpi_format_exception(status)); + acpi_evaluation_failure_warn(pr->handle, "_PTC", status); return -ENODEV; } @@ -503,9 +499,7 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer); if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) - acpi_handle_warn(pr->handle, - "_TSS evaluation failed: %s\n", - acpi_format_exception(status)); + acpi_evaluation_failure_warn(pr->handle, "_TSS", status); return -ENODEV; } @@ -586,9 +580,7 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer); if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) - acpi_handle_warn(pr->handle, - "_TSD evaluation failed: %s\n", - acpi_format_exception(status)); + acpi_evaluation_failure_warn(pr->handle, "_TSD", status); return -ENODEV; } |