Re: 2.5.74-mm3 - apm_save_cpus() Macro still bombs out

William Lee Irwin III
2003-07-10T07:44:13Z

William Lee Irwin III <wli@holomorphy.com> wrote:
>> -#define apm_save_cpus() 0
>> +#define apm_save_cpus() ({ cpumask_t __mask__ = CPU_MASK_NONE; __mask__; })

On Thu, Jul 10, 2003 at 12:18:53AM -0700, Andrew Morton wrote:
> Taking a look at what the APM code is actually doing, I think using
> current->cpus_allowed just more sense in here.
> Not that it matters at all.

Going beyond pure substitution:

diff -prauN mm3-2.5.74-1/arch/i386/kernel/apm.c mm3-2.5.74-apm-1/arch/i386/kernel/apm.c
--- mm3-2.5.74-1/arch/i386/kernel/apm.c 2003-07-09 00:03:25.000000000 -0700
+++ mm3-2.5.74-apm-1/arch/i386/kernel/apm.c 2003-07-10 00:53:51.000000000 -0700
@@ -506,8 +506,6 @@ static void apm_error(char *str, int err
* Lock APM functionality to physical CPU 0
*/

-#ifdef CONFIG_SMP
-
static cpumask_t apm_save_cpus(void)
{
cpumask_t x = current->cpus_allowed;
@@ -522,17 +520,6 @@ static inline void apm_restore_cpus(cpum
set_cpus_allowed(current, mask);
}

-#else
-
-/*
- * No CPU lockdown needed on a uniprocessor
- */
-
-#define apm_save_cpus() 0
-#define apm_restore_cpus(x) (void)(x)
-
-#endif
-
/*
* These are the actual BIOS calls. Depending on APM_ZERO_SEGS and
* apm_info.allow_ints, we are being really paranoid here! Not only