ACPICA: Audit/update for ACPICA return macros and debug depth counter
authorBob Moore <robert.moore@intel.com>
Wed, 31 Oct 2012 02:26:01 +0000 (02:26 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Nov 2012 23:31:24 +0000 (00:31 +0100)
1) Ensure that all functions that use the various TRACE macros
   also use the appropriate ACPICA return macros.
2) Ensure that all normal return statements surround the return
   expression (value) with parens.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
18 files changed:
drivers/acpi/acpica/dswload2.c
drivers/acpi/acpica/dswstate.c
drivers/acpi/acpica/evxfgpe.c
drivers/acpi/acpica/exdebug.c
drivers/acpi/acpica/exmutex.c
drivers/acpi/acpica/exoparg6.c
drivers/acpi/acpica/hwpci.c
drivers/acpi/acpica/nsnames.c
drivers/acpi/acpica/nsxfeval.c
drivers/acpi/acpica/rslist.c
drivers/acpi/acpica/tbinstal.c
drivers/acpi/acpica/tbutils.c
drivers/acpi/acpica/tbxface.c
drivers/acpi/acpica/tbxfroot.c
drivers/acpi/acpica/utdebug.c
drivers/acpi/acpica/utmutex.c
drivers/acpi/acpica/uttrack.c
drivers/acpi/acpica/utxface.c

index 89c0114210c0f32e0a3f7edf3e3d1961aa4e4a5f..3798357483578d9569cc004d1e05ff5d3ff905a7 100644 (file)
@@ -254,7 +254,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                                    acpi_ut_get_type_name(node->type),
                                    acpi_ut_get_node_name(node)));
 
-                       return (AE_AML_OPERAND_TYPE);
+                       return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
                }
                break;
 
@@ -602,7 +602,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
                                                          region_space,
                                                          walk_state);
                                if (ACPI_FAILURE(status)) {
-                                       return (status);
+                                       return_ACPI_STATUS(status);
                                }
 
                                acpi_ex_exit_interpreter();
index 9bb7fa45e240bbf0877217135f1fb2536e63f7da..8e6267980aaff04fb3584f4dd4354e81caa9e9df 100644 (file)
@@ -708,13 +708,13 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
        ACPI_FUNCTION_TRACE_PTR(ds_delete_walk_state, walk_state);
 
        if (!walk_state) {
-               return;
+               return_VOID;
        }
 
        if (walk_state->descriptor_type != ACPI_DESC_TYPE_WALK) {
                ACPI_ERROR((AE_INFO, "%p is not a valid walk state",
                            walk_state));
-               return;
+               return_VOID;
        }
 
        /* There should not be any open scopes */
index d36f99739376961952d23ce89b0be717b54f34d8..3f30e753b652ebe4db8e40588479a1aa13b5b76a 100644 (file)
@@ -569,7 +569,7 @@ acpi_install_gpe_block(acpi_handle gpe_device,
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
        if (ACPI_FAILURE(status)) {
-               return (status);
+               return_ACPI_STATUS(status);
        }
 
        node = acpi_ns_validate_handle(gpe_device);
@@ -652,7 +652,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device)
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
        if (ACPI_FAILURE(status)) {
-               return (status);
+               return_ACPI_STATUS(status);
        }
 
        node = acpi_ns_validate_handle(gpe_device);
index bc5b9a6a131638ab8014228ea89ae95225955e3a..e0c905095ed1428cdd0afc8583d4eb1b937b72f8 100644 (file)
@@ -190,7 +190,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 
                        acpi_os_printf("Table Index 0x%X\n",
                                       source_desc->reference.value);
-                       return;
+                       return_VOID;
 
                default:
                        break;
index bcceda5be9e3ece853d9864d5280346000276975..9099783eb8572fc9a10d5758345baace9746528e 100644 (file)
@@ -305,7 +305,7 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
        ACPI_FUNCTION_TRACE(ex_release_mutex_object);
 
        if (obj_desc->mutex.acquisition_depth == 0) {
-               return (AE_NOT_ACQUIRED);
+               return_ACPI_STATUS(AE_NOT_ACQUIRED);
        }
 
        /* Match multiple Acquires with multiple Releases */
index 0786b86590610e5d64d8a7b8d75344733cbaac2d..ab68dc532c7f5252264516f126240c2fa7e4fddc 100644 (file)
@@ -198,7 +198,7 @@ acpi_ex_do_match(u32 match_op,
                return (FALSE);
        }
 
-       return logical_result;
+       return (logical_result);
 }
 
 /*******************************************************************************
index 1455ddcdc32ceebcfcdf309c8c1d6627d7d47559..65bc3453a29c20c8c862a8a40983ead331d86291 100644 (file)
@@ -259,7 +259,7 @@ acpi_hw_process_pci_list(struct acpi_pci_id *pci_id,
                status = acpi_hw_get_pci_device_info(pci_id, info->device,
                                                     &bus_number, &is_bridge);
                if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
+                       return (status);
                }
 
                info = info->next;
@@ -271,7 +271,7 @@ acpi_hw_process_pci_list(struct acpi_pci_id *pci_id,
                          pci_id->segment, pci_id->bus, pci_id->device,
                          pci_id->function, status, bus_number, is_bridge));
 
-       return_ACPI_STATUS(AE_OK);
+       return (AE_OK);
 }
 
 /*******************************************************************************
index 96e0eb609bb465cc9f1b87f6404e8a44fcb1ec0d..55a175eadcc31b1a7f132f4c1923c3a01aa253b5 100644 (file)
@@ -195,7 +195,7 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
                        ACPI_ERROR((AE_INFO,
                                    "Invalid Namespace Node (%p) while traversing namespace",
                                    next_node));
-                       return 0;
+                       return (0);
                }
                size += ACPI_PATH_SEGMENT_LENGTH;
                next_node = next_node->parent;
index 494f2ebd623a59147577bab1a286b49022c88441..ee4d873f9f0aee6f8e8437261695c4e13343b9cc 100644 (file)
@@ -550,7 +550,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
        if (ACPI_FAILURE(status)) {
-               return (status);
+               return_ACPI_STATUS(status);
        }
 
        node = acpi_ns_validate_handle(obj_handle);
index 46b5324b22d6236adb4e0ea6637b8e3be8dff501..8b64db9a3fd2cd6a8a465ba666c710c66b634d86 100644 (file)
@@ -109,7 +109,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
                ACPI_ERROR((AE_INFO,
                            "Invalid/unsupported resource descriptor: Type 0x%2.2X",
                            resource_index));
-               return (AE_AML_INVALID_RESOURCE_TYPE);
+               return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
        }
 
        /* Convert the AML byte stream resource to a local resource struct */
