Skip to contentSkip to conversation

KBUILD: Move non-__KERNEL__-checking headers to header-y.

PATCH In review Robert P. J. Day 5 participants 15 messages May 18, 2008 – May 22, 2008

Subsystems (8)
Sound Kbuild netfilter NFS client +4 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KBUILD: Move non-__KERNEL__-checking headers to header-y.

Move exported header files under include/linux that don't check the __KERNEL__ preprocessor from unifdef-y to header-y.

---

include/linux/Kbuild +8 -8
index b7d81b2..6333a16 100644
@@ -104,6 +104,7 @@ header-y += iso_fs.h
 header-y += ixjuser.h
 header-y += jffs2.h
 header-y += keyctl.h
+header-y += kvm.h
 header-y += limits.h
 header-y += dlm_plock.h
 header-y += magic.h
@@ -157,11 +158,18 @@ header-y += toshiba.h
 header-y += udf_fs_i.h
 header-y += ultrasound.h
 header-y += un.h
+header-y += unistd.h
 header-y += utime.h
 header-y += veth.h
 header-y += video_decoder.h
 header-y += video_encoder.h
 header-y += videotext.h
+header-y += virtio_blk.h
+header-y += virtio_net.h
+header-y += virtio_9p.h
+header-y += virtio_balloon.h
+header-y += virtio_pci.h
+header-y += wireless.h
 header-y += x25.h
 
 unifdef-y += acct.h
@@ -253,7 +261,6 @@ unifdef-y += kd.h
 unifdef-y += kernelcapi.h
 unifdef-y += kernel.h
 unifdef-y += keyboard.h
-unifdef-y += kvm.h
 unifdef-y += llc.h
 unifdef-y += loop.h
 unifdef-y += lp.h
@@ -338,24 +345,17 @@ unifdef-y += types.h
 unifdef-y += udp.h
 unifdef-y += uinput.h
 unifdef-y += uio.h
-unifdef-y += unistd.h
 unifdef-y += usbdevice_fs.h
 unifdef-y += utsname.h
 unifdef-y += videodev2.h
 unifdef-y += videodev.h
 unifdef-y += virtio_config.h
-unifdef-y += virtio_blk.h
-unifdef-y += virtio_net.h
-unifdef-y += virtio_9p.h
-unifdef-y += virtio_balloon.h
 unifdef-y += virtio_console.h
-unifdef-y += virtio_pci.h
 unifdef-y += virtio_ring.h
 unifdef-y += vt.h
 unifdef-y += wait.h
 unifdef-y += wanrouter.h
 unifdef-y += watchdog.h
-unifdef-y += wireless.h
 unifdef-y += xattr.h
 unifdef-y += xfrm.h
 

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================

#1 lore raw
Quoted 4 lines · On Sat, 17 May 2008 20:18:07 -0400 (EDT) "Robert P. J. Day"…

Move exported header files under include/linux that don't check the __KERNEL__ preprocessor from unifdef-y to header-y.

Changelog fails to tell us why this change is being made.

Perhaps it's because these headers just don't need unifdef processing?

If so, that seems fragile. If we later add a __KERNEL__ section to a header we need to remember to move the file to unifdef-y, and we'll forget. It'd be better to process all files with unifdef.

Or something. Or not.

#2 lore raw
Quoted 9 lines · Andrew Morton
Quoted 4 lines · On Sat, 17 May 2008 20:18:07 -0400 (EDT) "Robert P. J. Day"…

Move exported header files under include/linux that don't check the __KERNEL__ preprocessor from unifdef-y to header-y.

Changelog fails to tell us why this change is being made.

Quoted 7 lines

Perhaps it's because these headers just don't need unifdef processing?

If so, that seems fragile. If we later add a __KERNEL__ section to a header we need to remember to move the file to unifdef-y, and we'll forget. It'd be better to process all files with unifdef.

Or something. Or not.

i don't see a problem with simply running all exported files through
unifdef -- i've never understood the two categories since the unifdef process is not exactly CPU-intensive and it can't possibly hurt for some of those operations to be redundant.

but as long as the two categories exist, might as well keep them
clean.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================

#3 lore raw
Quoted 19 lines · On Wed, 21 May 2008 04:36:30 -0400 (EDT) "Robert P. J. Day"…
Quoted 9 lines · Andrew Morton
Quoted 4 lines · On Sat, 17 May 2008 20:18:07 -0400 (EDT) "Robert P. J. Day"…

Move exported header files under include/linux that don't check the __KERNEL__ preprocessor from unifdef-y to header-y.

Changelog fails to tell us why this change is being made.

Quoted 7 lines

Perhaps it's because these headers just don't need unifdef processing?

If so, that seems fragile. If we later add a __KERNEL__ section to a header we need to remember to move the file to unifdef-y, and we'll forget. It'd be better to process all files with unifdef.

Or something. Or not.

Quoted 8 lines

i don't see a problem with simply running all exported files through
unifdef -- i've never understood the two categories since the unifdef process is not exactly CPU-intensive and it can't possibly hurt for some of those operations to be redundant.

