Skip to contentSkip to conversation

current BK compilation failure on ppc32

PATCH Christoph Hellwig 3 participants 4 messages Jul 3, 2004 – Jul 4, 2004

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

kernel/power/smp.c: In function `smp_pause':
kernel/power/smp.c:24: error: storage size of ctxt' isn't known kernel/power/smp.c:24: warning: unused variable ctxt'

kernel/power/smp.c seems to be inherently swsusp-specific but is compiled for CONFIG_PM. (Same seems to be true for amny other files in kernel/power/, but as they compile it only causes bloat..)

kernel/power/Makefile +2 -0
@@ -1,5 +1,7 @@
 obj-y				:= main.o process.o console.o pm.o
+ifeq ($(CONFIG_SOFTWARE_SUSPEND), y)
 obj-$(CONFIG_SMP)		+= smp.o
+endif
 obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o
 obj-$(CONFIG_PM_DISK)		+= disk.o pmdisk.o
 
#1 lore raw

Hi!

Quoted 7 lines

kernel/power/smp.c: In function `smp_pause':
kernel/power/smp.c:24: error: storage size of ctxt' isn't known kernel/power/smp.c:24: warning: unused variable ctxt'

kernel/power/smp.c seems to be inherently swsusp-specific but is compiled for CONFIG_PM. (Same seems to be true for amny other files in kernel/power/, but as they compile it only causes bloat..)

Patch is good, thanks and sorry for breakage.
Pavel

Quoted 10 lines
kernel/power/Makefile +2 -0
@@ -1,5 +1,7 @@
 obj-y				:= main.o process.o console.o pm.o
+ifeq ($(CONFIG_SOFTWARE_SUSPEND), y)
 obj-$(CONFIG_SMP)		+= smp.o
+endif
 obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o
 obj-$(CONFIG_PM_DISK)		+= disk.o pmdisk.o
 
Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#2 lore raw
In reply to Christoph Hellwig

kernel/power/Makefile line 4

Quoted 13 lines · Christoph Hellwig

kernel/power/smp.c seems to be inherently swsusp-specific but is compiled for CONFIG_PM. (Same seems to be true for amny other files in kernel/power/, but as they compile it only causes bloat..)

kernel/power/Makefile +2 -0
@@ -1,5 +1,7 @@
 obj-y				:= main.o process.o console.o pm.o
+ifeq ($(CONFIG_SOFTWARE_SUSPEND), y)
 obj-$(CONFIG_SMP)		+= smp.o
+endif

Don't do it like that.

Instead, do something like

	smp-power-$(CONFIG_SMP)	+= smp.o
	obj-$(CONFIG_SOFTWARE_SUSPEND) += $(smp-power-y)

which not only is shorter, but gets a _lot_ more readable after a while.

It's also extremely useful for constructs like "include this file X is either 'y' or 'm'". From fs/Makefile:

	..

	nfsd-$(CONFIG_NFSD)             := nfsctl.o
	obj-y                           += $(nfsd-y) $(nfsd-m)

	..

which just means that "nfsctl.o" will be compiled in if nfsd is compiled-in or a module.

You can make pretty complex decision trees this way - much more readably than by explicit comparisons.

Linus

#3 lore raw
Quoted 8 lines

Don't do it like that.

Instead, do something like

	smp-power-$(CONFIG_SMP)	+= smp.o
	obj-$(CONFIG_SOFTWARE_SUSPEND) += $(smp-power-y)

which not only is shorter, but gets a _lot_ more readable after a while.

New patch below:

kernel/power/Makefile +4 -2
@@ -1,6 +1,8 @@
+
+swsusp-smp-$(CONFIG_SMP)	+= smp.o
+
 obj-y				:= main.o process.o console.o pm.o
-obj-$(CONFIG_SMP)		+= smp.o
-obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o
+obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o $(swsusp-smp-y)
 obj-$(CONFIG_PM_DISK)		+= disk.o pmdisk.o
 
 obj-$(CONFIG_MAGIC_SYSRQ)	+= poweroff.o