lkml.org 
[lkml]   [2006]   [Nov]   [26]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateMon, 27 Nov 2006 04:21:14 +0000
Subject[PATCH] paravirt reorder functions to avoid unspecified behaviour
FromAndy Whitcroft <>
paravirt: reorder functions to avoid unspecified behaviour

The paravirt ops introduce a 'weak' attribute onto memory_setup().
Code ordering leads to the following warnings on x86:

    arch/i386/kernel/setup.c:651: warning: weak declaration of
		`memory_setup' after first use results in unspecified behavior

Move memory_setup() to avoid this.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 8be04da..79df6e6 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -494,6 +494,12 @@ static void set_mca_bus(int x)
 static void set_mca_bus(int x) { }
 #endif
 
+/* Overridden in paravirt.c if CONFIG_PARAVIRT */
+char * __attribute__((weak)) memory_setup(void)
+{
+	return machine_specific_memory_setup();
+}
+
 /*
  * Determine if we were loaded by an EFI loader.  If so, then we have also been
  * passed the efi memmap, systab, etc., so we should use these data structures
@@ -646,12 +652,6 @@ void __init setup_arch(char **cmdline_p)
 	tsc_init();
 }
 
-/* Overridden in paravirt.c if CONFIG_PARAVIRT */
-char * __attribute__((weak)) memory_setup(void)
-{
-	return machine_specific_memory_setup();
-}
-
 static __init int add_pcspkr(void)
 {
 	struct platform_device *pd;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-11-27 04:25    [from the cache]
©2003-2008