aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dswscope.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-05 00:44:28 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:45:14 -0400
commit4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch)
tree5b5b7d296ea58786f53b95e5eac9565ff66890b0 /drivers/acpi/dispatcher/dswscope.c
parentc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff)
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher/dswscope.c')
-rw-r--r--drivers/acpi/dispatcher/dswscope.c139
1 files changed, 61 insertions, 78 deletions
diff --git a/drivers/acpi/dispatcher/dswscope.c b/drivers/acpi/dispatcher/dswscope.c
index 21f4548ff323..defe956ef751 100644
--- a/drivers/acpi/dispatcher/dswscope.c
+++ b/drivers/acpi/dispatcher/dswscope.c
@@ -41,14 +41,11 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44
45#include <acpi/acpi.h> 44#include <acpi/acpi.h>
46#include <acpi/acdispat.h> 45#include <acpi/acdispat.h>
47 46
48
49#define _COMPONENT ACPI_DISPATCHER 47#define _COMPONENT ACPI_DISPATCHER
50 ACPI_MODULE_NAME ("dswscope") 48ACPI_MODULE_NAME("dswscope")
51
52 49
53/**************************************************************************** 50/****************************************************************************
54 * 51 *
@@ -62,15 +59,11 @@
62 * root scope object (which remains at the stack top.) 59 * root scope object (which remains at the stack top.)
63 * 60 *
64 ***************************************************************************/ 61 ***************************************************************************/
65 62void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state)
66void
67acpi_ds_scope_stack_clear (
68 struct acpi_walk_state *walk_state)
69{ 63{
70 union acpi_generic_state *scope_info; 64 union acpi_generic_state *scope_info;
71
72 ACPI_FUNCTION_NAME ("ds_scope_stack_clear");
73 65
66 ACPI_FUNCTION_NAME("ds_scope_stack_clear");
74 67
75 while (walk_state->scope_info) { 68 while (walk_state->scope_info) {
76 /* Pop a scope off the stack */ 69 /* Pop a scope off the stack */
@@ -78,14 +71,14 @@ acpi_ds_scope_stack_clear (
78 scope_info = walk_state->scope_info; 71 scope_info = walk_state->scope_info;
79 walk_state->scope_info = scope_info->scope.next; 72 walk_state->scope_info = scope_info->scope.next;
80 73
81 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 74 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
82 "Popped object type (%s)\n", 75 "Popped object type (%s)\n",
83 acpi_ut_get_type_name (scope_info->common.value))); 76 acpi_ut_get_type_name(scope_info->common.
84 acpi_ut_delete_generic_state (scope_info); 77 value)));
78 acpi_ut_delete_generic_state(scope_info);
85 } 79 }
86} 80}
87 81
88
89/**************************************************************************** 82/****************************************************************************
90 * 83 *
91 * FUNCTION: acpi_ds_scope_stack_push 84 * FUNCTION: acpi_ds_scope_stack_push
@@ -102,74 +95,70 @@ acpi_ds_scope_stack_clear (
102 ***************************************************************************/ 95 ***************************************************************************/
103 96
104acpi_status 97acpi_status
105acpi_ds_scope_stack_push ( 98acpi_ds_scope_stack_push(struct acpi_namespace_node *node,
106 struct acpi_namespace_node *node, 99 acpi_object_type type,
107 acpi_object_type type, 100 struct acpi_walk_state *walk_state)
108 struct acpi_walk_state *walk_state)
109{ 101{
110 union acpi_generic_state *scope_info; 102 union acpi_generic_state *scope_info;
111 union acpi_generic_state *old_scope_info; 103 union acpi_generic_state *old_scope_info;
112
113
114 ACPI_FUNCTION_TRACE ("ds_scope_stack_push");
115 104
105 ACPI_FUNCTION_TRACE("ds_scope_stack_push");
116 106
117 if (!node) { 107 if (!node) {
118 /* Invalid scope */ 108 /* Invalid scope */
119 109
120 ACPI_REPORT_ERROR (("ds_scope_stack_push: null scope passed\n")); 110 ACPI_REPORT_ERROR(("ds_scope_stack_push: null scope passed\n"));
121 return_ACPI_STATUS (AE_BAD_PARAMETER); 111 return_ACPI_STATUS(AE_BAD_PARAMETER);
122 } 112 }
123 113
124 /* Make sure object type is valid */ 114 /* Make sure object type is valid */
125 115
126 if (!acpi_ut_valid_object_type (type)) { 116 if (!acpi_ut_valid_object_type(type)) {
127 ACPI_REPORT_WARNING (( 117 ACPI_REPORT_WARNING(("ds_scope_stack_push: Invalid object type: 0x%X\n", type));
128 "ds_scope_stack_push: Invalid object type: 0x%X\n", type));
129 } 118 }
130 119
131 /* Allocate a new scope object */ 120 /* Allocate a new scope object */
132 121
133 scope_info = acpi_ut_create_generic_state (); 122 scope_info = acpi_ut_create_generic_state();
134 if (!scope_info) { 123 if (!scope_info) {
135 return_ACPI_STATUS (AE_NO_MEMORY); 124 return_ACPI_STATUS(AE_NO_MEMORY);
136 } 125 }
137 126
138 /* Init new scope object */ 127 /* Init new scope object */
139 128
140 scope_info->common.data_type = ACPI_DESC_TYPE_STATE_WSCOPE; 129 scope_info->common.data_type = ACPI_DESC_TYPE_STATE_WSCOPE;
141 scope_info->scope.node = node; 130 scope_info->scope.node = node;
142 scope_info->common.value = (u16) type; 131 scope_info->common.value = (u16) type;
143 132
144 walk_state->scope_depth++; 133 walk_state->scope_depth++;
145 134
146 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 135 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
147 "[%.2d] Pushed scope ", (u32) walk_state->scope_depth)); 136 "[%.2d] Pushed scope ",
137 (u32) walk_state->scope_depth));
148 138
149 old_scope_info = walk_state->scope_info; 139 old_scope_info = walk_state->scope_info;
150 if (old_scope_info) { 140 if (old_scope_info) {
151 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 141 ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC,
152 "[%4.4s] (%s)", 142 "[%4.4s] (%s)",
153 acpi_ut_get_node_name (old_scope_info->scope.node), 143 acpi_ut_get_node_name(old_scope_info->
154 acpi_ut_get_type_name (old_scope_info->common.value))); 144 scope.node),
155 } 145 acpi_ut_get_type_name(old_scope_info->
156 else { 146 common.value)));
157 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 147 } else {
158 "[\\___] (%s)", "ROOT")); 148 ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "[\\___] (%s)", "ROOT"));
159 } 149 }
160 150
161 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 151 ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC,
162 ", New scope -> [%4.4s] (%s)\n", 152 ", New scope -> [%4.4s] (%s)\n",
163 acpi_ut_get_node_name (scope_info->scope.node), 153 acpi_ut_get_node_name(scope_info->scope.node),
164 acpi_ut_get_type_name (scope_info->common.value))); 154 acpi_ut_get_type_name(scope_info->common.value)));
165 155
166 /* Push new scope object onto stack */ 156 /* Push new scope object onto stack */
167 157
168 acpi_ut_push_generic_state (&walk_state->scope_info, scope_info); 158 acpi_ut_push_generic_state(&walk_state->scope_info, scope_info);
169 return_ACPI_STATUS (AE_OK); 159 return_ACPI_STATUS(AE_OK);
170} 160}
171 161
172
173/**************************************************************************** 162/****************************************************************************
174 * 163 *
175 * FUNCTION: acpi_ds_scope_stack_pop 164 * FUNCTION: acpi_ds_scope_stack_pop
@@ -182,47 +171,41 @@ acpi_ds_scope_stack_push (
182 * 171 *
183 ***************************************************************************/ 172 ***************************************************************************/
184 173
185acpi_status 174acpi_status acpi_ds_scope_stack_pop(struct acpi_walk_state *walk_state)
186acpi_ds_scope_stack_pop (
187 struct acpi_walk_state *walk_state)
188{ 175{
189 union acpi_generic_state *scope_info; 176 union acpi_generic_state *scope_info;
190 union acpi_generic_state *new_scope_info; 177 union acpi_generic_state *new_scope_info;
191
192
193 ACPI_FUNCTION_TRACE ("ds_scope_stack_pop");
194 178
179 ACPI_FUNCTION_TRACE("ds_scope_stack_pop");
195 180
196 /* 181 /*
197 * Pop scope info object off the stack. 182 * Pop scope info object off the stack.
198 */ 183 */
199 scope_info = acpi_ut_pop_generic_state (&walk_state->scope_info); 184 scope_info = acpi_ut_pop_generic_state(&walk_state->scope_info);
200 if (!scope_info) { 185 if (!scope_info) {
201 return_ACPI_STATUS (AE_STACK_UNDERFLOW); 186 return_ACPI_STATUS(AE_STACK_UNDERFLOW);
202 } 187 }
203 188
204 walk_state->scope_depth--; 189 walk_state->scope_depth--;
205 190
206 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 191 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
207 "[%.2d] Popped scope [%4.4s] (%s), New scope -> ", 192 "[%.2d] Popped scope [%4.4s] (%s), New scope -> ",
208 (u32) walk_state->scope_depth, 193 (u32) walk_state->scope_depth,
209 acpi_ut_get_node_name (scope_info->scope.node), 194 acpi_ut_get_node_name(scope_info->scope.node),
210 acpi_ut_get_type_name (scope_info->common.value))); 195 acpi_ut_get_type_name(scope_info->common.value)));
211 196
212 new_scope_info = walk_state->scope_info; 197 new_scope_info = walk_state->scope_info;
213 if (new_scope_info) { 198 if (new_scope_info) {
214 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 199 ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC,
215 "[%4.4s] (%s)\n", 200 "[%4.4s] (%s)\n",
216 acpi_ut_get_node_name (new_scope_info->scope.node), 201 acpi_ut_get_node_name(new_scope_info->
217 acpi_ut_get_type_name (new_scope_info->common.value))); 202 scope.node),
218 } 203 acpi_ut_get_type_name(new_scope_info->
219 else { 204 common.value)));
220 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 205 } else {
221 "[\\___] (ROOT)\n")); 206 ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "[\\___] (ROOT)\n"));
222 } 207 }
223 208
224 acpi_ut_delete_generic_state (scope_info); 209 acpi_ut_delete_generic_state(scope_info);
225 return_ACPI_STATUS (AE_OK); 210 return_ACPI_STATUS(AE_OK);
226} 211}
227
228