ACPICA: Fix deconstification warnings (-Wcast-qual) with function traces.
authorJung-uk Kim <jkim@FreeBSD.org>
Thu, 4 Aug 2016 08:42:19 +0000 (16:42 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 13 Aug 2016 01:09:31 +0000 (03:09 +0200)
ACPICA commit f722da0372261331b74d3ac67645bba912a21643

Link: https://github.com/acpica/acpica/commit/f722da03
Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
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>
drivers/acpi/acpica/acutils.h
drivers/acpi/acpica/utdebug.c
drivers/acpi/acpica/utdecode.c
include/acpi/acoutput.h

index a7dbb2b882cf2ce35ca4c209485f1e382c12d194..0bb6325508b365aa2716506ff730077bd1235540 100644 (file)
@@ -317,6 +317,11 @@ acpi_ut_ptr_exit(u32 line_number,
                 const char *function_name,
                 const char *module_name, u32 component_id, u8 *ptr);
 
+void
+acpi_ut_str_exit(u32 line_number,
+                const char *function_name,
+                const char *module_name, u32 component_id, const char *string);
+
 void
 acpi_ut_debug_dump_buffer(u8 *buffer, u32 count, u32 display, u32 component_id);
 
index 5744222050052b9ad29f4bdbd0ec5864654ec007..84c08539117d1396698013af9c71061fb907dd5d 100644 (file)
@@ -560,6 +560,43 @@ acpi_ut_ptr_exit(u32 line_number,
        }
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ut_str_exit
+ *
+ * PARAMETERS:  line_number         - Caller's line number
+ *              function_name       - Caller's procedure name
+ *              module_name         - Caller's module name
+ *              component_id        - Caller's component ID
+ *              string              - String to display
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
+ *              set in debug_level. Prints exit value also.
+ *
+ ******************************************************************************/
+
+void
+acpi_ut_str_exit(u32 line_number,
+                const char *function_name,
+                const char *module_name, u32 component_id, const char *string)
+{
+
+       /* Check if enabled up-front for performance */
+
+       if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
+               acpi_debug_print(ACPI_LV_FUNCTIONS,
+                                line_number, function_name, module_name,
+                                component_id, "%s %s\n",
+                                acpi_gbl_function_exit_prefix, string);
+       }
+
+       if (acpi_gbl_nesting_level) {
+               acpi_gbl_nesting_level--;
+       }
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_trace_point
index efd7988e34cb6ace48e5a7447595b769587fdb90..15728ad8356b18363411b278874db837b3fcd0e0 100644 (file)
@@ -253,7 +253,7 @@ const char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc)
                return_PTR("Invalid object");
        }
 
-       return_PTR(acpi_ut_get_type_name(obj_desc->common.type));
+       return_STR(acpi_ut_get_type_name(obj_desc->common.type));
 }
 
 /*******************************************************************************
index 34f601e7b88d3a75f237a17664da6a253d7857c2..48eb4dd99bb133353b7c0f25baf13f3428876598 100644 (file)
        ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, u32, value)
 
 #define ACPI_FUNCTION_TRACE_STR(name, string) \
-       ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, char *, string)
+       ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, const char *, string)
 
 #define ACPI_FUNCTION_ENTRY() \
        acpi_ut_track_stack_ptr()
 #define return_PTR(pointer) \
        ACPI_TRACE_EXIT (acpi_ut_ptr_exit, void *, pointer)
 
+#define return_STR(string) \
+       ACPI_TRACE_EXIT (acpi_ut_str_exit, const char *, string)
+
 #define return_VALUE(value) \
        ACPI_TRACE_EXIT (acpi_ut_value_exit, u64, value)
 
 #define return_VOID                     return
 #define return_ACPI_STATUS(s)           return(s)
 #define return_PTR(s)                   return(s)
+#define return_STR(s)                   return(s)
 #define return_VALUE(s)                 return(s)
 #define return_UINT8(s)                 return(s)
 #define return_UINT32(s)                return(s)