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

ACPI: x86: s2idle: Switch to use acpi_evaluate_dsm_typed()

The acpi_evaluate_dsm_typed() provides a way to check the type of the
object evaluated by _DSM call. Use it instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Andy Shevchenko and committed by
Rafael J. Wysocki
55392187 9fbdc050

+2 -3
+2 -3
drivers/acpi/x86/s2idle.c
··· 417 417 int ret = -EINVAL; 418 418 419 419 guid_parse(uuid, dsm_guid); 420 - obj = acpi_evaluate_dsm(handle, dsm_guid, rev, 0, NULL); 421 420 422 421 /* Check if the _DSM is present and as expected. */ 423 - if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length == 0 || 424 - obj->buffer.length > sizeof(u32)) { 422 + obj = acpi_evaluate_dsm_typed(handle, dsm_guid, rev, 0, NULL, ACPI_TYPE_BUFFER); 423 + if (!obj || obj->buffer.length == 0 || obj->buffer.length > sizeof(u32)) { 425 424 acpi_handle_debug(handle, 426 425 "_DSM UUID %s rev %d function 0 evaluation failed\n", uuid, rev); 427 426 goto out;