aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utobject.c')
-rw-r--r--drivers/acpi/utilities/utobject.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 7ee2d1d98071..ba7d8ac702df 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -92,7 +92,7 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
92 union acpi_operand_object *object; 92 union acpi_operand_object *object;
93 union acpi_operand_object *second_object; 93 union acpi_operand_object *second_object;
94 94
95 ACPI_FUNCTION_TRACE_STR("ut_create_internal_object_dbg", 95 ACPI_FUNCTION_TRACE_STR(ut_create_internal_object_dbg,
96 acpi_ut_get_type_name(type)); 96 acpi_ut_get_type_name(type));
97 97
98 /* Allocate the raw object descriptor */ 98 /* Allocate the raw object descriptor */
@@ -161,7 +161,7 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size)
161 union acpi_operand_object *buffer_desc; 161 union acpi_operand_object *buffer_desc;
162 u8 *buffer = NULL; 162 u8 *buffer = NULL;
163 163
164 ACPI_FUNCTION_TRACE_U32("ut_create_buffer_object", buffer_size); 164 ACPI_FUNCTION_TRACE_U32(ut_create_buffer_object, buffer_size);
165 165
166 /* Create a new Buffer object */ 166 /* Create a new Buffer object */
167 167
@@ -173,9 +173,10 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size)
173 /* Create an actual buffer only if size > 0 */ 173 /* Create an actual buffer only if size > 0 */
174 174
175 if (buffer_size > 0) { 175 if (buffer_size > 0) {
176
176 /* Allocate the actual buffer */ 177 /* Allocate the actual buffer */
177 178
178 buffer = ACPI_MEM_CALLOCATE(buffer_size); 179 buffer = ACPI_ALLOCATE_ZEROED(buffer_size);
179 if (!buffer) { 180 if (!buffer) {
180 ACPI_ERROR((AE_INFO, "Could not allocate size %X", 181 ACPI_ERROR((AE_INFO, "Could not allocate size %X",
181 (u32) buffer_size)); 182 (u32) buffer_size));
@@ -214,7 +215,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
214 union acpi_operand_object *string_desc; 215 union acpi_operand_object *string_desc;
215 char *string; 216 char *string;
216 217
217 ACPI_FUNCTION_TRACE_U32("ut_create_string_object", string_size); 218 ACPI_FUNCTION_TRACE_U32(ut_create_string_object, string_size);
218 219
219 /* Create a new String object */ 220 /* Create a new String object */
220 221
@@ -227,7 +228,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
227 * Allocate the actual string buffer -- (Size + 1) for NULL terminator. 228 * Allocate the actual string buffer -- (Size + 1) for NULL terminator.
228 * NOTE: Zero-length strings are NULL terminated 229 * NOTE: Zero-length strings are NULL terminated
229 */ 230 */
230 string = ACPI_MEM_CALLOCATE(string_size + 1); 231 string = ACPI_ALLOCATE_ZEROED(string_size + 1);
231 if (!string) { 232 if (!string) {
232 ACPI_ERROR((AE_INFO, "Could not allocate size %X", 233 ACPI_ERROR((AE_INFO, "Could not allocate size %X",
233 (u32) string_size)); 234 (u32) string_size));
@@ -260,7 +261,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
260u8 acpi_ut_valid_internal_object(void *object) 261u8 acpi_ut_valid_internal_object(void *object)
261{ 262{
262 263
263 ACPI_FUNCTION_NAME("ut_valid_internal_object"); 264 ACPI_FUNCTION_NAME(ut_valid_internal_object);
264 265
265 /* Check for a null pointer */ 266 /* Check for a null pointer */
266 267
@@ -308,7 +309,7 @@ void *acpi_ut_allocate_object_desc_dbg(char *module_name,
308{ 309{
309 union acpi_operand_object *object; 310 union acpi_operand_object *object;
310 311
311 ACPI_FUNCTION_TRACE("ut_allocate_object_desc_dbg"); 312 ACPI_FUNCTION_TRACE(ut_allocate_object_desc_dbg);
312 313
313 object = acpi_os_acquire_object(acpi_gbl_operand_cache); 314 object = acpi_os_acquire_object(acpi_gbl_operand_cache);
314 if (!object) { 315 if (!object) {
@@ -319,6 +320,7 @@ void *acpi_ut_allocate_object_desc_dbg(char *module_name,
319 } 320 }
320 321
321 /* Mark the descriptor type */ 322 /* Mark the descriptor type */
323
322 memset(object, 0, sizeof(union acpi_operand_object)); 324 memset(object, 0, sizeof(union acpi_operand_object));
323 ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_OPERAND); 325 ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_OPERAND);
324 326
@@ -342,7 +344,7 @@ void *acpi_ut_allocate_object_desc_dbg(char *module_name,
342 344
343void acpi_ut_delete_object_desc(union acpi_operand_object *object) 345void acpi_ut_delete_object_desc(union acpi_operand_object *object)
344{ 346{
345 ACPI_FUNCTION_TRACE_PTR("ut_delete_object_desc", object); 347 ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object);
346 348
347 /* Object must be an union acpi_operand_object */ 349 /* Object must be an union acpi_operand_object */
348 350
@@ -381,7 +383,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
381 acpi_size length; 383 acpi_size length;
382 acpi_status status = AE_OK; 384 acpi_status status = AE_OK;
383 385
384 ACPI_FUNCTION_TRACE_PTR("ut_get_simple_object_size", internal_object); 386 ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object);
385 387
386 /* 388 /*
387 * Handle a null object (Could be a uninitialized package 389 * Handle a null object (Could be a uninitialized package
@@ -397,6 +399,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
397 length = sizeof(union acpi_object); 399 length = sizeof(union acpi_object);
398 400
399 if (ACPI_GET_DESCRIPTOR_TYPE(internal_object) == ACPI_DESC_TYPE_NAMED) { 401 if (ACPI_GET_DESCRIPTOR_TYPE(internal_object) == ACPI_DESC_TYPE_NAMED) {
402
400 /* Object is a named object (reference), just return the length */ 403 /* Object is a named object (reference), just return the length */
401 404
402 *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length); 405 *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length);
@@ -559,7 +562,7 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object,
559 acpi_status status; 562 acpi_status status;
560 struct acpi_pkg_info info; 563 struct acpi_pkg_info info;
561 564
562 ACPI_FUNCTION_TRACE_PTR("ut_get_package_object_size", internal_object); 565 ACPI_FUNCTION_TRACE_PTR(ut_get_package_object_size, internal_object);
563 566
564 info.length = 0; 567 info.length = 0;
565 info.object_space = 0; 568 info.object_space = 0;