Skip to contentSkip to conversation

ACPI: Fix acpi_evaluate_object() return value check

PATCH Superseded Yijing Wang 3 participants 4 messages Jan 17, 2014 – Jan 18, 2014

Subsystems (6)
DRM drivers DRM misc Intel i915 ACPI +2 more subsystems

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ACPI: Fix acpi_evaluate_object() return value check

Fix acpi_evaluate_object() return value check,
shoud acpi_status not int.

---

v1->v2: Add CC to the related subsystem MAINTAINERS.

---
 drivers/gpu/drm/i915/intel_acpi.c              |   13 +++++++------
 drivers/gpu/drm/nouveau/core/subdev/mxm/base.c |    6 +++---
 drivers/gpu/drm/nouveau/nouveau_acpi.c         |   13 +++++++------
 drivers/pci/pci-label.c                        |    6 +++---
 4 files changed, 20 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_acpi.c +7 -6
index dfff090..7ea00e5 100644
@@ -35,7 +35,7 @@ static int intel_dsm(acpi_handle handle, int func)
 	union acpi_object params[4];
 	union acpi_object *obj;
 	u32 result;
-	int ret = 0;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;
@@ -50,8 +50,8 @@ static int intel_dsm(acpi_handle handle, int func)
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	ret = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (ret) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
 		return ret;
 	}
@@ -141,7 +141,8 @@ static void intel_dsm_platform_mux_info(void)
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *pkg;
-	int i, ret;
+	acpi_status status;
+	int i;
 
 	input.count = 4;
 	input.pointer = params;