but as long as the two categories exist, might as well keep them
clean.

Well... not to let this go for now - nuking the header-y stuff is an attractive cleanup. David, are we missing something here?

#4 lore raw
Quoted 26 lines · Andrew Morton
Quoted 24 lines · On Wed, 21 May 2008 04:36:30 -0400 (EDT) "Robert P. J. Day"…
Quoted 9 lines · Andrew Morton
Quoted 4 lines · On Sat, 17 May 2008 20:18:07 -0400 (EDT) "Robert P. J. Day"…

Move exported header files under include/linux that don't check the __KERNEL__ preprocessor from unifdef-y to header-y.

Changelog fails to tell us why this change is being made.

Quoted 7 lines

Perhaps it's because these headers just don't need unifdef processing?

If so, that seems fragile. If we later add a __KERNEL__ section to a header we need to remember to move the file to unifdef-y, and we'll forget. It'd be better to process all files with unifdef.

Or something. Or not.

i don't see a problem with simply running all exported files through
unifdef -- i've never understood the two categories since the unifdef process is not exactly CPU-intensive and it can't possibly hurt for some of those operations to be redundant.

Quoted 6 lines
Quoted 3 lines

but as long as the two categories exist, might as well keep them
clean.

Well... not to let this go for now - nuking the header-y stuff is an attractive cleanup. David, are we missing something here?

I don't recall unifdef being anywhere near as fast as simply copying the headers, but a quick test shows that it is now -- it makes virtually no difference to the time if I unifdef them all. Maybe I was just making it up, or maybe the unifdef implementation we were using before was a lot less efficient.

