diff options
author | Len Brown <len.brown@intel.com> | 2005-08-05 00:44:28 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-08-05 00:45:14 -0400 |
commit | 4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch) | |
tree | 5b5b7d296ea58786f53b95e5eac9565ff66890b0 /drivers/acpi/tables/tbutils.c | |
parent | c65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff) |
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/tables/tbutils.c')
-rw-r--r-- | drivers/acpi/tables/tbutils.c | 147 |
1 files changed, 60 insertions, 87 deletions
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c index 6fc1e36e6042..5bcafebb9ddf 100644 --- a/drivers/acpi/tables/tbutils.c +++ b/drivers/acpi/tables/tbutils.c | |||
@@ -41,24 +41,18 @@ | |||
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/actables.h> | 45 | #include <acpi/actables.h> |
47 | 46 | ||
48 | |||
49 | #define _COMPONENT ACPI_TABLES | 47 | #define _COMPONENT ACPI_TABLES |
50 | ACPI_MODULE_NAME ("tbutils") | 48 | ACPI_MODULE_NAME("tbutils") |
51 | 49 | ||
52 | /* Local prototypes */ | 50 | /* Local prototypes */ |
53 | |||
54 | #ifdef ACPI_OBSOLETE_FUNCTIONS | 51 | #ifdef ACPI_OBSOLETE_FUNCTIONS |
55 | acpi_status | 52 | acpi_status |
56 | acpi_tb_handle_to_object ( | 53 | acpi_tb_handle_to_object(u16 table_id, struct acpi_table_desc **table_desc); |
57 | u16 table_id, | ||
58 | struct acpi_table_desc **table_desc); | ||
59 | #endif | 54 | #endif |
60 | 55 | ||
61 | |||
62 | /******************************************************************************* | 56 | /******************************************************************************* |
63 | * | 57 | * |
64 | * FUNCTION: acpi_tb_is_table_installed | 58 | * FUNCTION: acpi_tb_is_table_installed |
@@ -73,15 +67,11 @@ acpi_tb_handle_to_object ( | |||
73 | * | 67 | * |
74 | ******************************************************************************/ | 68 | ******************************************************************************/ |
75 | 69 | ||
76 | acpi_status | 70 | acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc) |
77 | acpi_tb_is_table_installed ( | ||
78 | struct acpi_table_desc *new_table_desc) | ||
79 | { | 71 | { |
80 | struct acpi_table_desc *table_desc; | 72 | struct acpi_table_desc *table_desc; |
81 | |||
82 | |||
83 | ACPI_FUNCTION_TRACE ("tb_is_table_installed"); | ||
84 | 73 | ||
74 | ACPI_FUNCTION_TRACE("tb_is_table_installed"); | ||
85 | 75 | ||
86 | /* Get the list descriptor and first table descriptor */ | 76 | /* Get the list descriptor and first table descriptor */ |
87 | 77 | ||
@@ -93,22 +83,23 @@ acpi_tb_is_table_installed ( | |||
93 | /* Compare Revision and oem_table_id */ | 83 | /* Compare Revision and oem_table_id */ |
94 | 84 | ||
95 | if ((table_desc->loaded_into_namespace) && | 85 | if ((table_desc->loaded_into_namespace) && |
96 | (table_desc->pointer->revision == | 86 | (table_desc->pointer->revision == |
97 | new_table_desc->pointer->revision) && | 87 | new_table_desc->pointer->revision) && |
98 | (!ACPI_MEMCMP (table_desc->pointer->oem_table_id, | 88 | (!ACPI_MEMCMP(table_desc->pointer->oem_table_id, |
99 | new_table_desc->pointer->oem_table_id, 8))) { | 89 | new_table_desc->pointer->oem_table_id, 8))) { |
100 | /* This table is already installed */ | 90 | /* This table is already installed */ |
101 | 91 | ||
102 | ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, | 92 | ACPI_DEBUG_PRINT((ACPI_DB_TABLES, |
103 | "Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n", | 93 | "Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n", |
104 | new_table_desc->pointer->signature, | 94 | new_table_desc->pointer->signature, |
105 | new_table_desc->pointer->revision, | 95 | new_table_desc->pointer->revision, |
106 | new_table_desc->pointer->oem_table_id)); | 96 | new_table_desc->pointer-> |
97 | oem_table_id)); | ||
107 | 98 | ||
108 | new_table_desc->owner_id = table_desc->owner_id; | 99 | new_table_desc->owner_id = table_desc->owner_id; |
109 | new_table_desc->installed_desc = table_desc; | 100 | new_table_desc->installed_desc = table_desc; |
110 | 101 | ||
111 | return_ACPI_STATUS (AE_ALREADY_EXISTS); | 102 | return_ACPI_STATUS(AE_ALREADY_EXISTS); |
112 | } | 103 | } |
113 | 104 | ||
114 | /* Get next table on the list */ | 105 | /* Get next table on the list */ |
@@ -116,10 +107,9 @@ acpi_tb_is_table_installed ( | |||
116 | table_desc = table_desc->next; | 107 | table_desc = table_desc->next; |
117 | } | 108 | } |
118 | 109 | ||
119 | return_ACPI_STATUS (AE_OK); | 110 | return_ACPI_STATUS(AE_OK); |
120 | } | 111 | } |
121 | 112 | ||
122 | |||
123 | /******************************************************************************* | 113 | /******************************************************************************* |
124 | * | 114 | * |
125 | * FUNCTION: acpi_tb_validate_table_header | 115 | * FUNCTION: acpi_tb_validate_table_header |
@@ -141,57 +131,55 @@ acpi_tb_is_table_installed ( | |||
141 | ******************************************************************************/ | 131 | ******************************************************************************/ |
142 | 132 | ||
143 | acpi_status | 133 | acpi_status |
144 | acpi_tb_validate_table_header ( | 134 | acpi_tb_validate_table_header(struct acpi_table_header *table_header) |
145 | struct acpi_table_header *table_header) | ||
146 | { | 135 | { |
147 | acpi_name signature; | 136 | acpi_name signature; |
148 | |||
149 | |||
150 | ACPI_FUNCTION_NAME ("tb_validate_table_header"); | ||
151 | 137 | ||
138 | ACPI_FUNCTION_NAME("tb_validate_table_header"); | ||
152 | 139 | ||
153 | /* Verify that this is a valid address */ | 140 | /* Verify that this is a valid address */ |
154 | 141 | ||
155 | if (!acpi_os_readable (table_header, sizeof (struct acpi_table_header))) { | 142 | if (!acpi_os_readable(table_header, sizeof(struct acpi_table_header))) { |
156 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | 143 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
157 | "Cannot read table header at %p\n", table_header)); | 144 | "Cannot read table header at %p\n", |
145 | table_header)); | ||
158 | 146 | ||
159 | return (AE_BAD_ADDRESS); | 147 | return (AE_BAD_ADDRESS); |
160 | } | 148 | } |
161 | 149 | ||
162 | /* Ensure that the signature is 4 ASCII characters */ | 150 | /* Ensure that the signature is 4 ASCII characters */ |
163 | 151 | ||
164 | ACPI_MOVE_32_TO_32 (&signature, table_header->signature); | 152 | ACPI_MOVE_32_TO_32(&signature, table_header->signature); |
165 | if (!acpi_ut_valid_acpi_name (signature)) { | 153 | if (!acpi_ut_valid_acpi_name(signature)) { |
166 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | 154 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
167 | "Table signature at %p [%p] has invalid characters\n", | 155 | "Table signature at %p [%p] has invalid characters\n", |
168 | table_header, &signature)); | 156 | table_header, &signature)); |
169 | 157 | ||
170 | ACPI_REPORT_WARNING (("Invalid table signature found: [%4.4s]\n", | 158 | ACPI_REPORT_WARNING(("Invalid table signature found: [%4.4s]\n", |
171 | (char *) &signature)); | 159 | (char *)&signature)); |
172 | 160 | ||
173 | ACPI_DUMP_BUFFER (table_header, sizeof (struct acpi_table_header)); | 161 | ACPI_DUMP_BUFFER(table_header, |
162 | sizeof(struct acpi_table_header)); | ||
174 | return (AE_BAD_SIGNATURE); | 163 | return (AE_BAD_SIGNATURE); |
175 | } | 164 | } |
176 | 165 | ||
177 | /* Validate the table length */ | 166 | /* Validate the table length */ |
178 | 167 | ||
179 | if (table_header->length < sizeof (struct acpi_table_header)) { | 168 | if (table_header->length < sizeof(struct acpi_table_header)) { |
180 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | 169 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
181 | "Invalid length in table header %p name %4.4s\n", | 170 | "Invalid length in table header %p name %4.4s\n", |
182 | table_header, (char *) &signature)); | 171 | table_header, (char *)&signature)); |
183 | 172 | ||
184 | ACPI_REPORT_WARNING (("Invalid table header length (0x%X) found\n", | 173 | ACPI_REPORT_WARNING(("Invalid table header length (0x%X) found\n", (u32) table_header->length)); |
185 | (u32) table_header->length)); | ||
186 | 174 | ||
187 | ACPI_DUMP_BUFFER (table_header, sizeof (struct acpi_table_header)); | 175 | ACPI_DUMP_BUFFER(table_header, |
176 | sizeof(struct acpi_table_header)); | ||
188 | return (AE_BAD_HEADER); | 177 | return (AE_BAD_HEADER); |
189 | } | 178 | } |
190 | 179 | ||
191 | return (AE_OK); | 180 | return (AE_OK); |
192 | } | 181 | } |
193 | 182 | ||
194 | |||
195 | /******************************************************************************* | 183 | /******************************************************************************* |
196 | * | 184 | * |
197 | * FUNCTION: acpi_tb_verify_table_checksum | 185 | * FUNCTION: acpi_tb_verify_table_checksum |
@@ -206,34 +194,28 @@ acpi_tb_validate_table_header ( | |||
206 | ******************************************************************************/ | 194 | ******************************************************************************/ |
207 | 195 | ||
208 | acpi_status | 196 | acpi_status |
209 | acpi_tb_verify_table_checksum ( | 197 | acpi_tb_verify_table_checksum(struct acpi_table_header * table_header) |
210 | struct acpi_table_header *table_header) | ||
211 | { | 198 | { |
212 | u8 checksum; | 199 | u8 checksum; |
213 | acpi_status status = AE_OK; | 200 | acpi_status status = AE_OK; |
214 | |||
215 | |||
216 | ACPI_FUNCTION_TRACE ("tb_verify_table_checksum"); | ||
217 | 201 | ||
202 | ACPI_FUNCTION_TRACE("tb_verify_table_checksum"); | ||
218 | 203 | ||
219 | /* Compute the checksum on the table */ | 204 | /* Compute the checksum on the table */ |
220 | 205 | ||
221 | checksum = acpi_tb_generate_checksum (table_header, table_header->length); | 206 | checksum = |
207 | acpi_tb_generate_checksum(table_header, table_header->length); | ||
222 | 208 | ||
223 | /* Return the appropriate exception */ | 209 | /* Return the appropriate exception */ |
224 | 210 | ||
225 | if (checksum) { | 211 | if (checksum) { |
226 | ACPI_REPORT_WARNING (( | 212 | ACPI_REPORT_WARNING(("Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)\n", table_header->signature, (u32) table_header->checksum, (u32) checksum)); |
227 | "Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)\n", | ||
228 | table_header->signature, (u32) table_header->checksum, | ||
229 | (u32) checksum)); | ||
230 | 213 | ||
231 | status = AE_BAD_CHECKSUM; | 214 | status = AE_BAD_CHECKSUM; |
232 | } | 215 | } |
233 | return_ACPI_STATUS (status); | 216 | return_ACPI_STATUS(status); |
234 | } | 217 | } |
235 | 218 | ||
236 | |||
237 | /******************************************************************************* | 219 | /******************************************************************************* |
238 | * | 220 | * |
239 | * FUNCTION: acpi_tb_generate_checksum | 221 | * FUNCTION: acpi_tb_generate_checksum |
@@ -247,15 +229,11 @@ acpi_tb_verify_table_checksum ( | |||
247 | * | 229 | * |
248 | ******************************************************************************/ | 230 | ******************************************************************************/ |
249 | 231 | ||
250 | u8 | 232 | u8 acpi_tb_generate_checksum(void *buffer, u32 length) |
251 | acpi_tb_generate_checksum ( | ||
252 | void *buffer, | ||
253 | u32 length) | ||
254 | { | 233 | { |
255 | const u8 *limit; | 234 | const u8 *limit; |
256 | const u8 *rover; | 235 | const u8 *rover; |
257 | u8 sum = 0; | 236 | u8 sum = 0; |
258 | |||
259 | 237 | ||
260 | if (buffer && length) { | 238 | if (buffer && length) { |
261 | /* Buffer and Length are valid */ | 239 | /* Buffer and Length are valid */ |
@@ -269,7 +247,6 @@ acpi_tb_generate_checksum ( | |||
269 | return (sum); | 247 | return (sum); |
270 | } | 248 | } |
271 | 249 | ||
272 | |||
273 | #ifdef ACPI_OBSOLETE_FUNCTIONS | 250 | #ifdef ACPI_OBSOLETE_FUNCTIONS |
274 | /******************************************************************************* | 251 | /******************************************************************************* |
275 | * | 252 | * |
@@ -285,16 +262,13 @@ acpi_tb_generate_checksum ( | |||
285 | ******************************************************************************/ | 262 | ******************************************************************************/ |
286 | 263 | ||
287 | acpi_status | 264 | acpi_status |
288 | acpi_tb_handle_to_object ( | 265 | acpi_tb_handle_to_object(u16 table_id, |
289 | u16 table_id, | 266 | struct acpi_table_desc ** return_table_desc) |
290 | struct acpi_table_desc **return_table_desc) | ||
291 | { | 267 | { |
292 | u32 i; | 268 | u32 i; |
293 | struct acpi_table_desc *table_desc; | 269 | struct acpi_table_desc *table_desc; |
294 | |||
295 | |||
296 | ACPI_FUNCTION_NAME ("tb_handle_to_object"); | ||
297 | 270 | ||
271 | ACPI_FUNCTION_NAME("tb_handle_to_object"); | ||
298 | 272 | ||
299 | for (i = 0; i < ACPI_TABLE_MAX; i++) { | 273 | for (i = 0; i < ACPI_TABLE_MAX; i++) { |
300 | table_desc = acpi_gbl_table_lists[i].next; | 274 | table_desc = acpi_gbl_table_lists[i].next; |
@@ -308,9 +282,8 @@ acpi_tb_handle_to_object ( | |||
308 | } | 282 | } |
309 | } | 283 | } |
310 | 284 | ||
311 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "table_id=%X does not exist\n", table_id)); | 285 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "table_id=%X does not exist\n", |
286 | table_id)); | ||
312 | return (AE_BAD_PARAMETER); | 287 | return (AE_BAD_PARAMETER); |
313 | } | 288 | } |
314 | #endif | 289 | #endif |
315 | |||
316 | |||