@@ -156,9 +157,9 @@ static void intel_dsm_platform_mux_info(void)
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	ret = acpi_evaluate_object(intel_dsm_priv.dhandle, "_DSM", &input,
+	acpi_status = acpi_evaluate_object(intel_dsm_priv.dhandle, "_DSM", &input,
 				   &output);
-	if (ret) {
+	if (ACPI_FAILURE(status)) {
 		DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
 		goto out;
 	}
drivers/gpu/drm/nouveau/core/subdev/mxm/base.c +3 -3
index 1291204..3920943 100644
@@ -114,14 +114,14 @@ mxm_shadow_dsm(struct nouveau_mxm *mxm, u8 version)
 	struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
 	union acpi_object *obj;
 	acpi_handle handle;
-	int ret;
+	acpi_status status;
 
 	handle = ACPI_HANDLE(&device->pdev->dev);
 	if (!handle)
 		return false;
 
-	ret = acpi_evaluate_object(handle, "_DSM", &list, &retn);
-	if (ret) {
+	status = acpi_evaluate_object(handle, "_DSM", &list, &retn);
+	if (ACPI_FAILURE(status)) {
 		nv_debug(mxm, "DSM MXMS failed: %d\n", ret);
 		return false;
 	}
drivers/gpu/drm/nouveau/nouveau_acpi.c +7 -6
index ba0183f..6f810f2 100644
@@ -82,7 +82,8 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *obj;
-	int i, err;
+	acpi_status status;
+	int i;
 	char args_buff[4];
 
 	input.count = 4;
@@ -101,8 +102,8 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
 		args_buff[i] = (arg >> i * 8) & 0xFF;
 	params[3].buffer.pointer = args_buff;
 
-	err = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (err) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
 		return err;
 	}
@@ -134,7 +135,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *obj;
-	int err;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;
@@ -148,8 +149,8 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
 	params[3].type = ACPI_TYPE_INTEGER;
 	params[3].integer.value = arg;
 
-	err = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (err) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
 		return err;
 	}
drivers/pci/pci-label.c +3 -3
index d51f45a..3c21f1b 100644
@@ -213,7 +213,7 @@ dsm_get_label(acpi_handle handle, int func,
 	union acpi_object *obj;
 	int len = 0;
 
-	int err;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;
@@ -228,8 +228,8 @@ dsm_get_label(acpi_handle handle, int func,
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	err = acpi_evaluate_object(handle, "_DSM", &input, output);
-	if (err)
+	status = acpi_evaluate_object(handle, "_DSM", &input, output);
+	if (ACPI_FAILURE(status))
 		return -1;
 
 	obj = (union acpi_object *)output->pointer;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 20 lines · Yijing Wang

Fix acpi_evaluate_object() return value check,
shoud acpi_status not int.

---

v1->v2: Add CC to the related subsystem MAINTAINERS.

---
 drivers/gpu/drm/i915/intel_acpi.c              |   13 +++++++------
 drivers/gpu/drm/nouveau/core/subdev/mxm/base.c |    6 +++---
 drivers/gpu/drm/nouveau/nouveau_acpi.c         |   13 +++++++------
 drivers/pci/pci-label.c                        |    6 +++---
 4 files changed, 20 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_acpi.c +0 -0
index dfff090..7ea00e5 100644

drivers/gpu/drm/i915/intel_acpi.c static int intel_dsm(acpi_handle handle, int func) · line 38

Quoted 4 lines
drivers/gpu/drm/i915/intel_acpi.c +0 -1
@@ -35,7 +35,7 @@ static int intel_dsm(acpi_handle handle, int func)
 	union acpi_object params[4];
 	union acpi_object *obj;
 	u32 result;
-	int ret = 0;

The 'ret' is removed, but

Quoted 5 lines
drivers/gpu/drm/i915/intel_acpi.c +1 -0
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;

drivers/gpu/drm/i915/intel_acpi.c static int intel_dsm(acpi_handle handle, int func) · line 56

Quoted 9 lines
drivers/gpu/drm/i915/intel_acpi.c +2 -2
@@ -50,8 +50,8 @@ static int intel_dsm(acpi_handle handle, int func)
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	ret = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (ret) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
 		return ret;

you still use it here, so you should -EINVAL or something else here.

Quoted 60 lines
drivers/gpu/drm/i915/intel_acpi.c +4 -3
 	}
@@ -141,7 +141,8 @@ static void intel_dsm_platform_mux_info(void)
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *pkg;
-	int i, ret;
+	acpi_status status;
+	int i;
 
 	input.count = 4;
 	input.pointer = params;
@@ -156,9 +157,9 @@ static void intel_dsm_platform_mux_info(void)
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	ret = acpi_evaluate_object(intel_dsm_priv.dhandle, "_DSM", &input,
+	acpi_status = acpi_evaluate_object(intel_dsm_priv.dhandle, "_DSM", &input,
 				   &output);
-	if (ret) {
+	if (ACPI_FAILURE(status)) {
 		DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
 		goto out;
 	}
drivers/gpu/drm/nouveau/core/subdev/mxm/base.c +3 -3
index 1291204..3920943 100644
@@ -114,14 +114,14 @@ mxm_shadow_dsm(struct nouveau_mxm *mxm, u8 version)
 	struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
 	union acpi_object *obj;
 	acpi_handle handle;
-	int ret;
+	acpi_status status;
 
 	handle = ACPI_HANDLE(&device->pdev->dev);
 	if (!handle)
 		return false;
 
-	ret = acpi_evaluate_object(handle, "_DSM", &list, &retn);
-	if (ret) {
+	status = acpi_evaluate_object(handle, "_DSM", &list, &retn);
+	if (ACPI_FAILURE(status)) {
 		nv_debug(mxm, "DSM MXMS failed: %d\n", ret);
 		return false;
 	}
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -1
index ba0183f..6f810f2 100644
@@ -82,7 +82,8 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *obj;
-	int i, err;
+	acpi_status status;
+	int i;
 	char args_buff[4];
 
 	input.count = 4;

drivers/gpu/drm/nouveau/nouveau_acpi.c static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t * · line 108

Quoted 9 lines
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -2
@@ -101,8 +102,8 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
 		args_buff[i] = (arg >> i * 8) & 0xFF;
 	params[3].buffer.pointer = args_buff;
 
-	err = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (err) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
 		return err;

here too.

Quoted 11 lines
drivers/gpu/drm/nouveau/nouveau_acpi.c +1 -1
 	}
@@ -134,7 +135,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *obj;
-	int err;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;

drivers/gpu/drm/nouveau/nouveau_acpi.c static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result) · line 155

Quoted 9 lines
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -2
@@ -148,8 +149,8 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
 	params[3].type = ACPI_TYPE_INTEGER;
 	params[3].integer.value = arg;
 
-	err = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (err) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
 		return err;

and here.

Quoted 15 lines
drivers/gpu/drm/nouveau/nouveau_acpi.c +0 -0
 	}
drivers/pci/pci-label.c +1 -1
index d51f45a..3c21f1b 100644
@@ -213,7 +213,7 @@ dsm_get_label(acpi_handle handle, int func,
 	union acpi_object *obj;
 	int len = 0;
 
-	int err;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;

drivers/pci/pci-label.c dsm_get_label(acpi_handle handle, int func, · line 233

Quoted 8 lines
drivers/pci/pci-label.c +2 -2
@@ -228,8 +228,8 @@ dsm_get_label(acpi_handle handle, int func,
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	err = acpi_evaluate_object(handle, "_DSM", &input, output);
-	if (err)
+	status = acpi_evaluate_object(handle, "_DSM", &input, output);
+	if (ACPI_FAILURE(status))
 		return -1;

can we return specific error such as -EINVAL instead of hard code?

Thanks
Hanjun

#2 lore raw
Quoted 11 lines

drivers/gpu/drm/i915/intel_acpi.c static int intel_dsm(acpi_handle handle, int func) · line 38

Quoted 9 lines
drivers/gpu/drm/i915/intel_acpi.c +0 -1
index dfff090..7ea00e5 100644
@@ -35,7 +35,7 @@ static int intel_dsm(acpi_handle handle, int func)
 	union acpi_object params[4];
 	union acpi_object *obj;
 	u32 result;
-	int ret = 0;

The 'ret' is removed, but

Ah, it's my mistake, will updata it right now, thanks!

Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/i915/intel_acpi.c +1 -0
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;
@@ -50,8 +50,8 @@ static int intel_dsm(acpi_handle handle, int func)
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
Quoted 8 lines

drivers/gpu/drm/i915/intel_acpi.c static int intel_dsm(acpi_handle handle, int func) · line 56

Quoted 6 lines
drivers/gpu/drm/i915/intel_acpi.c +2 -2
-	ret = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (ret) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
 		return ret;

you still use it here, so you should -EINVAL or something else here.

OK

Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/i915/intel_acpi.c +1 -1
 	}
@@ -141,7 +141,8 @@ static void intel_dsm_platform_mux_info(void)
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *pkg;
-	int i, ret;
+	acpi_status status;
 
Quoted 8 lines

drivers/gpu/drm/i915/intel_acpi.c static void intel_dsm_platform_mux_info(void)

Quoted 6 lines
drivers/gpu/drm/i915/intel_acpi.c +2 -2
-	err = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (err) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
 		return err;

here too.

OK, thanks.

Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_acpi.c +1 -1
 	}
@@ -134,7 +135,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *obj;
-	int err;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;
@@ -148,8 +149,8 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
 	params[3].type = ACPI_TYPE_INTEGER;
 	params[3].integer.value = arg;
 
Quoted 8 lines

drivers/gpu/drm/i915/intel_acpi.c static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result) · line 155

Quoted 6 lines
drivers/gpu/drm/i915/intel_acpi.c +2 -2
-	err = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (err) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
 		return err;

and here.

thanks.

Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_acpi.c +0 -0
 	}
drivers/pci/pci-label.c +1 -1
index d51f45a..3c21f1b 100644
@@ -213,7 +213,7 @@ dsm_get_label(acpi_handle handle, int func,
 	union acpi_object *obj;
 	int len = 0;
 
-	int err;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;
@@ -228,8 +228,8 @@ dsm_get_label(acpi_handle handle, int func,
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
Quoted 7 lines

drivers/pci/pci-label.c dsm_get_label(acpi_handle handle, int func, · line 233

Quoted 5 lines
drivers/pci/pci-label.c +2 -2
-	err = acpi_evaluate_object(handle, "_DSM", &input, output);
-	if (err)
+	status = acpi_evaluate_object(handle, "_DSM", &input, output);
+	if (ACPI_FAILURE(status))
 		return -1;

can we return specific error such as -EINVAL instead of hard code?

I will try to add some more useful debug info here. thanks!

Quoted 6 lines

Thanks
Hanjun

.

Signature · 2 lines
Thanks!
Yijing
#3 lore raw
In reply to Yijing Wang
Quoted 2 lines · Yijing Wang

Fix acpi_evaluate_object() return value check,
shoud acpi_status not int.

Should be?
Your mailer also ate the word 'to' .

Quoted 159 lines

---

v1->v2: Add CC to the related subsystem MAINTAINERS.

---

drivers/gpu/drm/i915/intel_acpi.c              |   13 +++++++------
drivers/gpu/drm/nouveau/core/subdev/mxm/base.c |    6 +++---
drivers/gpu/drm/nouveau/nouveau_acpi.c         |   13 +++++++------
drivers/pci/pci-label.c                        |    6 +++---
4 files changed, 20 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_acpi.c +7 -6
index dfff090..7ea00e5 100644
@@ -35,7 +35,7 @@ static int intel_dsm(acpi_handle handle, int func)
 	union acpi_object params[4];
 	union acpi_object *obj;
 	u32 result;
-	int ret = 0;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;
@@ -50,8 +50,8 @@ static int intel_dsm(acpi_handle handle, int func)
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	ret = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (ret) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
 		return ret;
 	}
@@ -141,7 +141,8 @@ static void intel_dsm_platform_mux_info(void)
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *pkg;
-	int i, ret;
+	acpi_status status;
+	int i;
 
 	input.count = 4;
 	input.pointer = params;
@@ -156,9 +157,9 @@ static void intel_dsm_platform_mux_info(void)
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	ret = acpi_evaluate_object(intel_dsm_priv.dhandle, "_DSM", &input,
+	acpi_status = acpi_evaluate_object(intel_dsm_priv.dhandle, "_DSM",
 &input,
 				   &output);
-	if (ret) {
+	if (ACPI_FAILURE(status)) {
 		DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
 		goto out;
	}
drivers/gpu/drm/nouveau/core/subdev/mxm/base.c +3 -3
index 1291204..3920943 100644
@@ -114,14 +114,14 @@ mxm_shadow_dsm(struct nouveau_mxm *mxm, u8
 version)
 	struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
 	union acpi_object *obj;
 	acpi_handle handle;
-	int ret;
+	acpi_status status;
 
 	handle = ACPI_HANDLE(&device->pdev->dev);
 	if (!handle)
 		return false;
 
-	ret = acpi_evaluate_object(handle, "_DSM", &list, &retn);
-	if (ret) {
+	status = acpi_evaluate_object(handle, "_DSM", &list, &retn);
+	if (ACPI_FAILURE(status)) {
 		nv_debug(mxm, "DSM MXMS failed: %d\n", ret);
 		return false;
	}
drivers/gpu/drm/nouveau/nouveau_acpi.c +0 -0
index ba0183f..6f810f2 100644
@@ -82,7 +82,8 @@ static int nouveau_optimus_dsm(acpi_handle handle,

int func, int arg, uint32_t *

	struct acpi_object_list input;
	union acpi_object params[4];
	union acpi_object *obj;
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -1
-	int i, err;
+	acpi_status status;
+	int i;
	char args_buff[4];

	input.count = 4;
drivers/gpu/drm/nouveau/nouveau_acpi.c +0 -0
@@ -101,8 +102,8 @@ static int nouveau_optimus_dsm(acpi_handle handle,

int func, int arg, uint32_t *

		args_buff[i] = (arg >> i * 8) & 0xFF;
	params[3].buffer.pointer = args_buff;
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -2
-	err = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (err) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
		printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
		return err;
	}
drivers/gpu/drm/nouveau/nouveau_acpi.c +1 -1
@@ -134,7 +135,7 @@ static int nouveau_dsm(acpi_handle handle, int
 func, int arg, uint32_t *result)
 	struct acpi_object_list input;
 	union acpi_object params[4];
 	union acpi_object *obj;
-	int err;
+	acpi_status status;
 
 	input.count = 4;
	input.pointer = params;
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -2
@@ -148,8 +149,8 @@ static int nouveau_dsm(acpi_handle handle, int
 func, int arg, uint32_t *result)
 	params[3].type = ACPI_TYPE_INTEGER;
 	params[3].integer.value = arg;
 
-	err = acpi_evaluate_object(handle, "_DSM", &input, &output);
-	if (err) {
+	status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+	if (ACPI_FAILURE(status)) {
 		printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
 		return err;
	}
drivers/pci/pci-label.c +3 -3
index d51f45a..3c21f1b 100644
@@ -213,7 +213,7 @@ dsm_get_label(acpi_handle handle, int func,
 	union acpi_object *obj;
 	int len = 0;
 
-	int err;
+	acpi_status status;
 
 	input.count = 4;
 	input.pointer = params;
@@ -228,8 +228,8 @@ dsm_get_label(acpi_handle handle, int func,
 	params[3].package.count = 0;
 	params[3].package.elements = NULL;
 
-	err = acpi_evaluate_object(handle, "_DSM", &input, output);
-	if (err)
+	status = acpi_evaluate_object(handle, "_DSM", &input, output);
+	if (ACPI_FAILURE(status))
 		return -1;
 
 	obj = (union acpi_object *)output->pointer;