The other reason for having header-y separate from unifdef-y was that it highlights the difference between headers which are clean and ifdef-free (which we like), and headers with ifdefs (which, in general, we don't).

Since we've removed the gratuitous __KERNEL__ from unexported headers, though, I don't think that matters much either -- we can see the ifdefs quite happily.

So I see no particular reason why we shouldn't drop header-y completely and just unifdef the lot.

Signature · 1 line
dwmw2
#5 lore raw
Quoted 44 lines · David Woodhouse
Quoted 26 lines · Andrew Morton
Quoted 24 lines · On Wed, 21 May 2008 04:36:30 -0400 (EDT) "Robert P. J. Day"…
Quoted 9 lines · Andrew Morton
Quoted 4 lines · On Sat, 17 May 2008 20:18:07 -0400 (EDT) "Robert P. J. Day"…

Move exported header files under include/linux that don't check the __KERNEL__ preprocessor from unifdef-y to header-y.

Changelog fails to tell us why this change is being made.

Quoted 7 lines

Perhaps it's because these headers just don't need unifdef processing?

If so, that seems fragile. If we later add a __KERNEL__ section to a header we need to remember to move the file to unifdef-y, and we'll forget. It'd be better to process all files with unifdef.

Or something. Or not.

i don't see a problem with simply running all exported files through
unifdef -- i've never understood the two categories since the unifdef process is not exactly CPU-intensive and it can't possibly hurt for some of those operations to be redundant.

Quoted 6 lines
Quoted 3 lines

but as long as the two categories exist, might as well keep them
clean.

Well... not to let this go for now - nuking the header-y stuff is an attractive cleanup. David, are we missing something here?

I don't recall unifdef being anywhere near as fast as simply copying the headers, but a quick test shows that it is now -- it makes virtually no difference to the time if I unifdef them all. Maybe I was just making it up, or maybe the unifdef implementation we were using before was a lot less efficient.

The other reason for having header-y separate from unifdef-y was that it highlights the difference between headers which are clean and ifdef-free (which we like), and headers with ifdefs (which, in general, we don't).

Quoted 6 lines

Since we've removed the gratuitous __KERNEL__ from unexported headers, though, I don't think that matters much either -- we can see the ifdefs quite happily.

So I see no particular reason why we shouldn't drop header-y completely and just unifdef the lot.

Sam already ACK'ed this idea when I suggested it a few weeks ago and I'll get my ass up and cook a patch today or tomorrow.

Quoted 1 line

dwmw2

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#6 lore raw
Quoted 5 lines · Adrian Bunk
Quoted 2 lines

So I see no particular reason why we shouldn't drop header-y completely and just unifdef the lot.

Sam already ACK'ed this idea when I suggested it a few weeks ago and I'll get my ass up and cook a patch today or tomorrow.

Thanks.

Signature · 1 line
dwmw2
#7 lore raw

PATCH 1/1 run all userspace headers through unifdef

Quoted 8 lines · David Woodhouse
Quoted 5 lines · Adrian Bunk
Quoted 2 lines

So I see no particular reason why we shouldn't drop header-y completely and just unifdef the lot.

Sam already ACK'ed this idea when I suggested it a few weeks ago and I'll get my ass up and cook a patch today or tomorrow.

Thanks.

Patch below.

Quoted 1 line

dwmw2

cu
Adrian

<-- snip -->

Facts:
- installing userspace headers is nothing that is required as part of a normal kernel build
- unifdef is relatively fast
- there are sometimes patches moving headers from header-y to unifdef-y or the other way round

Instead of constantly seeing headers moving between header-y and unifdef-y this patch removes unifdef-y and runs all userspace headers through unifdef.

It also contains some unrelated sorting corrections in the Kbuild files since I used GNU sort for the semi-automatic conversion of the Kbuild files.

---

 include/asm-alpha/Kbuild              |   11 
 include/asm-arm/Kbuild                |    2 
 include/asm-cris/Kbuild               |    5 
 include/asm-frv/Kbuild                |    5 
 include/asm-generic/Kbuild            |    9 
 include/asm-generic/Kbuild.asm        |   61 +--
 include/asm-ia64/Kbuild               |    9 
 include/asm-parisc/Kbuild             |    2 
 include/asm-powerpc/Kbuild            |   59 +--
 include/asm-s390/Kbuild               |    7 
 include/asm-sh/Kbuild                 |    9 
 include/asm-sparc/Kbuild              |    7 
 include/asm-sparc64/Kbuild            |    5 
 include/asm-x86/Kbuild                |   27 -
 include/linux/Kbuild                  |  399 ++++++++++++--------------
 include/linux/byteorder/Kbuild        |    6 
 include/linux/dvb/Kbuild              |    7 
 include/linux/netfilter/Kbuild        |   17 -
 include/linux/netfilter_arp/Kbuild    |    3 
 include/linux/netfilter_bridge/Kbuild |    5 
 include/linux/netfilter_ipv4/Kbuild   |    5 
 include/linux/netfilter_ipv6/Kbuild   |    3 
 include/linux/nfsd/Kbuild             |   12 
 include/linux/sunrpc/Kbuild           |    2 
 include/sound/Kbuild                  |    9 
 include/video/Kbuild                  |    4 
 scripts/Makefile.headersinst          |   27 -
 27 files changed, 343 insertions(+), 374 deletions(-)

ae5fb1894656676fec7029934a3425ba6dc0fbe6 diff --git a/include/asm-alpha/Kbuild b/include/asm-alpha/Kbuild index b7c8f18..e80530f 100644

include/asm-alpha/Kbuild +5 -6
@@ -1,11 +1,10 @@
 include include/asm-generic/Kbuild.asm
 
+header-y += compiler.h
+header-y += console.h
+header-y += fpu.h
 header-y += gentrap.h
-header-y += regdef.h
 header-y += pal.h
+header-y += regdef.h
 header-y += reg.h
-
-unifdef-y += console.h
-unifdef-y += fpu.h
-unifdef-y += sysinfo.h
-unifdef-y += compiler.h
+header-y += sysinfo.h
include/asm-arm/Kbuild +1 -1
index 73237bd..6550db3 100644
@@ -1,3 +1,3 @@
 include include/asm-generic/Kbuild.asm
 
-unifdef-y += hwcap.h
+header-y += hwcap.h
include/asm-cris/Kbuild +2 -3
index 1745545..43d0816 100644
@@ -4,8 +4,7 @@ header-$(CONFIG_ETRAX_ARCH_V10) += arch-v10/
 header-$(CONFIG_ETRAX_ARCH_V32) += arch-v32/
 
 header-y += ethernet.h
+header-y += etraxgpio.h
+header-y += rs485.h
 header-y += rtc.h
 header-y += sync_serial.h
-
-unifdef-y += etraxgpio.h
-unifdef-y += rs485.h
include/asm-frv/Kbuild +2 -3
index bc3f12c..48a1195 100644
@@ -1,6 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
+header-y += ptrace.h
 header-y += registers.h
-
-unifdef-y += termios.h
-unifdef-y += ptrace.h
+header-y += termios.h
include/asm-generic/Kbuild +4 -5
index 4c9932a..137c418 100644
@@ -1,13 +1,12 @@
 header-y += errno-base.h
 header-y += errno.h
 header-y += fcntl.h
+header-y += int-l64.h
+header-y += int-ll64.h
 header-y += ioctl.h
 header-y += mman.h
 header-y += poll.h
+header-y += resource.h
+header-y += siginfo.h
 header-y += signal.h
 header-y += statfs.h
-
-unifdef-y += int-l64.h
-unifdef-y += int-ll64.h
-unifdef-y += resource.h
-unifdef-y += siginfo.h
include/asm-generic/Kbuild.asm +30 -31

63 lines not on this page · raw message

include/asm-ia64/Kbuild +4 -5
index eb24a3f..f787655 100644
@@ -1,16 +1,15 @@
 include include/asm-generic/Kbuild.asm
 
 header-y += break.h
-header-y += fpu.h
 header-y += fpswa.h
+header-y += fpu.h
+header-y += gcc_intrin.h
 header-y += ia64regs.h
 header-y += intel_intrin.h
 header-y += intrinsics.h
 header-y += perfmon_default_smpl.h
+header-y += perfmon.h
 header-y += ptrace_offsets.h
 header-y += rse.h
 header-y += ucontext.h
-
-unifdef-y += gcc_intrin.h
-unifdef-y += perfmon.h
-unifdef-y += ustack.h
+header-y += ustack.h
include/asm-parisc/Kbuild +1 -1
index f88b252..19a434f 100644
@@ -1,3 +1,3 @@
 include include/asm-generic/Kbuild.asm
 
-unifdef-y += pdc.h
+header-y += pdc.h
include/asm-powerpc/Kbuild +29 -30

70 lines not on this page · raw message

include/asm-s390/Kbuild +3 -4
index 13c9805..9dd2316 100644
@@ -1,13 +1,12 @@
 include include/asm-generic/Kbuild.asm
 
+header-y += cmb.h
 header-y += dasd.h
+header-y += debug.h
+header-y += kvm.h
 header-y += monwriter.h
 header-y += qeth.h
 header-y += tape390.h
 header-y += ucontext.h
 header-y += vtoc.h
 header-y += zcrypt.h
-header-y += kvm.h
-
-unifdef-y += cmb.h
-unifdef-y += debug.h
include/asm-sh/Kbuild +4 -5
index 43910cd..51e5b24 100644
@@ -1,8 +1,7 @@
 include include/asm-generic/Kbuild.asm
 
 header-y += cpu-features.h
-
-unifdef-y += unistd_32.h
-unifdef-y += unistd_64.h
-unifdef-y += posix_types_32.h
-unifdef-y += posix_types_64.h
+header-y += posix_types_32.h
+header-y += posix_types_64.h
+header-y += unistd_32.h
+header-y += unistd_64.h
include/asm-sparc/Kbuild +3 -4
index 6712237..91fc496 100644
@@ -3,12 +3,11 @@ include include/asm-generic/Kbuild.asm
 header-y += apc.h
 header-y += asi.h
 header-y += bpp.h
+header-y += fbio.h
 header-y += jsflash.h
 header-y += openpromio.h
+header-y += perfctr.h
+header-y += psr.h
 header-y += reg.h
 header-y += traps.h
 header-y += vfc_ioctls.h
-
-unifdef-y += fbio.h
-unifdef-y += perfctr.h
-unifdef-y += psr.h
include/asm-sparc64/Kbuild +2 -3
index dce1cf9..3f44ebd 100644
@@ -10,14 +10,13 @@ header-y += bbc.h
 header-y += bpp.h
 header-y += display7seg.h
 header-y += envctrl.h
+header-y += fbio.h
 header-y += openprom.h
 header-y += openpromio.h
+header-y += perfctr.h
 header-y += psrcompat.h
 header-y += pstate.h
 header-y += reg.h
 header-y += uctx.h
 header-y += utrap.h
 header-y += watchdog.h
-
-unifdef-y += fbio.h
-unifdef-y += perfctr.h
include/asm-x86/Kbuild +13 -14
index 1e35545..eae3fd8 100644
@@ -3,24 +3,23 @@ include include/asm-generic/Kbuild.asm
 header-y += boot.h
 header-y += bootparam.h
 header-y += debugreg.h
+header-y += e820.h
+header-y += ist.h
 header-y += kvm.h
 header-y += ldt.h
+header-y += mce.h
+header-y += msr.h
 header-y += msr-index.h
+header-y += mtrr.h
+header-y += posix_types_32.h
+header-y += posix_types_64.h
 header-y += prctl.h
+header-y += processor-flags.h
 header-y += ptrace-abi.h
+header-y += ptrace.h
 header-y += sigcontext32.h
 header-y += ucontext.h
-header-y += processor-flags.h
-
-unifdef-y += e820.h
-unifdef-y += ist.h
-unifdef-y += mce.h
-unifdef-y += msr.h
-unifdef-y += mtrr.h
-unifdef-y += posix_types_32.h
-unifdef-y += posix_types_64.h
-unifdef-y += ptrace.h
-unifdef-y += unistd_32.h
-unifdef-y += unistd_64.h
-unifdef-y += vm86.h
-unifdef-y += vsyscall.h
+header-y += unistd_32.h
+header-y += unistd_64.h
+header-y += vm86.h
+header-y += vsyscall.h
include/linux/Kbuild +199 -200

543 lines not on this page · raw message

include/linux/byteorder/Kbuild +3 -3
index 1133d5f..553c06f 100644
@@ -1,3 +1,3 @@
-unifdef-y += big_endian.h
-unifdef-y += little_endian.h
-unifdef-y += swab.h
+header-y += big_endian.h
+header-y += little_endian.h
+header-y += swab.h
include/linux/dvb/Kbuild +3 -4
index d97b3a5..f4dba86 100644
@@ -1,9 +1,8 @@
+header-y += audio.h
 header-y += ca.h
+header-y += dmx.h
 header-y += frontend.h
 header-y += net.h
 header-y += osd.h
 header-y += version.h
-
-unifdef-y += audio.h
-unifdef-y += dmx.h
-unifdef-y += video.h
+header-y += video.h
include/linux/netfilter/Kbuild +8 -9
index 3aff513..7d7bfcf 100644
@@ -1,8 +1,14 @@
+header-y += nf_conntrack_common.h
+header-y += nf_conntrack_ftp.h
 header-y += nf_conntrack_sctp.h
+header-y += nf_conntrack_tcp.h
 header-y += nf_conntrack_tuple_common.h
 header-y += nfnetlink_conntrack.h
+header-y += nfnetlink.h
+header-y += nfnetlink_compat.h
 header-y += nfnetlink_log.h
 header-y += nfnetlink_queue.h
+header-y += x_tables.h
 header-y += xt_CLASSIFY.h
 header-y += xt_CONNMARK.h
 header-y += xt_CONNSECMARK.h
@@ -29,7 +35,9 @@ header-y += xt_mac.h
 header-y += xt_mark.h
 header-y += xt_multiport.h
 header-y += xt_owner.h
+header-y += xt_physdev.h
 header-y += xt_pkttype.h
+header-y += xt_policy.h
 header-y += xt_rateest.h
 header-y += xt_realm.h
 header-y += xt_sctp.h
@@ -38,12 +46,3 @@ header-y += xt_statistic.h
 header-y += xt_string.h
 header-y += xt_tcpmss.h
 header-y += xt_tcpudp.h
-
-unifdef-y += nf_conntrack_common.h
-unifdef-y += nf_conntrack_ftp.h
-unifdef-y += nf_conntrack_tcp.h
-unifdef-y += nfnetlink.h
-unifdef-y += nfnetlink_compat.h
-unifdef-y += x_tables.h
-unifdef-y += xt_physdev.h
-unifdef-y += xt_policy.h
include/linux/netfilter_arp/Kbuild +1 -2
index 4f13dfc..b27439c 100644
@@ -1,3 +1,2 @@
+header-y += arp_tables.h
 header-y += arpt_mangle.h
-
-unifdef-y += arp_tables.h
include/linux/netfilter_bridge/Kbuild +2 -3
index 76ff4c4..1ceb90c 100644
@@ -1,3 +1,5 @@
+header-y += ebt_802_3.h
+header-y += ebtables.h
 header-y += ebt_among.h
 header-y += ebt_arp.h
 header-y += ebt_arpreply.h
@@ -12,6 +14,3 @@ header-y += ebt_redirect.h
 header-y += ebt_stp.h
 header-y += ebt_ulog.h
 header-y += ebt_vlan.h
-
-unifdef-y += ebtables.h
-unifdef-y += ebt_802_3.h
include/linux/netfilter_ipv4/Kbuild +2 -3
index 3a7105b..4e21dc0 100644
@@ -1,3 +1,5 @@
+header-y += ip_queue.h
+header-y += ip_tables.h
 header-y += ipt_CLASSIFY.h
 header-y += ipt_CLUSTERIP.h
 header-y += ipt_CONNMARK.h
@@ -42,6 +44,3 @@ header-y += ipt_string.h
 header-y += ipt_tcpmss.h
 header-y += ipt_tos.h
 header-y += ipt_ttl.h
-
-unifdef-y += ip_queue.h
-unifdef-y += ip_tables.h
include/linux/netfilter_ipv6/Kbuild +1 -2
index 8887a5f..2c6981c 100644
@@ -1,3 +1,4 @@
+header-y += ip6_tables.h
 header-y += ip6t_HL.h
 header-y += ip6t_LOG.h
 header-y += ip6t_MARK.h
@@ -17,5 +18,3 @@ header-y += ip6t_owner.h
 header-y += ip6t_physdev.h
 header-y += ip6t_policy.h
 header-y += ip6t_rt.h
-
-unifdef-y += ip6_tables.h
include/linux/nfsd/Kbuild +6 -6
index fc97204..55d1467 100644
@@ -1,6 +1,6 @@
-unifdef-y += const.h
-unifdef-y += debug.h
-unifdef-y += export.h
-unifdef-y += nfsfh.h
-unifdef-y += stats.h
-unifdef-y += syscall.h
+header-y += const.h
+header-y += debug.h
+header-y += export.h
+header-y += nfsfh.h
+header-y += stats.h
+header-y += syscall.h
include/linux/sunrpc/Kbuild +1 -1
index fb438f1..98df211 100644
@@ -1 +1 @@
-unifdef-y += debug.h
+header-y += debug.h
include/sound/Kbuild +4 -5
index fd054a3..b5b7ac7 100644
@@ -1,10 +1,9 @@
+header-y += asequencer.h
 header-y += asound_fm.h
+header-y += asound.h
+header-y += emu10k1.h
 header-y += hdsp.h
 header-y += hdspm.h
+header-y += sb16_csp.h
 header-y += sfnt_info.h
 header-y += sscape_ioctl.h
-
-unifdef-y += asequencer.h
-unifdef-y += asound.h
-unifdef-y += emu10k1.h
-unifdef-y += sb16_csp.h
include/video/Kbuild +2 -2
index 0e406f7..fff858e 100644
@@ -1,2 +1,2 @@
-unifdef-y += sisfb.h uvesafb.h
-unifdef-y += edid.h
+header-y += edid.h
+header-y += sisfb.h uvesafb.h
scripts/Makefile.headersinst +8 -19
index 53dae3e..4e22f58 100644
@@ -1,8 +1,7 @@
 # ==========================================================================
 # Installing headers
 #
-# header-y files will be installed verbatim
-# unifdef-y are the files where unifdef will be run before installing files
+# header-y are the files where unifdef will be run before installing files
 # objhdr-y are generated files that will be installed verbatim
 #
 # ==========================================================================
@@ -51,24 +50,21 @@ ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)$(BIASMDIR))
 endif
 
 header-y	:= $(sort $(header-y))
