提交 6fd8050a 编写于 作者: S Sudeep Holla 提交者: Rafael J. Wysocki

ACPI / cpuidle: avoid assigning signed errno to acpi_status

It's incorrect to assign a signed value to an unsigned acpi_status
variable. This patch fixes it by using a signed integer to return
error values.
Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 bccac16e
...@@ -334,10 +334,10 @@ static int acpi_processor_get_power_info_default(struct acpi_processor *pr) ...@@ -334,10 +334,10 @@ static int acpi_processor_get_power_info_default(struct acpi_processor *pr)
static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
{ {
acpi_status status = 0; acpi_status status;
u64 count; u64 count;
int current_count; int current_count;
int i; int i, ret = 0;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *cst; union acpi_object *cst;
...@@ -358,7 +358,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) ...@@ -358,7 +358,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
/* There must be at least 2 elements */ /* There must be at least 2 elements */
if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) { if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) {
printk(KERN_ERR PREFIX "not enough elements in _CST\n"); printk(KERN_ERR PREFIX "not enough elements in _CST\n");
status = -EFAULT; ret = -EFAULT;
goto end; goto end;
} }
...@@ -367,7 +367,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) ...@@ -367,7 +367,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
/* Validate number of power states. */ /* Validate number of power states. */
if (count < 1 || count != cst->package.count - 1) { if (count < 1 || count != cst->package.count - 1) {
printk(KERN_ERR PREFIX "count given by _CST is not valid\n"); printk(KERN_ERR PREFIX "count given by _CST is not valid\n");
status = -EFAULT; ret = -EFAULT;
goto end; goto end;
} }
...@@ -489,12 +489,12 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) ...@@ -489,12 +489,12 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
/* Validate number of power states discovered */ /* Validate number of power states discovered */
if (current_count < 2) if (current_count < 2)
status = -EFAULT; ret = -EFAULT;
end: end:
kfree(buffer.pointer); kfree(buffer.pointer);
return status; return ret;
} }
static void acpi_processor_power_verify_c3(struct acpi_processor *pr, static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
...@@ -1111,7 +1111,7 @@ static int acpi_processor_registered; ...@@ -1111,7 +1111,7 @@ static int acpi_processor_registered;
int acpi_processor_power_init(struct acpi_processor *pr) int acpi_processor_power_init(struct acpi_processor *pr)
{ {
acpi_status status = 0; acpi_status status;
int retval; int retval;
struct cpuidle_device *dev; struct cpuidle_device *dev;
static int first_run; static int first_run;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册