mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] avoid compiler warnings
@ 2006-11-15 14:48 Jan Beulich
  2006-11-15 15:42 ` Mikael Pettersson
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2006-11-15 14:48 UTC (permalink / raw)
  To: linux-acpi; +Cc: linux-kernel

Pointers should not be casted to u32 as this results in compiler warnings
on 64-bit platforms.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- linux-2.6.19-rc5/drivers/acpi/executer/exmutex.c	2006-09-20 05:42:06.000000000 +0200
+++ 2.6.19-rc5-acpi-warnings/drivers/acpi/executer/exmutex.c	2006-11-06 09:10:16.000000000 +0100
@@ -266,10 +266,10 @@ acpi_ex_release_mutex(union acpi_operand
 	     walk_state->thread->thread_id)
 	    && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) {
 		ACPI_ERROR((AE_INFO,
-			    "Thread %X cannot release Mutex [%4.4s] acquired by thread %X",
-			    (u32) walk_state->thread->thread_id,
+			    "Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX",
+			    (unsigned long) walk_state->thread->thread_id,
 			    acpi_ut_get_node_name(obj_desc->mutex.node),
-			    (u32) obj_desc->mutex.owner_thread->thread_id));
+			    (unsigned long) obj_desc->mutex.owner_thread->thread_id));
 		return_ACPI_STATUS(AE_AML_NOT_OWNER);
 	}
 
--- linux-2.6.19-rc5/drivers/acpi/utilities/utmutex.c	2006-09-20 05:42:06.000000000 +0200
+++ 2.6.19-rc5-acpi-warnings/drivers/acpi/utilities/utmutex.c	2006-11-06 09:10:16.000000000 +0100
@@ -258,8 +258,8 @@ acpi_status acpi_ut_acquire_mutex(acpi_m
 		acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id;
 	} else {
 		ACPI_EXCEPTION((AE_INFO, status,
-				"Thread %X could not acquire Mutex [%X]",
-				(u32) this_thread_id, mutex_id));
+				"Thread %lX could not acquire Mutex [%X]",
+				(unsigned long) this_thread_id, mutex_id));
 	}
 
 	return (status);



^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [PATCH] avoid compiler warnings
@ 2006-11-16 12:38 Mikael Pettersson
  0 siblings, 0 replies; 4+ messages in thread
From: Mikael Pettersson @ 2006-11-16 12:38 UTC (permalink / raw)
  To: jbeulich, linux-acpi; +Cc: linux-kernel

On Wed, 15 Nov 2006 16:47:59 +0000, Jan Beulich wrote:
> >>Pointers should not be casted to u32 as this results in compiler warnings
> >>on 64-bit platforms.
> >
> >NAK. Use "%p" for formatting pointers. No casts needed.
> 
> Indeed, how did I not see this... While at this, I saw that there were a few
> more instances that needed fixing (they weren't actively generating warnings
> because of the build settings).

Tested on x86-64 and i386, and it did kill the warnings w/o noticeable regressions.

However, for some reason (config settings?) you didn't fix the two cast warnings
in utdebug.c; the appended patch fixes them too.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>

--- linux-2.6.19-rc5/drivers/acpi/utilities/utdebug.c.~1~	2006-09-20 19:28:46.000000000 +0200
+++ linux-2.6.19-rc5/drivers/acpi/utilities/utdebug.c	2006-11-15 21:22:27.000000000 +0100
@@ -180,8 +180,8 @@ acpi_ut_debug_print(u32 requested_debug_
 	if (thread_id != acpi_gbl_prev_thread_id) {
 		if (ACPI_LV_THREADS & acpi_dbg_level) {
 			acpi_os_printf
-			    ("\n**** Context Switch from TID %X to TID %X ****\n\n",
-			     (u32) acpi_gbl_prev_thread_id, (u32) thread_id);
+			    ("\n**** Context Switch from TID %p to TID %p ****\n\n",
+			     acpi_gbl_prev_thread_id, thread_id);
 		}
 
 		acpi_gbl_prev_thread_id = thread_id;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-16 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-15 14:48 [PATCH] avoid compiler warnings Jan Beulich
2006-11-15 15:42 ` Mikael Pettersson
2006-11-15 16:47   ` Jan Beulich
2006-11-16 12:38 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome