aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/battery.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index f6215e809808..d5729d5dc190 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -293,13 +293,12 @@ static int extract_package(struct acpi_battery *battery,
293 strncpy(ptr, (u8 *)&element->integer.value, 293 strncpy(ptr, (u8 *)&element->integer.value,
294 sizeof(acpi_integer)); 294 sizeof(acpi_integer));
295 ptr[sizeof(acpi_integer)] = 0; 295 ptr[sizeof(acpi_integer)] = 0;
296 } else return -EFAULT; 296 } else
297 *ptr = 0; /* don't have value */
297 } else { 298 } else {
298 if (element->type == ACPI_TYPE_INTEGER) { 299 int *x = (int *)((u8 *)battery + offsets[i].offset);
299 int *x = (int *)((u8 *)battery + 300 *x = (element->type == ACPI_TYPE_INTEGER) ?
300 offsets[i].offset); 301 element->integer.value : -1;
301 *x = element->integer.value;
302 } else return -EFAULT;
303 } 302 }
304 } 303 }
305 return 0; 304 return 0;