@@ -200,7 +200,7 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
                        ACPI_ERROR((AE_INFO,
                                    "Invalid/unsupported resource descriptor: Type 0x%2.2X",
                                    resource->type));
-                       return (AE_AML_INVALID_RESOURCE_TYPE);
+                       return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
                }
 
                status = acpi_rs_convert_resource_to_aml(resource,
index 70f9d787c82cd9e8af9ae6fbd19d4d5a7cee2ac0..f540ae462925eff4614da3caf47e213d4591d938 100644 (file)
@@ -526,6 +526,8 @@ void acpi_tb_terminate(void)
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ACPI Tables freed\n"));
        (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
+
+       return_VOID;
 }
 
 /*******************************************************************************
index b6cea30da63879a970944a54642f2f404b3c918a..285e24b973822812d069721aeb44acc9908229f0 100644 (file)
@@ -354,7 +354,7 @@ u8 acpi_tb_checksum(u8 *buffer, u32 length)
                sum = (u8) (sum + *(buffer++));
        }
 
-       return sum;
+       return (sum);
 }
 
 /*******************************************************************************
index 21101262e47a1a4fd33f7cdf1b4973647571e435..f5632780421d2ab7bd30c14c6948e8d9b893d303 100644 (file)
@@ -236,7 +236,7 @@ acpi_get_table_header(char *signature,
                                                       sizeof(struct
                                                              acpi_table_header));
                                if (!header) {
-                                       return AE_NO_MEMORY;
+                                       return (AE_NO_MEMORY);
                                }
                                ACPI_MEMCPY(out_table_header, header,
                                            sizeof(struct acpi_table_header));
@@ -244,7 +244,7 @@ acpi_get_table_header(char *signature,
                                                     sizeof(struct
                                                            acpi_table_header));
                        } else {
-                               return AE_NOT_FOUND;
+                               return (AE_NOT_FOUND);
                        }
                } else {
                        ACPI_MEMCPY(out_table_header,
index 74e720800037e2499cb734dcd344bd50c2496626..f8ee9b35b999008d1773dc3554595f13c3962f18 100644 (file)
@@ -67,7 +67,6 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp);
 
 static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
 {
-       ACPI_FUNCTION_ENTRY();
 
        /*
         * The signature and checksum must both be correct
index 6e3ae6a23f0b310d44ed2d702d0bb346caf94dcc..2c21799176498525c84b9f2a0d5dd24bb5b69d44 100644 (file)
@@ -300,6 +300,7 @@ acpi_ut_trace_ptr(u32 line_number,
                  const char *function_name,
                  const char *module_name, u32 component_id, void *pointer)
 {
+
        acpi_gbl_nesting_level++;
        acpi_ut_track_stack_ptr();
 
index 296baa676bc59cbf60320145e304e1f0ba705757..93a1191993357a12f9b3b57882d4a8960804eb80 100644 (file)
@@ -193,6 +193,8 @@ static void acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
 
        acpi_gbl_mutex_info[mutex_id].mutex = NULL;
        acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
+
+       return_VOID;
 }
 
 /*******************************************************************************
index 73ca27d40f9feaaee36367717789b07df81fb8cf..e79c49d44d086a3355ece2ccd75649e112b71760 100644 (file)
@@ -517,14 +517,14 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
        ACPI_FUNCTION_TRACE(ut_dump_allocations);
 
        if (acpi_gbl_disable_mem_tracking) {
-               return;
+               return_VOID;
        }
 
        /*
         * Walk the allocation list.
         */
        if (ACPI_FAILURE(acpi_ut_acquire_mutex(ACPI_MTX_MEMORY))) {
-               return;
+               return_VOID;
        }
 
        element = acpi_gbl_global_list->list_head;
index b09632b4f5b3faacabbe29c637334788cb85857a..0c98d42fb2fd69b52e92915bd07910b6125acb63 100644 (file)
@@ -238,7 +238,7 @@ acpi_install_initialization_handler(acpi_init_handler handler, u32 function)
        }
 
        acpi_gbl_init_handler = handler;
-       return AE_OK;
+       return (AE_OK);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_install_initialization_handler)
@@ -263,6 +263,7 @@ acpi_status acpi_purge_cached_objects(void)
        (void)acpi_os_purge_cache(acpi_gbl_operand_cache);
        (void)acpi_os_purge_cache(acpi_gbl_ps_node_cache);
        (void)acpi_os_purge_cache(acpi_gbl_ps_node_ext_cache);
+
        return_ACPI_STATUS(AE_OK);
 }