diff options
author | Bob Moore <robert.moore@intel.com> | 2009-04-21 23:39:10 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-05-27 00:30:48 -0400 |
commit | 10b6575b5d84d21e2eab01df2284288e5fdf7887 (patch) | |
tree | d90bcd364e4cc81d3cc391dcce9eb7992063782d /drivers/acpi | |
parent | 41bdd8e9809665d6a13e49137661a8f2e5a7dc51 (diff) |
ACPICA: Fix possible warnings for ACPI_THREAD_ID on 64-bit build
Warnings can be generated for printf-like statements that output
the ACPI_THREAD_ID on 64-bit builds, since this type can expand
to 64-bits depending on how it is defined. Use the %p format
specifier to allow the output to automatically expand to 64 bits.
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/exmutex.c | 9 | ||||
-rw-r--r-- | drivers/acpi/acpica/utdebug.c | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/utmutex.c | 26 |
3 files changed, 22 insertions, 21 deletions
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c index d301c1f363ef..d7cb030a21f8 100644 --- a/drivers/acpi/acpica/exmutex.c +++ b/drivers/acpi/acpica/exmutex.c | |||
@@ -373,11 +373,12 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
373 | walk_state->thread->thread_id) | 373 | walk_state->thread->thread_id) |
374 | && (obj_desc != acpi_gbl_global_lock_mutex)) { | 374 | && (obj_desc != acpi_gbl_global_lock_mutex)) { |
375 | ACPI_ERROR((AE_INFO, | 375 | ACPI_ERROR((AE_INFO, |
376 | "Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX", | 376 | "Thread %p cannot release Mutex [%4.4s] acquired by thread %p", |
377 | (unsigned long)walk_state->thread->thread_id, | 377 | ACPI_CAST_PTR(void, walk_state->thread->thread_id), |
378 | acpi_ut_get_node_name(obj_desc->mutex.node), | 378 | acpi_ut_get_node_name(obj_desc->mutex.node), |
379 | (unsigned long)obj_desc->mutex.owner_thread-> | 379 | ACPI_CAST_PTR(void, |
380 | thread_id)); | 380 | obj_desc->mutex.owner_thread-> |
381 | thread_id))); | ||
381 | return_ACPI_STATUS(AE_AML_NOT_OWNER); | 382 | return_ACPI_STATUS(AE_AML_NOT_OWNER); |
382 | } | 383 | } |
383 | 384 | ||
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c index 38821f53042c..527d729f6815 100644 --- a/drivers/acpi/acpica/utdebug.c +++ b/drivers/acpi/acpica/utdebug.c | |||
@@ -179,9 +179,9 @@ acpi_debug_print(u32 requested_debug_level, | |||
179 | if (thread_id != acpi_gbl_prev_thread_id) { | 179 | if (thread_id != acpi_gbl_prev_thread_id) { |
180 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 180 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
181 | acpi_os_printf | 181 | acpi_os_printf |
182 | ("\n**** Context Switch from TID %lX to TID %lX ****\n\n", | 182 | ("\n**** Context Switch from TID %p to TID %p ****\n\n", |
183 | (unsigned long)acpi_gbl_prev_thread_id, | 183 | ACPI_CAST_PTR(void, acpi_gbl_prev_thread_id), |
184 | (unsigned long)thread_id); | 184 | ACPI_CAST_PTR(void, thread_id)); |
185 | } | 185 | } |
186 | 186 | ||
187 | acpi_gbl_prev_thread_id = thread_id; | 187 | acpi_gbl_prev_thread_id = thread_id; |
@@ -194,7 +194,7 @@ acpi_debug_print(u32 requested_debug_level, | |||
194 | acpi_os_printf("%8s-%04ld ", module_name, line_number); | 194 | acpi_os_printf("%8s-%04ld ", module_name, line_number); |
195 | 195 | ||
196 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 196 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
197 | acpi_os_printf("[%04lX] ", (unsigned long)thread_id); | 197 | acpi_os_printf("[%p] ", ACPI_CAST_PTR(void, thread_id)); |
198 | } | 198 | } |
199 | 199 | ||
200 | acpi_os_printf("[%02ld] %-22.22s: ", | 200 | acpi_os_printf("[%02ld] %-22.22s: ", |
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c index 26c93a748e64..80bb65154117 100644 --- a/drivers/acpi/acpica/utmutex.c +++ b/drivers/acpi/acpica/utmutex.c | |||
@@ -230,17 +230,18 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) | |||
230 | if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { | 230 | if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { |
231 | if (i == mutex_id) { | 231 | if (i == mutex_id) { |
232 | ACPI_ERROR((AE_INFO, | 232 | ACPI_ERROR((AE_INFO, |
233 | "Mutex [%s] already acquired by this thread [%X]", | 233 | "Mutex [%s] already acquired by this thread [%p]", |
234 | acpi_ut_get_mutex_name | 234 | acpi_ut_get_mutex_name |
235 | (mutex_id), | 235 | (mutex_id), |
236 | this_thread_id)); | 236 | ACPI_CAST_PTR(void, |
237 | this_thread_id))); | ||
237 | 238 | ||
238 | return (AE_ALREADY_ACQUIRED); | 239 | return (AE_ALREADY_ACQUIRED); |
239 | } | 240 | } |
240 | 241 | ||
241 | ACPI_ERROR((AE_INFO, | 242 | ACPI_ERROR((AE_INFO, |
242 | "Invalid acquire order: Thread %X owns [%s], wants [%s]", | 243 | "Invalid acquire order: Thread %p owns [%s], wants [%s]", |
243 | this_thread_id, | 244 | ACPI_CAST_PTR(void, this_thread_id), |
244 | acpi_ut_get_mutex_name(i), | 245 | acpi_ut_get_mutex_name(i), |
245 | acpi_ut_get_mutex_name(mutex_id))); | 246 | acpi_ut_get_mutex_name(mutex_id))); |
246 | 247 | ||
@@ -251,24 +252,24 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) | |||
251 | #endif | 252 | #endif |
252 | 253 | ||
253 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, | 254 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, |
254 | "Thread %lX attempting to acquire Mutex [%s]\n", | 255 | "Thread %p attempting to acquire Mutex [%s]\n", |
255 | (unsigned long)this_thread_id, | 256 | ACPI_CAST_PTR(void, this_thread_id), |
256 | acpi_ut_get_mutex_name(mutex_id))); | 257 | acpi_ut_get_mutex_name(mutex_id))); |
257 | 258 | ||
258 | status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, | 259 | status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, |
259 | ACPI_WAIT_FOREVER); | 260 | ACPI_WAIT_FOREVER); |
260 | if (ACPI_SUCCESS(status)) { | 261 | if (ACPI_SUCCESS(status)) { |
261 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, | 262 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, |
262 | "Thread %lX acquired Mutex [%s]\n", | 263 | "Thread %p acquired Mutex [%s]\n", |
263 | (unsigned long)this_thread_id, | 264 | ACPI_CAST_PTR(void, this_thread_id), |
264 | acpi_ut_get_mutex_name(mutex_id))); | 265 | acpi_ut_get_mutex_name(mutex_id))); |
265 | 266 | ||
266 | acpi_gbl_mutex_info[mutex_id].use_count++; | 267 | acpi_gbl_mutex_info[mutex_id].use_count++; |
267 | acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id; | 268 | acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id; |
268 | } else { | 269 | } else { |
269 | ACPI_EXCEPTION((AE_INFO, status, | 270 | ACPI_EXCEPTION((AE_INFO, status, |
270 | "Thread %lX could not acquire Mutex [%X]", | 271 | "Thread %p could not acquire Mutex [%X]", |
271 | (unsigned long)this_thread_id, mutex_id)); | 272 | ACPI_CAST_PTR(void, this_thread_id), mutex_id)); |
272 | } | 273 | } |
273 | 274 | ||
274 | return (status); | 275 | return (status); |
@@ -293,9 +294,8 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) | |||
293 | ACPI_FUNCTION_NAME(ut_release_mutex); | 294 | ACPI_FUNCTION_NAME(ut_release_mutex); |
294 | 295 | ||
295 | this_thread_id = acpi_os_get_thread_id(); | 296 | this_thread_id = acpi_os_get_thread_id(); |
296 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, | 297 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n", |
297 | "Thread %lX releasing Mutex [%s]\n", | 298 | ACPI_CAST_PTR(void, this_thread_id), |
298 | (unsigned long)this_thread_id, | ||
299 | acpi_ut_get_mutex_name(mutex_id))); | 299 | acpi_ut_get_mutex_name(mutex_id))); |
300 | 300 | ||
301 | if (mutex_id > ACPI_MAX_MUTEX) { | 301 | if (mutex_id > ACPI_MAX_MUTEX) { |