Skip to content

Commit 5539218

Browse files
andy-shevrafaeljw
authored andcommitted
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 <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 9fbdc05 commit 5539218

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/acpi/x86/s2idle.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,10 @@ static int validate_dsm(acpi_handle handle, const char *uuid, int rev, guid_t *d
417417
int ret = -EINVAL;
418418

419419
guid_parse(uuid, dsm_guid);
420-
obj = acpi_evaluate_dsm(handle, dsm_guid, rev, 0, NULL);
421420

422421
/* 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)) {
425424
acpi_handle_debug(handle,
426425
"_DSM UUID %s rev %d function 0 evaluation failed\n", uuid, rev);
427426
goto out;

0 commit comments

Comments
 (0)