mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.4.20-pre1-ac1: apm.c non SMP compile error
@ 2002-08-07 13:04 Eyal Lebedinsky
  2002-08-07 15:15 ` Tomas Szepe
  0 siblings, 1 reply; 3+ messages in thread
From: Eyal Lebedinsky @ 2002-08-07 13:04 UTC (permalink / raw)
  To: list linux-kernel, Alan Cox

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

apm_save_cpus() is defined without parameters for non-SMP, breaks
compile.

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>

[-- Attachment #2: 2.4.20-pre1-ac1-apm.patch --]
[-- Type: text/plain, Size: 285 bytes --]

--- linux/arch/i386/kernel/apm.c.orig	Wed Aug  7 22:59:06 2002
+++ linux/arch/i386/kernel/apm.c	Wed Aug  7 22:56:55 2002
@@ -524,7 +524,7 @@
  *	No CPU lockdown needed on a uniprocessor
  */
  
-#define apm_save_cpus	0
+#define apm_save_cpus()	0
 #define apm_restore_cpus(x)
 
 #endif

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

* Re: 2.4.20-pre1-ac1: apm.c non SMP compile error
  2002-08-07 13:04 2.4.20-pre1-ac1: apm.c non SMP compile error Eyal Lebedinsky
@ 2002-08-07 15:15 ` Tomas Szepe
  2002-08-07 17:19   ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Szepe @ 2002-08-07 15:15 UTC (permalink / raw)
  To: Eyal Lebedinsky; +Cc: list linux-kernel, Alan Cox

> apm_save_cpus() is defined without parameters for non-SMP, breaks
> compile.
> 
> --
> Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>
> --- linux/arch/i386/kernel/apm.c.orig	Wed Aug  7 22:59:06 2002
> +++ linux/arch/i386/kernel/apm.c	Wed Aug  7 22:56:55 2002
> @@ -524,7 +524,7 @@
>   *	No CPU lockdown needed on a uniprocessor
>   */
>   
> -#define apm_save_cpus	0
> +#define apm_save_cpus()	0
>  #define apm_restore_cpus(x)
>  
>  #endif

or alternatively the following, which for the cost of a couple ifdefs
also removes the unused variable 'cpus' on UP:

diff -urN linux-2.4.20-pre1-ac1/arch/i386/kernel/apm.c linux-2.4.20-pre1-ac1.n/arch/i386/kernel/apm.c
--- linux-2.4.20-pre1-ac1/arch/i386/kernel/apm.c	2002-08-07 17:11:09.000000000 +0200
+++ linux-2.4.20-pre1-ac1.n/arch/i386/kernel/apm.c	2002-08-07 17:08:10.000000000 +0200
@@ -496,9 +496,9 @@
 }
 
 /*
- * Lock APM functionality to physical CPU 0
+ * Lock APM functionality to physical CPU 0 in SMP kernels
  */
- 
+
 #ifdef CONFIG_SMP
 
 static unsigned long apm_save_cpus(void)
@@ -518,15 +518,6 @@
 	set_cpus_allowed(current, mask);
 }
 
-#else
-
-/*
- *	No CPU lockdown needed on a uniprocessor
- */
- 
-#define apm_save_cpus	0
-#define apm_restore_cpus(x)
-
 #endif
 
 /*
@@ -602,8 +593,10 @@
 {
 	APM_DECL_SEGS
 	unsigned long	flags;
+#ifdef CONFIG_SMP
 	unsigned long cpus = apm_save_cpus();
-	
+#endif
+
 	__save_flags(flags);
 	APM_DO_CLI;
 	APM_DO_SAVE_SEGS;
@@ -625,9 +618,11 @@
 		: "memory", "cc");
 	APM_DO_RESTORE_SEGS;
 	__restore_flags(flags);
-	
+
+#ifdef CONFIG_SMP
 	apm_restore_cpus(cpus);
-	
+#endif
+
 	return *eax & 0xff;
 }
 
@@ -651,8 +646,10 @@
 	APM_DECL_SEGS
 	unsigned long	flags;
 
+#ifdef CONFIG_SMP
 	unsigned long cpus = apm_save_cpus();
-	
+#endif
+
 	__save_flags(flags);
 	APM_DO_CLI;
 	APM_DO_SAVE_SEGS;
@@ -679,8 +676,10 @@
 	APM_DO_RESTORE_SEGS;
 	__restore_flags(flags);
 
+#ifdef CONFIG_SMP
 	apm_restore_cpus(cpus);
-	
+#endif
+
 	return error;
 }
 
@@ -935,7 +934,9 @@
 	 */
 	if (apm_info.realmode_power_off)
 	{
+#ifdef CONFIG_SMP
 		apm_save_cpus();
+#endif
 		machine_real_restart(po_bios_call, sizeof(po_bios_call));
 		/* Never returns */
 	}

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

* Re: 2.4.20-pre1-ac1: apm.c non SMP compile error
  2002-08-07 15:15 ` Tomas Szepe
@ 2002-08-07 17:19   ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2002-08-07 17:19 UTC (permalink / raw)
  To: Tomas Szepe; +Cc: Eyal Lebedinsky, list linux-kernel, Alan Cox

On Wed, 2002-08-07 at 16:15, Tomas Szepe wrote:
> or alternatively the following, which for the cost of a couple ifdefs
> also removes the unused variable 'cpus' on UP:

The compiler will do that for us anyway


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

end of thread, other threads:[~2002-08-07 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-07 13:04 2.4.20-pre1-ac1: apm.c non SMP compile error Eyal Lebedinsky
2002-08-07 15:15 ` Tomas Szepe
2002-08-07 17:19   ` Alan Cox

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

all inboxes | Powered by JetHome®