-unifdef-y	:= $(sort $(unifdef-y))
 subdir-y	:= $(patsubst %/,%,$(filter %/, $(header-y)))
 header-y	:= $(filter-out %/, $(header-y))
-header-y	:= $(filter-out $(unifdef-y),$(header-y))
 
 # stamp files for header checks
-check-y		:= $(patsubst %,.check.%,$(header-y) $(unifdef-y) $(objhdr-y))
+check-y		:= $(patsubst %,.check.%,$(header-y) $(objhdr-y))
 
 # Work out what needs to be removed
 oldheaders	:= $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/*.h))
-unwanted	:= $(filter-out $(header-y) $(unifdef-y) $(objhdr-y),$(oldheaders))
+unwanted	:= $(filter-out $(header-y) $(objhdr-y),$(oldheaders))
 
 oldcheckstamps	:= $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/.check.*.h))
 unwanted	+= $(filter-out $(check-y),$(oldcheckstamps))
 
 # Prefix them all with full paths to $(INSTALL_HDR_PATH)
 header-y 	:= $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(header-y))
-unifdef-y 	:= $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(unifdef-y))
 objhdr-y 	:= $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(objhdr-y))
 check-y 	:= $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(check-y))
 
@@ -89,11 +85,7 @@ quiet_cmd_o_hdr_install   = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
 			    $(INSTALL_HDR_PATH)/$(_dst)
 
 quiet_cmd_headers_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
-      cmd_headers_install = $(HDRSED) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@)	\
-			    > $@
-
-quiet_cmd_unifdef	  = UNIFDEF $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
-      cmd_unifdef	  = $(UNIFDEF) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \
+      cmd_headers_install = $(UNIFDEF) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \
 				   | $(HDRSED) > $@ || :
 
 quiet_cmd_check		  = CHECK   $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/.check.%,$(_dst)/%,$@)
@@ -151,10 +143,10 @@ include /dev/null $(wildcard $(check-y))
 
 else
 # Rules for installing headers
-__headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y)
+__headersinst: $(subdir-y) $(header-y) $(altarch-y) $(objhdr-y)
 	@true
 
-$(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): | $(INSTALL_HDR_PATH)/$(_dst) $(unwanted)
+$(objhdr-y) $(subdir-y) $(header-y): | $(INSTALL_HDR_PATH)/$(_dst) $(unwanted)
 
 $(INSTALL_HDR_PATH)/$(_dst):
 	$(call cmd,mkdir)
@@ -164,7 +156,7 @@ $(unwanted):
 	$(call cmd,remove)
 
 ifdef GENASM
-$(objhdr-y) $(header-y) $(unifdef-y): $(KBUILDFILES)
+$(objhdr-y) $(header-y): $(KBUILDFILES)
 	$(call cmd,gen)
 
 else
@@ -173,9 +165,6 @@ $(objhdr-y) :		$(INSTALL_HDR_PATH)/$(_dst)/%.h: $(objtree)/$(obj)/%.h $(KBUILDFI
 
 $(header-y) :		$(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
 	$(call cmd,headers_install)
-
-$(unifdef-y) :		$(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
-	$(call cmd,unifdef)
 endif
 endif
 
@@ -184,7 +173,7 @@ hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
 .PHONY: altarch-dir
 # All the files in the normal arch dir must be created first, since we test
 # for their existence.
-altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y)
+altarch-dir: $(subdir-y) $(header-y) $(objhdr-y)
 	$(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH)
 	$(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm$(BIASMDIR)
 
#8 lore raw

Re: [2.6 patch] run all userspace headers through unifdef

Quoted 39 lines · On Wed, 21 May 2008 20:41:43 +0300 Adrian Bunk <[email protected]> wrote:

Facts:
- installing userspace headers is nothing that is required as part of a normal kernel build
- unifdef is relatively fast
- there are sometimes patches moving headers from header-y to unifdef-y or the other way round

Instead of constantly seeing headers moving between header-y and unifdef-y this patch removes unifdef-y and runs all userspace headers through unifdef.

It also contains some unrelated sorting corrections in the Kbuild files since I used GNU sort for the semi-automatic conversion of the Kbuild files.

---

 include/asm-alpha/Kbuild              |   11 
 include/asm-arm/Kbuild                |    2 
 include/asm-cris/Kbuild               |    5 
 include/asm-frv/Kbuild                |    5 
 include/asm-generic/Kbuild            |    9 
 include/asm-generic/Kbuild.asm        |   61 +--
 include/asm-ia64/Kbuild               |    9 
 include/asm-parisc/Kbuild             |    2 
 include/asm-powerpc/Kbuild            |   59 +--
 include/asm-s390/Kbuild               |    7 
 include/asm-sh/Kbuild                 |    9 
 include/asm-sparc/Kbuild              |    7 
 include/asm-sparc64/Kbuild            |    5 
 include/asm-x86/Kbuild                |   27 -
 include/linux/Kbuild                  |  399 ++++++++++++--------------
 include/linux/byteorder/Kbuild        |    6 
 include/linux/dvb/Kbuild              |    7 
 include/linux/netfilter/Kbuild        |   17 -
 include/linux/netfilter_arp/Kbuild    |    3 
 include/linux/netfilter_bridge/Kbuild |    5 
Quoted 8 lines
 include/linux/netfilter_ipv4/Kbuild   |    5 
 include/linux/netfilter_ipv6/Kbuild   |    3 
 include/linux/nfsd/Kbuild             |   12 
 include/linux/sunrpc/Kbuild           |    2 
 include/sound/Kbuild                  |    9 
 include/video/Kbuild                  |    4 
 scripts/Makefile.headersinst          |   27 -
 27 files changed, 343 insertions(+), 374 deletions(-)

This is going to be a bit of a pain for everyone - people are forever patching those Kbuild files.

Is there a way in which we can do this in stages? Treat header-y in the same manner as unifdef-y, then get all the unifdef-y's switched over to header-y and once that is done, remove the "treat header-y in the same manner as unifdef-y" support?

#9 lore raw

Re: [2.6 patch] run all userspace headers through unifdef

Quoted 8 lines · Andrew Morton

This is going to be a bit of a pain for everyone - people are forever patching those Kbuild files.

Is there a way in which we can do this in stages? Treat header-y in the same manner as unifdef-y, then get all the unifdef-y's switched over to header-y and once that is done, remove the "treat header-y in the same manner as unifdef-y" support?

We could. But does that actually reduce the pain, or just spread it about a bit?

Signature · 1 line
dwmw2
#14 lore raw

Re: [2.6 patch] run all userspace headers through unifdef

In reply to Andrew Morton
Quoted 50 lines · Andrew Morton
Quoted 39 lines · On Wed, 21 May 2008 20:41:43 +0300 Adrian Bunk <[email protected]> wrote:

Facts:
- installing userspace headers is nothing that is required as part of a normal kernel build
- unifdef is relatively fast
- there are sometimes patches moving headers from header-y to unifdef-y or the other way round

Instead of constantly seeing headers moving between header-y and unifdef-y this patch removes unifdef-y and runs all userspace headers through unifdef.

It also contains some unrelated sorting corrections in the Kbuild files since I used GNU sort for the semi-automatic conversion of the Kbuild files.

---

 include/asm-alpha/Kbuild              |   11 
 include/asm-arm/Kbuild                |    2 
 include/asm-cris/Kbuild               |    5 
 include/asm-frv/Kbuild                |    5 
 include/asm-generic/Kbuild            |    9 
 include/asm-generic/Kbuild.asm        |   61 +--
 include/asm-ia64/Kbuild               |    9 
 include/asm-parisc/Kbuild             |    2 
 include/asm-powerpc/Kbuild            |   59 +--
 include/asm-s390/Kbuild               |    7 
 include/asm-sh/Kbuild                 |    9 
 include/asm-sparc/Kbuild              |    7 
 include/asm-sparc64/Kbuild            |    5 
 include/asm-x86/Kbuild                |   27 -
 include/linux/Kbuild                  |  399 ++++++++++++--------------
 include/linux/byteorder/Kbuild        |    6 
 include/linux/dvb/Kbuild              |    7 
 include/linux/netfilter/Kbuild        |   17 -
 include/linux/netfilter_arp/Kbuild    |    3 
 include/linux/netfilter_bridge/Kbuild |    5 
Quoted 8 lines
 include/linux/netfilter_ipv4/Kbuild   |    5 
 include/linux/netfilter_ipv6/Kbuild   |    3 
 include/linux/nfsd/Kbuild             |   12 
 include/linux/sunrpc/Kbuild           |    2 
 include/sound/Kbuild                  |    9 
 include/video/Kbuild                  |    4 
 scripts/Makefile.headersinst          |   27 -
 27 files changed, 343 insertions(+), 374 deletions(-)
Quoted 7 lines

This is going to be a bit of a pain for everyone - people are forever patching those Kbuild files.

Is there a way in which we can do this in stages? Treat header-y in the same manner as unifdef-y, then get all the unifdef-y's switched over to header-y and once that is done, remove the "treat header-y in the same manner as unifdef-y" support?

I had following untested patch in mind.

scripts/Makefile.headersinst +3 -5
index 53dae3e..4cbf9ea 100644
@@ -50,11 +50,9 @@ ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)$(BIASMDIR))
      _dst := include/asm
 endif
 
-header-y	:= $(sort $(header-y))
-unifdef-y	:= $(sort $(unifdef-y))
-subdir-y	:= $(patsubst %/,%,$(filter %/, $(header-y)))
-header-y	:= $(filter-out %/, $(header-y))
-header-y	:= $(filter-out $(unifdef-y),$(header-y))
+unifdef-y	:= $(sort $(unifdef-y) $(header-y))
+subdir-y	:= $(patsubst %/,%,$(filter %/, $(unidef-y)))
+header-y        :=
 
 # stamp files for header checks
 check-y		:= $(patsubst %,.check.%,$(header-y) $(unifdef-y) $(objhdr-y))

And then separate patches for each directory under include/ so they are easy to drop in case of conflicts.

Then I expect we will have it 90% sorted out in first week of the merge and the remaining 10% should be easy to sort out.

PS. I need to dig out my old patch optimizing Makefile.headerinst so we eventually can simplify Makefile.headerinst and speed it up. But lacking time...

Sam

#10 lore raw

Re: [2.6 patch] run all userspace headers through unifdef

In reply to David Woodhouse
Quoted 5 lines · On Thu, 22 May 2008 08:00:12 +0100 David Woodhouse <[email protected]> wrote:
Quoted 4 lines · Andrew Morton

This is going to be a bit of a pain for everyone - people are forever patching those Kbuild files.

Quoted 7 lines
Quoted 4 lines

Is there a way in which we can do this in stages? Treat header-y in the same manner as unifdef-y, then get all the unifdef-y's switched over to header-y and once that is done, remove the "treat header-y in the same manner as unifdef-y" support?

We could. But does that actually reduce the pain, or just spread it about a bit?

It means Stephen and I only need to carry the bulk of the patch for a few days rather than a month or more.

#11 lore raw

Re: [2.6 patch] run all userspace headers through unifdef

Quoted 12 lines · Andrew Morton
Quoted 10 lines · On Thu, 22 May 2008 08:00:12 +0100 David Woodhouse <[email protected]> wrote:
Quoted 8 lines · Andrew Morton

This is going to be a bit of a pain for everyone - people are forever patching those Kbuild files.

Is there a way in which we can do this in stages? Treat header-y in the same manner as unifdef-y, then get all the unifdef-y's switched over to header-y and once that is done, remove the "treat header-y in the same manner as unifdef-y" support?

Quoted 5 lines
Quoted 2 lines

We could. But does that actually reduce the pain, or just spread it about a bit?

It means Stephen and I only need to carry the bulk of the patch for a few days rather than a month or more.

OK, maybe that makes sense then. Linus can do the conversion with a simple sed invocation whenever we're ready.

Signature · 1 line
dwmw2
#12 lore raw

Re: [2.6 patch] run all userspace headers through unifdef

Quoted 13 lines · David Woodhouse
Quoted 12 lines · Andrew Morton
Quoted 10 lines · On Thu, 22 May 2008 08:00:12 +0100 David Woodhouse <[email protected]> wrote:
Quoted 8 lines · Andrew Morton

This is going to be a bit of a pain for everyone - people are forever patching those Kbuild files.

Is there a way in which we can do this in stages? Treat header-y in the same manner as unifdef-y, then get all the unifdef-y's switched over to header-y and once that is done, remove the "treat header-y in the same manner as unifdef-y" support?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

We could. But does that actually reduce the pain, or just spread it about a bit?

It means Stephen and I only need to carry the bulk of the patch for a few days rather than a month or more.

OK, maybe that makes sense then. Linus can do the conversion with a simple sed invocation whenever we're ready.

awesome. another one of my cleanup scripts i can throw away. then i'll be down to ... uh ... lots. :-)

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================

#13 lore raw

Re: [2.6 patch] run all userspace headers through unifdef

In reply to Andrew Morton
Quoted 12 lines · Andrew Morton
Quoted 10 lines · On Thu, 22 May 2008 08:00:12 +0100 David Woodhouse <[email protected]> wrote:
Quoted 8 lines · Andrew Morton

This is going to be a bit of a pain for everyone - people are forever patching those Kbuild files.

Is there a way in which we can do this in stages? Treat header-y in the same manner as unifdef-y, then get all the unifdef-y's switched over to header-y and once that is done, remove the "treat header-y in the same manner as unifdef-y" support?

Quoted 5 lines
Quoted 2 lines

We could. But does that actually reduce the pain, or just spread it about a bit?

It means Stephen and I only need to carry the bulk of the patch for a few days rather than a month or more.

The bulk is the change to include/linux/Kbuild that is more than 50% of my patch.

And that's also where the conflicts will be.

If you care about conflicts let's sneak it into Linus' tree right now - after all my patch touches nothing that could possibly break stuff other then the userspace headers.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed