[PATCH v4] ACPI: Fix acpi_evaluate_object() return value check
Bjorn Helgaas
bhelgaas at google.com
Wed Jan 22 13:37:45 PST 2014
On Mon, Jan 20, 2014 at 7:46 PM, Yijing Wang <wangyijing at huawei.com> wrote:
> Since acpi_evaluate_object() returns acpi_status and not plain int,
> ACPI_FAILURE() should be used for checking its return value.
>
> Reviewed-by: Jani Nikula <jani.nikula at intel.com>
> Signed-off-by: Yijing Wang <wangyijing at huawei.com>
> ---
> v3->v4: Fix spell error, add Jani Nikula reviewed-by.
> v2->v3: Fix compile error pointed out by Hanjun.
> v1->v2: Add CC to related subsystem MAINTAINERS
> ---
> drivers/gpu/drm/i915/intel_acpi.c | 24 ++++++++++++++----------
> drivers/gpu/drm/nouveau/core/subdev/mxm/base.c | 9 +++++----
> drivers/gpu/drm/nouveau/nouveau_acpi.c | 23 +++++++++++++----------
> drivers/pci/pci-label.c | 9 ++++++---
For the drivers/pci/pci-label.c part,
Acked-by: Bjorn Helgaas <bhelgaas at google.com>
> + status = acpi_evaluate_object(handle, "_DSM", &input, &output);
> + if (ACPI_FAILURE(status)) {
> + DRM_DEBUG_DRIVER("failed to evaluate _DSM: %s\n",
> + acpi_format_exception(status));
It's too bad there isn't an easy way to produce more informative error
messages, e.g., by including a namespace path or something. A message
like:
failed to evaluate _DSM: A requested entity is not found
is only useful if there's enough context to figure out what's going on.
Bjorn
More information about the dri-devel
mailing list