ACPICA: Add const qualifier for appropriate string constants
Bob Moore [Tue, 10 Jun 2008 05:55:53 +0000 (13:55 +0800)]
Mostly MODULE_NAME and printf format strings.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

drivers/acpi/executer/exdump.c
drivers/acpi/namespace/nsutils.c
drivers/acpi/utilities/utalloc.c
drivers/acpi/utilities/utdebug.c
drivers/acpi/utilities/utmisc.c
drivers/acpi/utilities/utobject.c
include/acpi/acinterp.h
include/acpi/aclocal.h
include/acpi/acmacros.h
include/acpi/acnamesp.h
include/acpi/acutils.h

index 976016f..c94638d 100644 (file)
@@ -771,9 +771,10 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 void
 acpi_ex_dump_operands(union acpi_operand_object **operands,
                      acpi_interpreter_mode interpreter_mode,
-                     char *ident,
+                     const char *ident,
                      u32 num_levels,
-                     char *note, char *module_name, u32 line_number)
+                     const char *note,
+                     const char *module_name, u32 line_number)
 {
        u32 i;
 
index 5b5619c..b0817e1 100644 (file)
@@ -73,9 +73,9 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node *node_to_search);
  ******************************************************************************/
 
 void
-acpi_ns_report_error(char *module_name,
+acpi_ns_report_error(const char *module_name,
                     u32 line_number,
-                    char *internal_name, acpi_status lookup_status)
+                    const char *internal_name, acpi_status lookup_status)
 {
        acpi_status status;
        u32 bad_name;
@@ -130,11 +130,11 @@ acpi_ns_report_error(char *module_name,
  ******************************************************************************/
 
 void
-acpi_ns_report_method_error(char *module_name,
+acpi_ns_report_method_error(const char *module_name,
                            u32 line_number,
-                           char *message,
+                           const char *message,
                            struct acpi_namespace_node *prefix_node,
-                           char *path, acpi_status method_status)
+                           const char *path, acpi_status method_status)
 {
        acpi_status status;
        struct acpi_namespace_node *node = prefix_node;
@@ -167,7 +167,8 @@ acpi_ns_report_method_error(char *module_name,
  ******************************************************************************/
 
 void
-acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *message)
+acpi_ns_print_node_pathname(struct acpi_namespace_node *node,
+                           const char *message)
 {
        struct acpi_buffer buffer;
        acpi_status status;
@@ -296,7 +297,7 @@ u32 acpi_ns_local(acpi_object_type type)
 
 void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
 {
-       char *next_external_char;
+       const char *next_external_char;
        u32 i;
 
        ACPI_FUNCTION_ENTRY();
@@ -363,7 +364,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)
 {
        u32 num_segments = info->num_segments;
        char *internal_name = info->internal_name;
-       char *external_name = info->next_external_char;
+       const char *external_name = info->next_external_char;
        char *result = NULL;
        u32 i;
 
@@ -471,7 +472,8 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)
  *
  *******************************************************************************/
 
-acpi_status acpi_ns_internalize_name(char *external_name, char **converted_name)
+acpi_status
+acpi_ns_internalize_name(const char *external_name, char **converted_name)
 {
        char *internal_name;
        struct acpi_namestring_info info;
@@ -527,7 +529,7 @@ acpi_status acpi_ns_internalize_name(char *external_name, char **converted_name)
 
 acpi_status
 acpi_ns_externalize_name(u32 internal_name_length,
-                        char *internal_name,
+                        const char *internal_name,
                         u32 * converted_name_length, char **converted_name)
 {
        u32 names_index = 0;
@@ -821,7 +823,7 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
 
 acpi_status
 acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
-                char *pathname,
+                const char *pathname,
                 u32 flags, struct acpi_namespace_node **return_node)
 {
        union acpi_generic_state scope_info;
index ede0848..3dfb8a4 100644 (file)
@@ -309,7 +309,8 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
  *
  ******************************************************************************/
 
-void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
+void *acpi_ut_allocate(acpi_size size,
+                      u32 component, const char *module, u32 line)
 {
        void *allocation;
 
@@ -353,7 +354,7 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
  ******************************************************************************/
 
 void *acpi_ut_allocate_zeroed(acpi_size size,
-                             u32 component, char *module, u32 line)
+                             u32 component, const char *module, u32 line)
 {
        void *allocation;
 
index 3919fe5..fd66ecb 100644 (file)
@@ -157,7 +157,8 @@ void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_debug_print(u32 requested_debug_level,
                    u32 line_number,
                    const char *function_name,
-                   char *module_name, u32 component_id, char *format, ...)
+                   const char *module_name,
+                   u32 component_id, const char *format, ...)
 {
        acpi_thread_id thread_id;
        va_list args;
@@ -228,7 +229,8 @@ void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_debug_print_raw(u32 requested_debug_level,
                        u32 line_number,
                        const char *function_name,
-                       char *module_name, u32 component_id, char *format, ...)
+                       const char *module_name,
+                       u32 component_id, const char *format, ...)
 {
        va_list args;
 
@@ -261,7 +263,8 @@ ACPI_EXPORT_SYMBOL(acpi_ut_debug_print_raw)
  ******************************************************************************/
 void
 acpi_ut_trace(u32 line_number,
-             const char *function_name, char *module_name, u32 component_id)
+             const char *function_name,
+             const char *module_name, u32 component_id)
 {
 
        acpi_gbl_nesting_level++;
@@ -293,7 +296,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_trace)
 void
 acpi_ut_trace_ptr(u32 line_number,
                  const char *function_name,
-                 char *module_name, u32 component_id, void *pointer)
+                 const char *module_name, u32 component_id, void *pointer)
 {
        acpi_gbl_nesting_level++;
        acpi_ut_track_stack_ptr();
@@ -324,7 +327,7 @@ acpi_ut_trace_ptr(u32 line_number,
 void
 acpi_ut_trace_str(u32 line_number,
                  const char *function_name,
-                 char *module_name, u32 component_id, char *string)
+                 const char *module_name, u32 component_id, char *string)
 {
 
        acpi_gbl_nesting_level++;
@@ -356,7 +359,7 @@ acpi_ut_trace_str(u32 line_number,
 void
 acpi_ut_trace_u32(u32 line_number,
                  const char *function_name,
-                 char *module_name, u32 component_id, u32 integer)
+                 const char *module_name, u32 component_id, u32 integer)
 {
 
        acpi_gbl_nesting_level++;
@@ -386,7 +389,8 @@ acpi_ut_trace_u32(u32 line_number,
 
 void
 acpi_ut_exit(u32 line_number,
-            const char *function_name, char *module_name, u32 component_id)
+            const char *function_name,
+            const char *module_name, u32 component_id)
 {
 
        acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
@@ -417,7 +421,8 @@ ACPI_EXPORT_SYMBOL(acpi_ut_exit)
 void
 acpi_ut_status_exit(u32 line_number,
                    const char *function_name,
-                   char *module_name, u32 component_id, acpi_status status)
+                   const char *module_name,
+                   u32 component_id, acpi_status status)
 {
 
        if (ACPI_SUCCESS(status)) {
@@ -458,7 +463,8 @@ ACPI_EXPORT_SYMBOL(acpi_ut_status_exit)
 void
 acpi_ut_value_exit(u32 line_number,
                   const char *function_name,
-                  char *module_name, u32 component_id, acpi_integer value)
+                  const char *module_name,
+                  u32 component_id, acpi_integer value)
 {
 
        acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
@@ -490,7 +496,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_value_exit)
 void
 acpi_ut_ptr_exit(u32 line_number,
                 const char *function_name,
-                char *module_name, u32 component_id, u8 * ptr)
+                const char *module_name, u32 component_id, u8 *ptr)
 {
 
        acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
index 6175ca5..f34be67 100644 (file)
@@ -1020,7 +1020,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object,
  ******************************************************************************/
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_error(char *module_name, u32 line_number, char *format, ...)
+acpi_ut_error(const char *module_name, u32 line_number, const char *format, ...)
 {
        va_list args;
 
@@ -1033,8 +1033,8 @@ acpi_ut_error(char *module_name, u32 line_number, char *format, ...)
 }
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_exception(char *module_name,
-                 u32 line_number, acpi_status status, char *format, ...)
+acpi_ut_exception(const char *module_name,
+                 u32 line_number, acpi_status status, const char *format, ...)
 {
        va_list args;
 
@@ -1050,7 +1050,8 @@ acpi_ut_exception(char *module_name,
 EXPORT_SYMBOL(acpi_ut_exception);
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
+acpi_ut_warning(const char *module_name,
+               u32 line_number, const char *format, ...)
 {
        va_list args;
 
@@ -1063,7 +1064,7 @@ acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
 }
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_info(char *module_name, u32 line_number, char *format, ...)
+acpi_ut_info(const char *module_name, u32 line_number, const char *format, ...)
 {
        va_list args;
 
index ede6a80..e254844 100644 (file)
@@ -83,7 +83,8 @@ acpi_ut_get_element_length(u8 object_type,
  *
  ******************************************************************************/
 
-union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
+union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
+                                                             *module_name,
                                                              u32 line_number,
                                                              u32 component_id,
                                                              acpi_object_type
@@ -347,7 +348,7 @@ u8 acpi_ut_valid_internal_object(void *object)
  *
  ******************************************************************************/
 
-void *acpi_ut_allocate_object_desc_dbg(char *module_name,
+void *acpi_ut_allocate_object_desc_dbg(const char *module_name,
                                       u32 line_number, u32 component_id)
 {
        union acpi_operand_object *object;
index e249ce5..accd120 100644 (file)
@@ -367,9 +367,10 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth);
 void
 acpi_ex_dump_operands(union acpi_operand_object **operands,
                      acpi_interpreter_mode interpreter_mode,
-                     char *ident,
+                     const char *ident,
                      u32 num_levels,
-                     char *note, char *module_name, u32 line_number);
+                     const char *note,
+                     const char *module_name, u32 line_number);
 
 #ifdef ACPI_FUTURE_USAGE
 void
index 62d7468..b221c85 100644 (file)
@@ -282,8 +282,8 @@ struct acpi_predefined_names {
 /* Info structure used to convert external<->internal namestrings */
 
 struct acpi_namestring_info {
-       char *external_name;
-       char *next_external_char;
+       const char *external_name;
+       const char *next_external_char;
        char *internal_name;
        u32 length;
        u32 num_segments;
index d0494ea..77439df 100644 (file)
@@ -414,7 +414,7 @@ struct acpi_integer_overlay {
  * error messages. The __FILE__ macro is not very useful for this, because it
  * often includes the entire pathname to the module
  */
-#define ACPI_MODULE_NAME(name)         static char ACPI_UNUSED_VAR _acpi_module_name[] = name;
+#define ACPI_MODULE_NAME(name)         static const char ACPI_UNUSED_VAR _acpi_module_name[] = name;
 #else
 #define ACPI_MODULE_NAME(name)
 #endif
index d622c30..9ed70a0 100644 (file)
@@ -199,7 +199,7 @@ acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
 
 acpi_status
 acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
-                char *external_pathname,
+                const char *external_pathname,
                 u32 flags, struct acpi_namespace_node **out_node);
 
 acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node);
@@ -263,28 +263,30 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node);
 u32 acpi_ns_local(acpi_object_type type);
 
 void
-acpi_ns_report_error(char *module_name,
+acpi_ns_report_error(const char *module_name,
                     u32 line_number,
-                    char *internal_name, acpi_status lookup_status);
+                    const char *internal_name, acpi_status lookup_status);
 
 void
-acpi_ns_report_method_error(char *module_name,
+acpi_ns_report_method_error(const char *module_name,
                            u32 line_number,
-                           char *message,
+                           const char *message,
                            struct acpi_namespace_node *node,
-                           char *path, acpi_status lookup_status);
+                           const char *path, acpi_status lookup_status);
 
-void acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *msg);
+void
+acpi_ns_print_node_pathname(struct acpi_namespace_node *node, const char *msg);
 
 acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info);
 
 void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info);
 
-acpi_status acpi_ns_internalize_name(char *dotted_name, char **converted_name);
+acpi_status
+acpi_ns_internalize_name(const char *dotted_name, char **converted_name);
 
 acpi_status
 acpi_ns_externalize_name(u32 internal_name_length,
-                        char *internal_name,
+                        const char *internal_name,
                         u32 * converted_name_length, char **converted_name);
 
 struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle);
index 3f663a0..69f8888 100644 (file)
@@ -245,41 +245,45 @@ void acpi_ut_track_stack_ptr(void);
 
 void
 acpi_ut_trace(u32 line_number,
-             const char *function_name, char *module_name, u32 component_id);
+             const char *function_name,
+             const char *module_name, u32 component_id);
 
 void
 acpi_ut_trace_ptr(u32 line_number,
                  const char *function_name,
-                 char *module_name, u32 component_id, void *pointer);
+                 const char *module_name, u32 component_id, void *pointer);
 
 void
 acpi_ut_trace_u32(u32 line_number,
                  const char *function_name,
-                 char *module_name, u32 component_id, u32 integer);
+                 const char *module_name, u32 component_id, u32 integer);
 
 void
 acpi_ut_trace_str(u32 line_number,
                  const char *function_name,
-                 char *module_name, u32 component_id, char *string);
+                 const char *module_name, u32 component_id, char *string);
 
 void
 acpi_ut_exit(u32 line_number,
-            const char *function_name, char *module_name, u32 component_id);
+            const char *function_name,
+            const char *module_name, u32 component_id);
 
 void
 acpi_ut_status_exit(u32 line_number,
                    const char *function_name,
-                   char *module_name, u32 component_id, acpi_status status);
+                   const char *module_name,
+                   u32 component_id, acpi_status status);
 
 void
 acpi_ut_value_exit(u32 line_number,
                   const char *function_name,
-                  char *module_name, u32 component_id, acpi_integer value);
+                  const char *module_name,
+                  u32 component_id, acpi_integer value);
 
 void
 acpi_ut_ptr_exit(u32 line_number,
                 const char *function_name,
-                char *module_name, u32 component_id, u8 * ptr);
+                const char *module_name, u32 component_id, u8 *ptr);
 
 void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id);
 
