Skip to content

Commit 4032cc3

Browse files
acpibobrafaeljw
authored andcommitted
ACPICA: Improve error messages for the namespace root node
Replace "\___" with actual descriptive text. Signed-off-by: Bob Moore <[email protected]> Signed-off-by: Erik Schmauss <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 9df758d commit 4032cc3

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

drivers/acpi/acpica/dbnames.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,15 @@ void acpi_db_dump_namespace(char *start_arg, char *depth_arg)
189189
}
190190

191191
acpi_db_set_output_destination(ACPI_DB_DUPLICATE_OUTPUT);
192-
acpi_os_printf("ACPI Namespace (from %4.4s (%p) subtree):\n",
193-
((struct acpi_namespace_node *)subtree_entry)->name.
194-
ascii, subtree_entry);
192+
193+
if (((struct acpi_namespace_node *)subtree_entry)->parent) {
194+
acpi_os_printf("ACPI Namespace (from %4.4s (%p) subtree):\n",
195+
((struct acpi_namespace_node *)subtree_entry)->
196+
name.ascii, subtree_entry);
197+
} else {
198+
acpi_os_printf("ACPI Namespace (from %s):\n",
199+
ACPI_NAMESPACE_ROOT);
200+
}
195201

196202
/* Display the subtree */
197203

drivers/acpi/acpica/dswscope.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ acpi_ds_scope_stack_push(struct acpi_namespace_node *node,
115115
acpi_ut_get_type_name(old_scope_info->
116116
common.value)));
117117
} else {
118-
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "[\\___] (%s)", "ROOT"));
118+
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, ACPI_NAMESPACE_ROOT));
119119
}
120120

121121
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC,
@@ -166,14 +166,14 @@ acpi_status acpi_ds_scope_stack_pop(struct acpi_walk_state *walk_state)
166166

167167
new_scope_info = walk_state->scope_info;
168168
if (new_scope_info) {
169-
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC,
170-
"[%4.4s] (%s)\n",
169+
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "[%4.4s] (%s)\n",
171170
acpi_ut_get_node_name(new_scope_info->
172171
scope.node),
173172
acpi_ut_get_type_name(new_scope_info->
174173
common.value)));
175174
} else {
176-
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "[\\___] (ROOT)\n"));
175+
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "%s\n",
176+
ACPI_NAMESPACE_ROOT));
177177
}
178178

179179
acpi_ut_delete_generic_state(scope_info);

drivers/acpi/acpica/utstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void acpi_ut_repair_name(char *name)
141141
* Special case for the root node. This can happen if we get an
142142
* error during the execution of module-level code.
143143
*/
144-
if (ACPI_COMPARE_NAME(name, "\\___")) {
144+
if (ACPI_COMPARE_NAME(name, ACPI_ROOT_PATHNAME)) {
145145
return;
146146
}
147147

include/acpi/acnames.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@
4949
/* Definitions of the predefined namespace names */
5050

5151
#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
52-
#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
53-
5452
#define ACPI_PREFIX_MIXED (u32) 0x69706341 /* "Acpi" */
5553
#define ACPI_PREFIX_LOWER (u32) 0x69706361 /* "acpi" */
5654

55+
/* Root name stuff */
56+
57+
#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
58+
#define ACPI_ROOT_PATHNAME "\\___"
59+
#define ACPI_NAMESPACE_ROOT "Namespace Root"
5760
#define ACPI_NS_ROOT_PATH "\\"
5861

5962
#endif /* __ACNAMES_H__ */

0 commit comments

Comments
 (0)