diff options
Diffstat (limited to 'drivers/acpi/executer/exfield.c')
-rw-r--r-- | drivers/acpi/executer/exfield.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c index e259201ce9a0..9ea9c3a67ca9 100644 --- a/drivers/acpi/executer/exfield.c +++ b/drivers/acpi/executer/exfield.c | |||
@@ -73,7 +73,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, | |||
73 | void *buffer; | 73 | void *buffer; |
74 | u8 locked; | 74 | u8 locked; |
75 | 75 | ||
76 | ACPI_FUNCTION_TRACE_PTR("ex_read_data_from_field", obj_desc); | 76 | ACPI_FUNCTION_TRACE_PTR(ex_read_data_from_field, obj_desc); |
77 | 77 | ||
78 | /* Parameter validation */ | 78 | /* Parameter validation */ |
79 | 79 | ||
@@ -142,6 +142,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, | |||
142 | length = | 142 | length = |
143 | (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); | 143 | (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); |
144 | if (length > acpi_gbl_integer_byte_width) { | 144 | if (length > acpi_gbl_integer_byte_width) { |
145 | |||
145 | /* Field is too large for an Integer, create a Buffer instead */ | 146 | /* Field is too large for an Integer, create a Buffer instead */ |
146 | 147 | ||
147 | buffer_desc = acpi_ut_create_buffer_object(length); | 148 | buffer_desc = acpi_ut_create_buffer_object(length); |
@@ -163,11 +164,11 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, | |||
163 | } | 164 | } |
164 | 165 | ||
165 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 166 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
166 | "field_read [TO]: Obj %p, Type %X, Buf %p, byte_len %X\n", | 167 | "FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n", |
167 | obj_desc, ACPI_GET_OBJECT_TYPE(obj_desc), buffer, | 168 | obj_desc, ACPI_GET_OBJECT_TYPE(obj_desc), buffer, |
168 | (u32) length)); | 169 | (u32) length)); |
169 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 170 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
170 | "field_read [FROM]: bit_len %X, bit_off %X, byte_off %X\n", | 171 | "FieldRead [FROM]: BitLen %X, BitOff %X, ByteOff %X\n", |
171 | obj_desc->common_field.bit_length, | 172 | obj_desc->common_field.bit_length, |
172 | obj_desc->common_field.start_field_bit_offset, | 173 | obj_desc->common_field.start_field_bit_offset, |
173 | obj_desc->common_field.base_byte_offset)); | 174 | obj_desc->common_field.base_byte_offset)); |
@@ -219,7 +220,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
219 | u8 locked; | 220 | u8 locked; |
220 | union acpi_operand_object *buffer_desc; | 221 | union acpi_operand_object *buffer_desc; |
221 | 222 | ||
222 | ACPI_FUNCTION_TRACE_PTR("ex_write_data_to_field", obj_desc); | 223 | ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc); |
223 | 224 | ||
224 | /* Parameter validation */ | 225 | /* Parameter validation */ |
225 | 226 | ||
@@ -329,9 +330,10 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
329 | ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length); | 330 | ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length); |
330 | 331 | ||
331 | if (length < required_length) { | 332 | if (length < required_length) { |
333 | |||
332 | /* We need to create a new buffer */ | 334 | /* We need to create a new buffer */ |
333 | 335 | ||
334 | new_buffer = ACPI_MEM_CALLOCATE(required_length); | 336 | new_buffer = ACPI_ALLOCATE_ZEROED(required_length); |
335 | if (!new_buffer) { | 337 | if (!new_buffer) { |
336 | return_ACPI_STATUS(AE_NO_MEMORY); | 338 | return_ACPI_STATUS(AE_NO_MEMORY); |
337 | } | 339 | } |
@@ -347,14 +349,14 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
347 | } | 349 | } |
348 | 350 | ||
349 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 351 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
350 | "field_write [FROM]: Obj %p (%s:%X), Buf %p, byte_len %X\n", | 352 | "FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n", |
351 | source_desc, | 353 | source_desc, |
352 | acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE | 354 | acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE |
353 | (source_desc)), | 355 | (source_desc)), |
354 | ACPI_GET_OBJECT_TYPE(source_desc), buffer, length)); | 356 | ACPI_GET_OBJECT_TYPE(source_desc), buffer, length)); |
355 | 357 | ||
356 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 358 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
357 | "field_write [TO]: Obj %p (%s:%X), bit_len %X, bit_off %X, byte_off %X\n", | 359 | "FieldWrite [TO]: Obj %p (%s:%X), BitLen %X, BitOff %X, ByteOff %X\n", |
358 | obj_desc, | 360 | obj_desc, |
359 | acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE(obj_desc)), | 361 | acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE(obj_desc)), |
360 | ACPI_GET_OBJECT_TYPE(obj_desc), | 362 | ACPI_GET_OBJECT_TYPE(obj_desc), |
@@ -375,7 +377,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
375 | /* Free temporary buffer if we used one */ | 377 | /* Free temporary buffer if we used one */ |
376 | 378 | ||
377 | if (new_buffer) { | 379 | if (new_buffer) { |
378 | ACPI_MEM_FREE(new_buffer); | 380 | ACPI_FREE(new_buffer); |
379 | } | 381 | } |
380 | 382 | ||
381 | return_ACPI_STATUS(status); | 383 | return_ACPI_STATUS(status); |