ACPICA: Reduce severity of predefined repair messages, Warning to Info
authorBob Moore <robert.moore@intel.com>
Thu, 12 Nov 2009 01:18:45 +0000 (09:18 +0800)
committerLen Brown <len.brown@intel.com>
Wed, 25 Nov 2009 02:27:57 +0000 (21:27 -0500)
Since the object was successfully repaired, a Warning is too
severe.  Reduced to Info for now. We may eventually change these
messages to debug-only. ACPICA BZ 812.

http://www.acpica.org/bugzilla/show_bug.cgi?id=812

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>
drivers/acpi/acpica/acmacros.h
drivers/acpi/acpica/acutils.h
drivers/acpi/acpica/nsrepair.c
drivers/acpi/acpica/utmisc.c

index 3acd9c6760ea59977262d479f00b99798b1c45c5..7d9ba6e575540216fc4bac2cfc82c95f3aec267f 100644 (file)
 #define ACPI_ERROR_NAMESPACE(s, e)      acpi_ns_report_error (AE_INFO, s, e);
 #define ACPI_ERROR_METHOD(s, n, p, e)   acpi_ns_report_method_error (AE_INFO, s, n, p, e);
 #define ACPI_WARN_PREDEFINED(plist)     acpi_ut_predefined_warning plist
+#define ACPI_INFO_PREDEFINED(plist)     acpi_ut_predefined_info plist
 
 #else
 
 #define ACPI_ERROR_NAMESPACE(s, e)
 #define ACPI_ERROR_METHOD(s, n, p, e)
 #define ACPI_WARN_PREDEFINED(plist)
+#define ACPI_INFO_PREDEFINED(plist)
+
 #endif         /* ACPI_NO_ERROR_MESSAGES */
 
 /*
index 863a264b829e4234bed3ed9db92eaf4c8f6c2edc..f920d89b3b15f8175a0442b3fb9f68ca6ba894a0 100644 (file)
@@ -481,6 +481,11 @@ acpi_ut_predefined_warning(const char *module_name,
                           char *pathname,
                           u8 node_flags, const char *format, ...);
 
+void ACPI_INTERNAL_VAR_XFACE
+acpi_ut_predefined_info(const char *module_name,
+                       u32 line_number,
+                       char *pathname, u8 node_flags, const char *format, ...);
+
 /* Values for Base above (16=Hex, 10=Decimal) */
 
 #define ACPI_ANY_BASE        0
index f2f5269fed6dc8cc2f44c81de8833f2e22ff48da..d563f1a564a79ba4090e012158cda79c410b88a5 100644 (file)
@@ -185,14 +185,14 @@ acpi_ns_repair_object(struct acpi_predefined_data *data,
                        return_object->common.reference_count--;
                }
 
-               ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
+               ACPI_INFO_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
                                      "Converted %s to expected %s at index %u",
                                      acpi_ut_get_object_type_name
                                      (return_object),
                                      acpi_ut_get_object_type_name(new_object),
                                      package_index));
        } else {
-               ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
+               ACPI_INFO_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
                                      "Converted %s to expected %s",
                                      acpi_ut_get_object_type_name
                                      (return_object),
@@ -254,8 +254,8 @@ acpi_ns_repair_package_list(struct acpi_predefined_data *data,
        *obj_desc_ptr = pkg_obj_desc;
        data->flags |= ACPI_OBJECT_REPAIRED;
 
-       ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
-                             "Incorrectly formed Package, attempting repair"));
+       ACPI_INFO_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
+                             "Repaired Incorrectly formed Package"));
 
        return (AE_OK);
 }
index 61f6315fce9f44cb888c37866aa2743968254f8f..6c6a5137b72842f2c4883a732dd1ce9d5edd0b71 100644 (file)
@@ -1161,3 +1161,45 @@ acpi_ut_predefined_warning(const char *module_name,
        ACPI_COMMON_MSG_SUFFIX;
        va_end(args);
 }
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ut_predefined_info
+ *
+ * PARAMETERS:  module_name     - Caller's module name (for error output)
+ *              line_number     - Caller's line number (for error output)
+ *              Pathname        - Full pathname to the node
+ *              node_flags      - From Namespace node for the method/object
+ *              Format          - Printf format string + additional args
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Info messages for the predefined validation module. Messages
+ *              are only emitted the first time a problem with a particular
+ *              method/object is detected. This prevents a flood of
+ *              messages for methods that are repeatedly evaluated.
+ *
+ ******************************************************************************/
+
+void ACPI_INTERNAL_VAR_XFACE
+acpi_ut_predefined_info(const char *module_name,
+                       u32 line_number,
+                       char *pathname, u8 node_flags, const char *format, ...)
+{
+       va_list args;
+
+       /*
+        * Warning messages for this method/object will be disabled after the
+        * first time a validation fails or an object is successfully repaired.
+        */
+       if (node_flags & ANOBJ_EVALUATED) {
+               return;
+       }
+
+       acpi_os_printf("ACPI Info for %s: ", pathname);
+
+       va_start(args, format);
+       acpi_os_vprintf(format, args);
+       ACPI_COMMON_MSG_SUFFIX;
+       va_end(args);
+}