* [PATCH] ACPI: Fix acpi_evaluate_object() return value check
@ 2014-01-16 12:06 Yijing Wang
2014-01-17 1:24 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Yijing Wang @ 2014-01-16 12:06 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-acpi, Yijing Wang, Hanjun Guo
Fix acpi_evaluate_object() return value check,
shoud acpi_status not int.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
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(-)
diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c
index dfff090..7ea00e5 100644
--- a/drivers/gpu/drm/i915/intel_acpi.c
+++ b/drivers/gpu/drm/i915/intel_acpi.c
@@ -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;
}
diff --git a/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c b/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
index 1291204..3920943 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
@@ -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;
}
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index ba0183f..6f810f2 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -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;
}
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
index d51f45a..3c21f1b 100644
--- a/drivers/pci/pci-label.c
+++ b/drivers/pci/pci-label.c
@@ -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;
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: Fix acpi_evaluate_object() return value check
2014-01-17 1:24 ` Rafael J. Wysocki
@ 2014-01-17 1:22 ` Yijing Wang
0 siblings, 0 replies; 3+ messages in thread
From: Yijing Wang @ 2014-01-17 1:22 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Rafael J. Wysocki, linux-acpi, Hanjun Guo
On 2014/1/17 9:24, Rafael J. Wysocki wrote:
> On Thursday, January 16, 2014 08:06:00 PM Yijing Wang wrote:
>> Fix acpi_evaluate_object() return value check,
>> shoud acpi_status not int.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>
> Care to CC the maintainers of the files you're modifying in this patch?
OK,thanks.
>
> Thanks!
>
>> ---
>> 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(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c
>> index dfff090..7ea00e5 100644
>> --- a/drivers/gpu/drm/i915/intel_acpi.c
>> +++ b/drivers/gpu/drm/i915/intel_acpi.c
>> @@ -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;
>> }
>> diff --git a/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c b/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
>> index 1291204..3920943 100644
>> --- a/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
>> +++ b/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
>> @@ -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;
>> }
>> diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
>> index ba0183f..6f810f2 100644
>> --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
>> +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
>> @@ -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;
>> }
>> diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
>> index d51f45a..3c21f1b 100644
>> --- a/drivers/pci/pci-label.c
>> +++ b/drivers/pci/pci-label.c
>> @@ -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;
>>
>
--
Thanks!
Yijing
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: Fix acpi_evaluate_object() return value check
2014-01-16 12:06 [PATCH] ACPI: Fix acpi_evaluate_object() return value check Yijing Wang
@ 2014-01-17 1:24 ` Rafael J. Wysocki
2014-01-17 1:22 ` Yijing Wang
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2014-01-17 1:24 UTC (permalink / raw)
To: Yijing Wang; +Cc: Rafael J. Wysocki, linux-acpi, Hanjun Guo
On Thursday, January 16, 2014 08:06:00 PM Yijing Wang wrote:
> Fix acpi_evaluate_object() return value check,
> shoud acpi_status not int.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Care to CC the maintainers of the files you're modifying in this patch?
Thanks!
> ---
> 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(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c
> index dfff090..7ea00e5 100644
> --- a/drivers/gpu/drm/i915/intel_acpi.c
> +++ b/drivers/gpu/drm/i915/intel_acpi.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c b/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
> index 1291204..3920943 100644
> --- a/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
> +++ b/drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
> index ba0183f..6f810f2 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
> @@ -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;
> }
> diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
> index d51f45a..3c21f1b 100644
> --- a/drivers/pci/pci-label.c
> +++ b/drivers/pci/pci-label.c
> @@ -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;
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-17 1:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16 12:06 [PATCH] ACPI: Fix acpi_evaluate_object() return value check Yijing Wang
2014-01-17 1:24 ` Rafael J. Wysocki
2014-01-17 1:22 ` Yijing Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).