Commit 10b6575b authored by Bob Moore's avatar Bob Moore Committed by Len Brown

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: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 41bdd8e9
...@@ -373,11 +373,12 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, ...@@ -373,11 +373,12 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
walk_state->thread->thread_id) walk_state->thread->thread_id)
&& (obj_desc != acpi_gbl_global_lock_mutex)) { && (obj_desc != acpi_gbl_global_lock_mutex)) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX", "Thread %p cannot release Mutex [%4.4s] acquired by thread %p",
(unsigned long)walk_state->thread->thread_id, ACPI_CAST_PTR(void, walk_state->thread->thread_id),
acpi_ut_get_node_name(obj_desc->mutex.node), acpi_ut_get_node_name(obj_desc->mutex.node),
(unsigned long)obj_desc->mutex.owner_thread-> ACPI_CAST_PTR(void,
thread_id)); obj_desc->mutex.owner_thread->
thread_id)));
return_ACPI_STATUS(AE_AML_NOT_OWNER); return_ACPI_STATUS(AE_AML_NOT_OWNER);
} }
......
...@@ -179,9 +179,9 @@ acpi_debug_print(u32 requested_debug_level, ...@@ -179,9 +179,9 @@ acpi_debug_print(u32 requested_debug_level,
if (thread_id != acpi_gbl_prev_thread_id) { if (thread_id != acpi_gbl_prev_thread_id) {
if (ACPI_LV_THREADS & acpi_dbg_level) { if (ACPI_LV_THREADS & acpi_dbg_level) {
acpi_os_printf acpi_os_printf
("\n**** Context Switch from TID %lX to TID %lX ****\n\n", ("\n**** Context Switch from TID %p to TID %p ****\n\n",
(unsigned long)acpi_gbl_prev_thread_id, ACPI_CAST_PTR(void, acpi_gbl_prev_thread_id),
(unsigned long)thread_id); ACPI_CAST_PTR(void, thread_id));
} }
acpi_gbl_prev_thread_id = thread_id; acpi_gbl_prev_thread_id = thread_id;
...@@ -194,7 +194,7 @@ acpi_debug_print(u32 requested_debug_level, ...@@ -194,7 +194,7 @@ acpi_debug_print(u32 requested_debug_level,
acpi_os_printf("%8s-%04ld ", module_name, line_number); acpi_os_printf("%8s-%04ld ", module_name, line_number);
if (ACPI_LV_THREADS & acpi_dbg_level) { if (ACPI_LV_THREADS & acpi_dbg_level) {
acpi_os_printf("[%04lX] ", (unsigned long)thread_id); acpi_os_printf("[%p] ", ACPI_CAST_PTR(void, thread_id));
} }
acpi_os_printf("[%02ld] %-22.22s: ", acpi_os_printf("[%02ld] %-22.22s: ",
......
...@@ -230,17 +230,18 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) ...@@ -230,17 +230,18 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
if (i == mutex_id) { if (i == mutex_id) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Mutex [%s] already acquired by this thread [%X]", "Mutex [%s] already acquired by this thread [%p]",
acpi_ut_get_mutex_name acpi_ut_get_mutex_name
(mutex_id), (mutex_id),
this_thread_id)); ACPI_CAST_PTR(void,
this_thread_id)));
return (AE_ALREADY_ACQUIRED); return (AE_ALREADY_ACQUIRED);
} }
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Invalid acquire order: Thread %X owns [%s], wants [%s]", "Invalid acquire order: Thread %p owns [%s], wants [%s]",
this_thread_id, ACPI_CAST_PTR(void, this_thread_id),
acpi_ut_get_mutex_name(i), acpi_ut_get_mutex_name(i),
acpi_ut_get_mutex_name(mutex_id))); acpi_ut_get_mutex_name(mutex_id)));
...@@ -251,24 +252,24 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) ...@@ -251,24 +252,24 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
#endif #endif
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
"Thread %lX attempting to acquire Mutex [%s]\n", "Thread %p attempting to acquire Mutex [%s]\n",
(unsigned long)this_thread_id, ACPI_CAST_PTR(void, this_thread_id),
acpi_ut_get_mutex_name(mutex_id))); acpi_ut_get_mutex_name(mutex_id)));
status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
ACPI_WAIT_FOREVER); ACPI_WAIT_FOREVER);
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
"Thread %lX acquired Mutex [%s]\n", "Thread %p acquired Mutex [%s]\n",
(unsigned long)this_thread_id, ACPI_CAST_PTR(void, this_thread_id),
acpi_ut_get_mutex_name(mutex_id))); acpi_ut_get_mutex_name(mutex_id)));
acpi_gbl_mutex_info[mutex_id].use_count++; acpi_gbl_mutex_info[mutex_id].use_count++;
acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id; acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id;
} else { } else {
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
"Thread %lX could not acquire Mutex [%X]", "Thread %p could not acquire Mutex [%X]",
(unsigned long)this_thread_id, mutex_id)); ACPI_CAST_PTR(void, this_thread_id), mutex_id));
} }
return (status); return (status);
...@@ -293,9 +294,8 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) ...@@ -293,9 +294,8 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
ACPI_FUNCTION_NAME(ut_release_mutex); ACPI_FUNCTION_NAME(ut_release_mutex);
this_thread_id = acpi_os_get_thread_id(); this_thread_id = acpi_os_get_thread_id();
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n",
"Thread %lX releasing Mutex [%s]\n", ACPI_CAST_PTR(void, this_thread_id),
(unsigned long)this_thread_id,
acpi_ut_get_mutex_name(mutex_id))); acpi_ut_get_mutex_name(mutex_id)));
if (mutex_id > ACPI_MAX_MUTEX) { if (mutex_id > ACPI_MAX_MUTEX) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment