Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal: intel: int340x_thermal: Remove unnecessary acpi_has_method() uses

acpi_evaluate_object() will already return in error if the method does not
exist. Checking if the method is absent before the acpi_evaluate_object()
call is not needed. Remove acpi_has_method() calls to avoid additional
work.

Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>

authored by

Kelsey Skunberg and committed by
Zhang Rui
f639cff5 c669675b

-6
-6
drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c
··· 77 77 struct acpi_buffer element = { 0, NULL }; 78 78 struct acpi_buffer trt_format = { sizeof("RRNNNNNN"), "RRNNNNNN" }; 79 79 80 - if (!acpi_has_method(handle, "_TRT")) 81 - return -ENODEV; 82 - 83 80 status = acpi_evaluate_object(handle, "_TRT", NULL, &buffer); 84 81 if (ACPI_FAILURE(status)) 85 82 return -ENODEV; ··· 154 157 struct acpi_buffer element = { 0, NULL }; 155 158 struct acpi_buffer art_format = { 156 159 sizeof("RRNNNNNNNNNNN"), "RRNNNNNNNNNNN" }; 157 - 158 - if (!acpi_has_method(handle, "_ART")) 159 - return -ENODEV; 160 160 161 161 status = acpi_evaluate_object(handle, "_ART", NULL, &buffer); 162 162 if (ACPI_FAILURE(status))