Skip to content

Commit 26da9a8

Browse files
andy-shevrafaeljw
authored andcommitted
ACPI: NFIT: 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: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 41bccc9 commit 26da9a8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/acpi/nfit/core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,9 +1737,8 @@ __weak void nfit_intel_shutdown_status(struct nfit_mem *nfit_mem)
17371737
if ((nfit_mem->dsm_mask & (1 << func)) == 0)
17381738
return;
17391739

1740-
out_obj = acpi_evaluate_dsm(handle, guid, revid, func, &in_obj);
1741-
if (!out_obj || out_obj->type != ACPI_TYPE_BUFFER
1742-
|| out_obj->buffer.length < sizeof(smart)) {
1740+
out_obj = acpi_evaluate_dsm_typed(handle, guid, revid, func, &in_obj, ACPI_TYPE_BUFFER);
1741+
if (!out_obj || out_obj->buffer.length < sizeof(smart)) {
17431742
dev_dbg(dev->parent, "%s: failed to retrieve initial health\n",
17441743
dev_name(dev));
17451744
ACPI_FREE(out_obj);

0 commit comments

Comments
 (0)