Skip to contentSkip to conversation

swsusp: fix compilation for other architectures

PATCH Pavel Machek 2 participants 3 messages May 27, 2002 – May 28, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi!

Currently, on machine where suspend is not yet supported, compilation fails even in case user did not actually requested suspend. This "fixes" it -- compilation only fails when suspend is needed and not supported. Please apply,
Pavel

include/asm-i386/suspend.h +0 -6
@@ -1,13 +1,8 @@
-#ifndef __ASM_I386_SUSPEND_H
-#define __ASM_I386_SUSPEND_H
-#endif
-
 /*
  * Copyright 2001-2002 Pavel Machek <[email protected]>
  * Based on code
  * Copyright 2001 Patrick Mochel <[email protected]>
  */
-#if defined(SUSPEND_C) || defined(ACPI_C)
 #include <asm/desc.h>
 #include <asm/i387.h>
 
@@ -225,7 +220,6 @@
 	do_fpu_end();
 }
 
-#endif
 #ifdef SUSPEND_C
 /* Local variables for do_magic */
 static int loop __nosavedata = 0;
include/linux/suspend.h +2 -0
@@ -1,7 +1,9 @@
 #ifndef _LINUX_SWSUSP_H
 #define _LINUX_SWSUSP_H
 
+#if defined(SUSPEND_C) || defined(ACPI_C)
 #include <asm/suspend.h>
+#endif
 #include <linux/swap.h>
 #include <linux/notifier.h>
 #include <linux/config.h>
Signature · 2 lines
(about SSSCA) "I don't say this lightly.  However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
#1 lore raw
Quoted 11 lines · Pavel Machek

Hi!

Currently, on machine where suspend is not yet supported, compilation fails even in case user did not actually requested suspend. This "fixes" it -- compilation only fails when suspend is needed and not supported. Please apply,
Pavel

include/asm-i386/suspend.h line 3

Quoted 3 lines
include/asm-i386/suspend.h +0 -3
@@ -1,13 +1,8 @@
-#ifndef __ASM_I386_SUSPEND_H
-#define __ASM_I386_SUSPEND_H
-#endif

You probably want to move the #endif to the end of the file instead of removing it; having #ifndef/#define/#endif-traps for all header-files is good practice.

/David Weinehall
_ _
// David Weinehall <[email protected]> /> Northern lights wander \\

//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\>  http://www.acc.umu.se/~tao/    </   Full colour fire           </
#2 lore raw
In reply to Pavel Machek

Hi!

Quoted 6 lines
Quoted 6 lines

Currently, on machine where suspend is not yet supported, compilation fails even in case user did not actually requested suspend. This "fixes" it -- compilation only fails when suspend is needed and not supported. Please apply,
Pavel

Quoted 10 lines

include/asm-i386/suspend.h line 3

Quoted 6 lines
include/asm-i386/suspend.h +0 -3
@@ -1,13 +1,8 @@
-#ifndef __ASM_I386_SUSPEND_H
-#define __ASM_I386_SUSPEND_H
-#endif

You probably want to move the #endif to the end of the file instead of removing it; having #ifndef/#define/#endif-traps for all header-files is good practice.

Actually, I do not want to. This header file is somehow special, and suspend.c needs special "private" part of it, too. I'll clean that up later.

Pavel

Signature · 2 lines
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.