@@ -297,33 +301,35 @@ void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_debug_print(u32 requested_debug_level,
                    u32 line_number,
                    const char *function_name,
-                   char *module_name,
-                   u32 component_id, char *format, ...) ACPI_PRINTF_LIKE(6);
+                   const char *module_name,
+                   u32 component_id,
+                   const char *format, ...) ACPI_PRINTF_LIKE(6);
 
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_debug_print_raw(u32 requested_debug_level,
                        u32 line_number,
                        const char *function_name,
-                       char *module_name,
+                       const char *module_name,
                        u32 component_id,
-                       char *format, ...) ACPI_PRINTF_LIKE(6);
+                       const char *format, ...) ACPI_PRINTF_LIKE(6);
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_error(char *module_name,
-             u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
+acpi_ut_error(const char *module_name,
+             u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_exception(char *module_name,
+acpi_ut_exception(const char *module_name,
                  u32 line_number,
-                 acpi_status status, char *format, ...) ACPI_PRINTF_LIKE(4);
+                 acpi_status status,
+                 const char *format, ...) ACPI_PRINTF_LIKE(4);
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_warning(char *module_name,
-               u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
+acpi_ut_warning(const char *module_name,
+               u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_info(char *module_name,
-            u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
+acpi_ut_info(const char *module_name,
+            u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
 
 /*
  * utdelete - Object deletion and reference counts
@@ -376,13 +382,14 @@ acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest);
 /*
  * utobject - internal object create/delete/cache routines
  */
-union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
+union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
+                                                             *module_name,
                                                              u32 line_number,
                                                              u32 component_id,
                                                              acpi_object_type
                                                              type);
 
-void *acpi_ut_allocate_object_desc_dbg(char *module_name,
+void *acpi_ut_allocate_object_desc_dbg(const char *module_name,
                                       u32 line_number, u32 component_id);
 
 #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t)
@@ -543,26 +550,29 @@ acpi_status
 acpi_ut_initialize_buffer(struct acpi_buffer *buffer,
                          acpi_size required_length);
 
-void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line);
+void *acpi_ut_allocate(acpi_size size,
+                      u32 component, const char *module, u32 line);
 
 void *acpi_ut_allocate_zeroed(acpi_size size,
-                             u32 component, char *module, u32 line);
+                             u32 component, const char *module, u32 line);
 
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 void *acpi_ut_allocate_and_track(acpi_size size,
-                                u32 component, char *module, u32 line);
+                                u32 component, const char *module, u32 line);
 
 void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
-                                       u32 component, char *module, u32 line);
+                                       u32 component,
+                                       const char *module, u32 line);
 
 void
-acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line);
+acpi_ut_free_and_track(void *address,
+                      u32 component, const char *module, u32 line);
 
 #ifdef ACPI_FUTURE_USAGE
 void acpi_ut_dump_allocation_info(void);
 #endif                         /* ACPI_FUTURE_USAGE */
 
-void acpi_ut_dump_allocations(u32 component, char *module);
+void acpi_ut_dump_allocations(u32 component, const char *module);
 
 acpi_status
 acpi_ut_create_list(char *list_name,