mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
c669675b56
commit
f639cff55f
|
@ -77,9 +77,6 @@ int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp,
|
|||
struct acpi_buffer element = { 0, NULL };
|
||||
struct acpi_buffer trt_format = { sizeof("RRNNNNNN"), "RRNNNNNN" };
|
||||
|
||||
if (!acpi_has_method(handle, "_TRT"))
|
||||
return -ENODEV;
|
||||
|
||||
status = acpi_evaluate_object(handle, "_TRT", NULL, &buffer);
|
||||
if (ACPI_FAILURE(status))
|
||||
return -ENODEV;
|
||||
|
@ -158,9 +155,6 @@ int acpi_parse_art(acpi_handle handle, int *art_count, struct art **artp,
|
|||
struct acpi_buffer art_format = {
|
||||
sizeof("RRNNNNNNNNNNN"), "RRNNNNNNNNNNN" };
|
||||
|
||||
if (!acpi_has_method(handle, "_ART"))
|
||||
return -ENODEV;
|
||||
|
||||
status = acpi_evaluate_object(handle, "_ART", NULL, &buffer);
|
||||
if (ACPI_FAILURE(status))
|
||||
return -ENODEV;
|
||||
|
|
Loading…
Reference in New Issue