aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utils.c')
-rw-r--r--drivers/acpi/utils.c61
1 files changed, 8 insertions, 53 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 811fec10462b..c9a49f4747e6 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -107,12 +107,12 @@ acpi_extract_package(union acpi_object *package,
107 case ACPI_TYPE_INTEGER: 107 case ACPI_TYPE_INTEGER:
108 switch (format_string[i]) { 108 switch (format_string[i]) {
109 case 'N': 109 case 'N':
110 size_required += sizeof(acpi_integer); 110 size_required += sizeof(u64);
111 tail_offset += sizeof(acpi_integer); 111 tail_offset += sizeof(u64);
112 break; 112 break;
113 case 'S': 113 case 'S':
114 size_required += 114 size_required +=
115 sizeof(char *) + sizeof(acpi_integer) + 115 sizeof(char *) + sizeof(u64) +
116 sizeof(char); 116 sizeof(char);
117 tail_offset += sizeof(char *); 117 tail_offset += sizeof(char *);
118 break; 118 break;
@@ -193,17 +193,17 @@ acpi_extract_package(union acpi_object *package,
193 case ACPI_TYPE_INTEGER: 193 case ACPI_TYPE_INTEGER:
194 switch (format_string[i]) { 194 switch (format_string[i]) {
195 case 'N': 195 case 'N':
196 *((acpi_integer *) head) = 196 *((u64 *) head) =
197 element->integer.value; 197 element->integer.value;
198 head += sizeof(acpi_integer); 198 head += sizeof(u64);
199 break; 199 break;
200 case 'S': 200 case 'S':
201 pointer = (u8 **) head; 201 pointer = (u8 **) head;
202 *pointer = tail; 202 *pointer = tail;
203 *((acpi_integer *) tail) = 203 *((u64 *) tail) =
204 element->integer.value; 204 element->integer.value;
205 head += sizeof(acpi_integer *); 205 head += sizeof(u64 *);
206 tail += sizeof(acpi_integer); 206 tail += sizeof(u64);
207 /* NULL terminate string */ 207 /* NULL terminate string */
208 *tail = (char)0; 208 *tail = (char)0;
209 tail += sizeof(char); 209 tail += sizeof(char);
@@ -289,51 +289,6 @@ acpi_evaluate_integer(acpi_handle handle,
289 289
290EXPORT_SYMBOL(acpi_evaluate_integer); 290EXPORT_SYMBOL(acpi_evaluate_integer);
291 291
292#if 0
293acpi_status
294acpi_evaluate_string(acpi_handle handle,
295 acpi_string pathname,
296 acpi_object_list * arguments, acpi_string * data)
297{
298 acpi_status status = AE_OK;
299 acpi_object *element = NULL;
300 acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
301
302
303 if (!data)
304 return AE_BAD_PARAMETER;
305
306 status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
307 if (ACPI_FAILURE(status)) {
308 acpi_util_eval_error(handle, pathname, status);
309 return status;
310 }
311
312 element = (acpi_object *) buffer.pointer;
313
314 if ((element->type != ACPI_TYPE_STRING)
315 || (element->type != ACPI_TYPE_BUFFER)
316 || !element->string.length) {
317 acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
318 return AE_BAD_DATA;
319 }
320
321 *data = kzalloc(element->string.length + 1, GFP_KERNEL);
322 if (!data) {
323 printk(KERN_ERR PREFIX "Memory allocation\n");
324 return -ENOMEM;
325 }
326
327 memcpy(*data, element->string.pointer, element->string.length);
328
329 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%s]\n", *data));
330
331 kfree(buffer.pointer);
332
333 return AE_OK;
334}
335#endif
336
337acpi_status 292acpi_status
338acpi_evaluate_reference(acpi_handle handle, 293acpi_evaluate_reference(acpi_handle handle,
339 acpi_string pathname, 294 acpi_string pathname,