Skip to contentSkip to conversation

UAPI header file split [ver #2]

PATCH In review David Howells 4 participants 43 messages Jul 8, 2011 – Jul 14, 2011

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

cover UAPI header file split [ver #2]

Here's my first installment of patches to clean up the kernel header files and sort out the recursion problems. The planned steps are:

(1) Split the Userspace API (UAPI) out of the kernel headers into its own header directories.

(2) Move stuff out of the Kernel API (KAPI) headers that can be contained in individual directories as it is referenced by a single file or directory of files.

(3) Make coherent what can be found in commmon arch headers and disintegrate asm/system.h.

(4) Split some headers into definitions containers and inline function containers to clean up recursion problems. The main culprit is very likely to be linux/sched.h, I think.

(5) I'd like to split some headers (e.g. linux/security.h) to reduce the conditional recompilation burden. linux/security.h could have, for instance, struct security_operations split out into a header file private to the stuff in the security/ directory as the wrappers of its function pointers are now out of lined in security/security.c.

(6) Replace the traditional anti-reinclusion guards on header files with three-state anti-recursion guards that abort compilation if recursive inclusion is encountered.

(7) Provide a script to go through and rejig the #includes of each source file to have just the ones that are actually required.

(8) Provide a make target that tests all the KAPI and UAPI headers by simply passing them one at a time to the compiler and attempting to compile them.

==

The patches actually posted here are the manual preparation for the UAPI split in step (1) above. I haven't posted the patches that do the actual splitting by email as the largest of them is in excess of 120,000 lines. However, the patches are available through GIT:

http://git.infradead.org/users/dhowells/linux-headers.git

All the development is on the uapi-split branch. The patches posted here are from the base of that branch up to the uapi-prep tag; the automated split follows thereafter to the uapi-post-split tag.

The scripts used are added to the sources in three patches:

UAPI: Add script to convert #include "..." to #include <path/...> in sys headers
UAPI: Add script to audit drivers/gpu/ for #including system headers with "..."
UAPI: Scripts to disintegrate header files

which are the first, third and last patches posted. They can be deleted later as they shouldn't be needed again - but a record of them will be retained by GIT.

The main aims of the split are:

(1) To simplify the kernel headers by separating the UAPI from the KAPI.

(2) You should be able to simply copy the UAPI directories to userspace with no processing, and they should just work. Unfortunately, it's not quite that simple as some of the UAPI headers behave differently depending on whether __KERNEL__ is defined or not.

(3) To eliminate the need for __KERNEL__. After the split, __KERNEL__ can certainly by unifdef'd from the residual kernel headers - but this isn't quite true of the UAPI headers.

The main restrictions on how I've done the split are:

(1) The GIT history must be maintained in both sides of a split header file.

(2) I don't want to have to alter every #include directive in the kernel sources.

(3) "make allyesconfig" should work after. This is tricky to test as it doesn't necessarily work before.

With this in mind, the way things work is that #include is used for the KAPI header to refer to the UAPI header, with the path prefixed with 'uapi/'. The UAPI header is placed in a subdir of *include/uapi/ that mirrors where the KAPI file is under *include/. For instance:

	include/linux/types.h		-> include/uapi/linux/types.h
	arch/x86/include/asm/unistd.h	-> arch/x86/include/uapi/asm/unistd.h

include/linux/types.h therefore #includes <uapi/linux/types.h>.

The uapi/ directories are also added with -I to the CPP flags after the include/ directories so that if the KAPI file does not exist, the UAPI file will be used directly. This is not as elegant as using #include_next might be, but it does work.

I've created one patch for each include directory that gets exported. I'd prefer to use a single patch per file to make GIT's life easier and more sure, but that would mean a stack of >1100 patches. I think the most important thing from git-blame's point of view is to keep the arch header splits separated by arch as there's a lot of commonality.

I've tested it for x86_64 and MIPS and attempted it for MN10300 (but that runs into other problems). Other arches will need fixing up as necessary.

There are some issues:

(*) I'm not sure I have all the kernel scripts and Makefiles altered correctly
- someone who knows the Kbuild magic should check things over. However, headers do install correctly, so I think I've got things mostly right.

(*) Documentation/vm/page-types.c directly refers to the magic.h file it wants
to include using a path with '..' in it. This is broken from the patch that alters the path until the header is split.

(*) Is uapi/ the right name for the UAPI directories? If not, it shouldn't be
too hard to change as most of it is scripted. It can't be put in usr/ until the UAPI headers don't need any processing, and besides, the arch UAPI headers can't be put under there anyway without collision.

David
---
David Howells (39):
UAPI: Scripts to disintegrate header files
UAPI: Fix the page-types query program in the docs
UAPI: Make UAPI headers install to usr/include/
UAPI: Move linux/version.h
UAPI: Set up uapi/asm/Kbuild.asm
UAPI: Plumb the UAPI Kbuilds into the user header handling system
UAPI: Set up UAPI Kbuild files
UAPI: Add a script to create a commit to set up new UAPI dirs
UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines
UAPI: Fix x86_64 system call count and generation
UAPI: Fix linux/ncp.h
UAPI: Guard linux/sound.h
UAPI: Guard linux/isdn_divertif.h
UAPI: Fix linux/coda.h
UAPI: Fix u_quad_t ordering problem in linux/coda.h
UAPI: Fix SNDRV_*_ENDIAN ordering problem
UAPI: sound/sound_core.c should include linux/fs.h
UAPI: Fix drmP.h to use #include <...> when referring to system header files
UAPI: Fix linux/auto_fs.h inclusion order
UAPI: Fix up linux/netfilter/xt_policy.h
UAPI: Fix linux/input.h inclusion order
UAPI: Fix linux/netfilter.h inclusion order
UAPI: Fix E820_X_MAX ordering problem
UAPI: Fix sigset_t ordering problem
UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace
UAPI: Fix definition of HZ in asm-generic/param.h
UAPI: Remove the inclusion of linux/types.h from x86's asm/page.h
UAPI: Split trivial #if defined(__KERNEL__) && X conditionals
UAPI: Fix nested __KERNEL__ guards in video/edid.h
UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h
UAPI: Make linux/patchkey.h easier to parse
UAPI: ac_etime in linux/acct.h must keep its __KERNEL__ guards
UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed
UAPI: Differentiate userspace build and kernelspace build include path sets
UAPI: Add include/uapi/ directories to build
UAPI: Convert #include "..." to #include <path/...> in kernel system headers
UAPI: Add script to audit drivers/gpu/ for #including system headers with "..."
UAPI: Convert #include "..." to #include <path/...> in kernel system headers
UAPI: Add script to convert #include "..." to #include <path/...> in sys headers

 Documentation/vm/page-types.c                      |    2 
 Makefile                                           |   32 -
 arch/alpha/include/uapi/asm/Kbuild                 |    2 
 arch/arm/include/asm/hwcap.h                       |    4 
 arch/arm/include/asm/localtimer.h                  |    2 
 arch/arm/include/asm/page.h                        |    2 
 arch/arm/include/asm/pgtable.h                     |    2 
 arch/arm/include/asm/swab.h                        |    7 
 arch/arm/include/asm/unistd.h                      |    4 
 arch/arm/include/asm/vfpmacros.h                   |    2 
 arch/arm/include/uapi/asm/Kbuild                   |    2 
 arch/avr32/include/uapi/asm/Kbuild                 |    2 
 arch/blackfin/include/uapi/asm/Kbuild              |    2 
 arch/cris/include/arch-v10/arch/sv_addr_ag.h       |    2 
 arch/cris/include/arch-v10/arch/svinto.h           |    2 
 arch/cris/include/arch-v32/arch/dma.h              |    2 
 arch/cris/include/arch-v32/arch/hwregs/dma.h       |    2 
 arch/cris/include/uapi/arch-v10/arch/Kbuild        |    0 
 arch/cris/include/uapi/arch-v32/arch/Kbuild        |    0 
 arch/cris/include/uapi/asm/Kbuild                  |    4 
 arch/frv/include/uapi/asm/Kbuild                   |    2 
 arch/h8300/include/uapi/asm/Kbuild                 |    2 
 arch/ia64/include/asm/intrinsics.h                 |   21 
 arch/ia64/include/uapi/asm/Kbuild                  |    2 
 arch/m32r/include/uapi/asm/Kbuild                  |    2 
 arch/m68k/include/asm/bitops.h                     |    4 
 arch/m68k/include/asm/cacheflush.h                 |    4 
 arch/m68k/include/asm/delay.h                      |    4 
 arch/m68k/include/asm/entry.h                      |    4 
 arch/m68k/include/asm/hardirq.h                    |    4 
 arch/m68k/include/asm/io.h                         |    4 
 arch/m68k/include/asm/m68360.h                     |    8 
 arch/m68k/include/asm/m68360_enet.h                |    2 
 arch/m68k/include/asm/page.h                       |    4 
 arch/m68k/include/asm/pgtable.h                    |    4 
 arch/m68k/include/asm/q40_master.h                 |    2 
 arch/m68k/include/asm/system.h                     |    4 
 arch/m68k/include/asm/uaccess.h                    |    4 
 arch/m68k/include/uapi/asm/Kbuild                  |    2 
 arch/microblaze/include/asm/mmu_context.h          |    2 
 arch/microblaze/include/uapi/asm/Kbuild            |    2 
 arch/mips/include/asm/Kbuild                       |    4 
 arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h    |    2 
 arch/mips/include/asm/mach-pnx833x/gpio.h          |    2 
 arch/mips/include/asm/octeon/cvmx-asm.h            |    2 
 arch/mips/include/asm/octeon/cvmx-spinlock.h       |    2 
 arch/mips/include/asm/octeon/cvmx.h                |   36 -
 arch/mips/include/asm/octeon/octeon-model.h        |    2 
 arch/mips/include/asm/octeon/octeon.h              |    2 
 arch/mips/include/asm/sibyte/bcm1480_int.h         |    2 
 arch/mips/include/asm/sibyte/bcm1480_l2c.h         |    2 
 arch/mips/include/asm/sibyte/bcm1480_mc.h          |    2 
 arch/mips/include/asm/sibyte/bcm1480_regs.h        |    4 
 arch/mips/include/asm/sibyte/bcm1480_scd.h         |    4 
 arch/mips/include/asm/sibyte/sb1250_dma.h          |    2 
 arch/mips/include/asm/sibyte/sb1250_genbus.h       |    2 
 arch/mips/include/asm/sibyte/sb1250_int.h          |    2 
 arch/mips/include/asm/sibyte/sb1250_l2c.h          |    2 
 arch/mips/include/asm/sibyte/sb1250_ldt.h          |    2 
 arch/mips/include/asm/sibyte/sb1250_mac.h          |    2 
 arch/mips/include/asm/sibyte/sb1250_mc.h           |    2 
 arch/mips/include/asm/sibyte/sb1250_regs.h         |    2 
 arch/mips/include/asm/sibyte/sb1250_scd.h          |    2 
 arch/mips/include/asm/sibyte/sb1250_smbus.h        |    2 
 arch/mips/include/asm/sibyte/sb1250_syncser.h      |    2 
 arch/mips/include/asm/sibyte/sb1250_uart.h         |    2 
 arch/mips/include/asm/types.h                      |   10 
 arch/mips/include/uapi/asm/Kbuild                  |    2 
 arch/mn10300/include/uapi/asm/Kbuild               |    2 
 arch/parisc/include/uapi/asm/Kbuild                |    2 
 arch/powerpc/include/asm/ps3.h                     |    2 
 arch/powerpc/include/asm/ucc_fast.h                |    2 
 arch/powerpc/include/asm/ucc_slow.h                |    2 
 arch/powerpc/include/uapi/asm/Kbuild               |    2 
 arch/s390/include/asm/mman.h                       |    4 
 arch/s390/include/uapi/asm/Kbuild                  |    2 
 arch/score/include/uapi/asm/Kbuild                 |    2 
 arch/sh/include/asm/checksum.h                     |    2 
 arch/sh/include/asm/mmu_context.h                  |    4 
 arch/sh/include/asm/posix_types.h                  |    8 
 arch/sh/include/asm/processor.h                    |    4 
 arch/sh/include/asm/ptrace.h                       |    4 
 arch/sh/include/asm/string.h                       |    4 
 arch/sh/include/asm/syscall.h                      |    4 
 arch/sh/include/asm/syscalls.h                     |    4 
 arch/sh/include/asm/system.h                       |    4 
 arch/sh/include/asm/tlb.h                          |    2 
 arch/sh/include/asm/uaccess.h                      |    4 
 arch/sh/include/asm/unistd.h                       |    8 
 arch/sh/include/mach-ecovec24/mach/romimage.h      |    2 
 arch/sh/include/mach-kfr2r09/mach/romimage.h       |    2 
 arch/sh/include/uapi/asm/Kbuild                    |    2 
 arch/sparc/include/uapi/asm/Kbuild                 |    4 
 arch/tile/include/asm/signal.h                     |    4 
 arch/tile/include/uapi/asm/Kbuild                  |    2 
 arch/unicore32/include/mach/PKUnity.h              |   36 -
 arch/unicore32/include/mach/hardware.h             |    2 
 arch/unicore32/include/mach/uncompress.h           |    4 
 arch/unicore32/include/uapi/asm/Kbuild             |    2 
 arch/x86/boot/Makefile                             |    4 
 arch/x86/boot/mkcpustr.c                           |    2 
 arch/x86/include/asm/atomic.h                      |    4 
 arch/x86/include/asm/checksum.h                    |    4 
 arch/x86/include/asm/cmpxchg.h                     |    4 
 arch/x86/include/asm/cpufeature.h                  |    2 
 arch/x86/include/asm/e820.h                        |    2 
 arch/x86/include/asm/mmzone.h                      |    4 
 arch/x86/include/asm/mutex.h                       |    4 
 arch/x86/include/asm/numa.h                        |    4 
 arch/x86/include/asm/page.h                        |    2 
 arch/x86/include/asm/page_types.h                  |    3 
 arch/x86/include/asm/pci.h                         |    2 
 arch/x86/include/asm/pgtable.h                     |    4 
 arch/x86/include/asm/pgtable_types.h               |    4 
 arch/x86/include/asm/posix_types.h                 |    8 
 arch/x86/include/asm/seccomp.h                     |    4 
 arch/x86/include/asm/signal.h                      |    2 
 arch/x86/include/asm/string.h                      |    4 
 arch/x86/include/asm/suspend.h                     |    4 
 arch/x86/include/asm/uaccess.h                     |    4 
 arch/x86/include/asm/unistd.h                      |    8 
 arch/x86/include/asm/user.h                        |    4 
 arch/x86/include/asm/xen/interface.h               |    4 
 arch/x86/include/asm/xor.h                         |    4 
 arch/x86/include/uapi/asm/Kbuild                   |    2 
 arch/x86/kernel/asm-offsets_64.c                   |    1 
 arch/x86/kernel/cpu/mkcapflags.pl                  |    5 
 arch/x86/kernel/syscall_64.c                       |    2 
 arch/xtensa/include/uapi/asm/Kbuild                |    2 
 drivers/gpu/drm/ati_pcigart.c                      |    2 
 drivers/gpu/drm/drm_agpsupport.c                   |    2 
 drivers/gpu/drm/drm_auth.c                         |    2 
 drivers/gpu/drm/drm_buffer.c                       |    2 
 drivers/gpu/drm/drm_bufs.c                         |    2 
 drivers/gpu/drm/drm_cache.c                        |    2 
 drivers/gpu/drm/drm_context.c                      |    2 
 drivers/gpu/drm/drm_crtc.c                         |    8 
 drivers/gpu/drm/drm_crtc_helper.c                  |    8 
 drivers/gpu/drm/drm_debugfs.c                      |    2 
 drivers/gpu/drm/drm_dma.c                          |    2 
 drivers/gpu/drm/drm_dp_i2c_helper.c                |    4 
 drivers/gpu/drm/drm_drv.c                          |    4 
 drivers/gpu/drm/drm_edid.c                         |    4 
 drivers/gpu/drm/drm_edid_modes.h                   |    4 
 drivers/gpu/drm/drm_encoder_slave.c                |    2 
 drivers/gpu/drm/drm_fb_helper.c                    |    8 
 drivers/gpu/drm/drm_fops.c                         |    2 
 drivers/gpu/drm/drm_gem.c                          |    2 
 drivers/gpu/drm/drm_global.c                       |    2 
 drivers/gpu/drm/drm_hashtab.c                      |    4 
 drivers/gpu/drm/drm_info.c                         |    2 
 drivers/gpu/drm/drm_ioc32.c                        |    4 
 drivers/gpu/drm/drm_ioctl.c                        |    6 
 drivers/gpu/drm/drm_irq.c                          |    2 
 drivers/gpu/drm/drm_lock.c                         |    2 
 drivers/gpu/drm/drm_memory.c                       |    2 
 drivers/gpu/drm/drm_mm.c                           |    4 
 drivers/gpu/drm/drm_modes.c                        |    6 
 drivers/gpu/drm/drm_pci.c                          |    2 
 drivers/gpu/drm/drm_platform.c                     |    2 
 drivers/gpu/drm/drm_proc.c                         |    2 
 drivers/gpu/drm/drm_scatter.c                      |    2 
 drivers/gpu/drm/drm_sman.c                         |    2 
 drivers/gpu/drm/drm_stub.c                         |    4 
 drivers/gpu/drm/drm_sysfs.c                        |    6 
 drivers/gpu/drm/drm_trace_points.c                 |    2 
 drivers/gpu/drm/drm_usb.c                          |    2 
 drivers/gpu/drm/drm_vm.c                           |    2 
 drivers/gpu/drm/i2c/ch7006_priv.h                  |    8 
 drivers/gpu/drm/i2c/sil164_drv.c                   |    8 
 drivers/gpu/drm/i810/i810_dma.c                    |    6 
 drivers/gpu/drm/i810/i810_drv.c                    |    8 
 drivers/gpu/drm/i915/dvo.h                         |    6 
 drivers/gpu/drm/i915/i915_debugfs.c                |    6 
 drivers/gpu/drm/i915/i915_dma.c                    |   10 
 drivers/gpu/drm/i915/i915_drv.c                    |    8 
 drivers/gpu/drm/i915/i915_gem.c                    |    6 
 drivers/gpu/drm/i915/i915_gem_debug.c              |    6 
 drivers/gpu/drm/i915/i915_gem_evict.c              |    6 
 drivers/gpu/drm/i915/i915_gem_execbuffer.c         |    6 
 drivers/gpu/drm/i915/i915_gem_gtt.c                |    6 
 drivers/gpu/drm/i915/i915_gem_tiling.c             |   10 
 drivers/gpu/drm/i915/i915_ioc32.c                  |    6 
 drivers/gpu/drm/i915/i915_irq.c                    |    6 
 drivers/gpu/drm/i915/i915_mem.c                    |    6 
 drivers/gpu/drm/i915/i915_suspend.c                |    6 
 drivers/gpu/drm/i915/intel_acpi.c                  |    2 
 drivers/gpu/drm/i915/intel_bios.c                  |    6 
 drivers/gpu/drm/i915/intel_bios.h                  |    2 
 drivers/gpu/drm/i915/intel_crt.c                   |   12 
 drivers/gpu/drm/i915/intel_display.c               |    8 
 drivers/gpu/drm/i915/intel_dp.c                    |   12 
 drivers/gpu/drm/i915/intel_drv.h                   |    6 
 drivers/gpu/drm/i915/intel_dvo.c                   |    8 
 drivers/gpu/drm/i915/intel_fb.c                    |   10 
 drivers/gpu/drm/i915/intel_hdmi.c                  |   10 
 drivers/gpu/drm/i915/intel_i2c.c                   |    6 
 drivers/gpu/drm/i915/intel_lvds.c                  |   10 
 drivers/gpu/drm/i915/intel_modes.c                 |    2 
 drivers/gpu/drm/i915/intel_opregion.c              |    4 
 drivers/gpu/drm/i915/intel_overlay.c               |    6 
 drivers/gpu/drm/i915/intel_ringbuffer.c            |    6 
 drivers/gpu/drm/i915/intel_sdvo.c                  |   10 
 drivers/gpu/drm/i915/intel_tv.c                    |   10 
 drivers/gpu/drm/mga/mga_dma.c                      |    8 
 drivers/gpu/drm/mga/mga_drv.c                      |    8 
 drivers/gpu/drm/mga/mga_ioc32.c                    |    6 
 drivers/gpu/drm/mga/mga_irq.c                      |    6 
 drivers/gpu/drm/mga/mga_state.c                    |    6 
 drivers/gpu/drm/mga/mga_warp.c                     |    6 
 drivers/gpu/drm/nouveau/nouveau_acpi.c             |   10 
 drivers/gpu/drm/nouveau/nouveau_backlight.c        |    4 
 drivers/gpu/drm/nouveau/nouveau_bios.c             |    2 
 drivers/gpu/drm/nouveau/nouveau_bo.c               |    4 
 drivers/gpu/drm/nouveau/nouveau_calc.c             |    2 
 drivers/gpu/drm/nouveau/nouveau_channel.c          |    6 
 drivers/gpu/drm/nouveau/nouveau_connector.c        |    6 
 drivers/gpu/drm/nouveau/nouveau_connector.h        |    2 
 drivers/gpu/drm/nouveau/nouveau_debugfs.c          |    2 
 drivers/gpu/drm/nouveau/nouveau_display.c          |    4 
 drivers/gpu/drm/nouveau/nouveau_dma.c              |    4 
 drivers/gpu/drm/nouveau/nouveau_dp.c               |    2 
 drivers/gpu/drm/nouveau/nouveau_drv.c              |    8 
 drivers/gpu/drm/nouveau/nouveau_drv.h              |   12 
 drivers/gpu/drm/nouveau/nouveau_encoder.h          |    2 
 drivers/gpu/drm/nouveau/nouveau_fbcon.c            |   12 
 drivers/gpu/drm/nouveau/nouveau_fbcon.h            |    2 
 drivers/gpu/drm/nouveau/nouveau_fence.c            |    4 
 drivers/gpu/drm/nouveau/nouveau_gem.c              |    6 
 drivers/gpu/drm/nouveau/nouveau_hw.c               |    2 
 drivers/gpu/drm/nouveau/nouveau_hw.h               |    2 
 drivers/gpu/drm/nouveau/nouveau_i2c.c              |    2 
 drivers/gpu/drm/nouveau/nouveau_i2c.h              |    2 
 drivers/gpu/drm/nouveau/nouveau_ioc32.c            |    4 
 drivers/gpu/drm/nouveau/nouveau_irq.c              |    6 
 drivers/gpu/drm/nouveau/nouveau_mem.c              |    6 
 drivers/gpu/drm/nouveau/nouveau_mm.c               |    2 
 drivers/gpu/drm/nouveau/nouveau_notifier.c         |    4 
 drivers/gpu/drm/nouveau/nouveau_object.c           |    6 
 drivers/gpu/drm/nouveau/nouveau_perf.c             |    2 
 drivers/gpu/drm/nouveau/nouveau_pm.c               |    2 
 drivers/gpu/drm/nouveau/nouveau_ramht.c            |    2 
 drivers/gpu/drm/nouveau/nouveau_sgdma.c            |    2 
 drivers/gpu/drm/nouveau/nouveau_state.c            |   10 
 drivers/gpu/drm/nouveau/nouveau_temp.c             |    2 
 drivers/gpu/drm/nouveau/nouveau_ttm.c              |    2 
 drivers/gpu/drm/nouveau/nouveau_vm.c               |    2 
 drivers/gpu/drm/nouveau/nouveau_vm.h               |    2 
 drivers/gpu/drm/nouveau/nouveau_volt.c             |    2 
 drivers/gpu/drm/nouveau/nv04_crtc.c                |    4 
 drivers/gpu/drm/nouveau/nv04_cursor.c              |    4 
 drivers/gpu/drm/nouveau/nv04_dac.c                 |    4 
 drivers/gpu/drm/nouveau/nv04_dfp.c                 |    6 
 drivers/gpu/drm/nouveau/nv04_display.c             |    6 
 drivers/gpu/drm/nouveau/nv04_fb.c                  |    6 
 drivers/gpu/drm/nouveau/nv04_fbcon.c               |    2 
 drivers/gpu/drm/nouveau/nv04_fifo.c                |    4 
 drivers/gpu/drm/nouveau/nv04_graph.c               |    6 
 drivers/gpu/drm/nouveau/nv04_instmem.c             |    4 
 drivers/gpu/drm/nouveau/nv04_mc.c                  |    6 
 drivers/gpu/drm/nouveau/nv04_pm.c                  |    2 
 drivers/gpu/drm/nouveau/nv04_timer.c               |    6 
 drivers/gpu/drm/nouveau/nv04_tv.c                  |    6 
 drivers/gpu/drm/nouveau/nv10_fb.c                  |    6 
 drivers/gpu/drm/nouveau/nv10_fifo.c                |    4 
 drivers/gpu/drm/nouveau/nv10_gpio.c                |    2 
 drivers/gpu/drm/nouveau/nv10_graph.c               |    6 
 drivers/gpu/drm/nouveau/nv17_tv.c                  |    4 
 drivers/gpu/drm/nouveau/nv17_tv_modes.c            |    4 
 drivers/gpu/drm/nouveau/nv20_graph.c               |    6 
 drivers/gpu/drm/nouveau/nv30_fb.c                  |    6 
 drivers/gpu/drm/nouveau/nv40_fb.c                  |    6 
 drivers/gpu/drm/nouveau/nv40_fifo.c                |    4 
 drivers/gpu/drm/nouveau/nv40_graph.c               |    4 
 drivers/gpu/drm/nouveau/nv40_grctx.c               |    2 
 drivers/gpu/drm/nouveau/nv40_mc.c                  |    6 
 drivers/gpu/drm/nouveau/nv40_mpeg.c                |    2 
 drivers/gpu/drm/nouveau/nv50_calc.c                |    2 
 drivers/gpu/drm/nouveau/nv50_crtc.c                |    6 
 drivers/gpu/drm/nouveau/nv50_cursor.c              |    4 
 drivers/gpu/drm/nouveau/nv50_dac.c                 |    4 
 drivers/gpu/drm/nouveau/nv50_display.c             |    2 
 drivers/gpu/drm/nouveau/nv50_display.h             |    4 
 drivers/gpu/drm/nouveau/nv50_evo.c                 |    2 
 drivers/gpu/drm/nouveau/nv50_fb.c                  |    6 
 drivers/gpu/drm/nouveau/nv50_fbcon.c               |    2 
 drivers/gpu/drm/nouveau/nv50_fifo.c                |    4 
 drivers/gpu/drm/nouveau/nv50_gpio.c                |    2 
 drivers/gpu/drm/nouveau/nv50_graph.c               |    4 
 drivers/gpu/drm/nouveau/nv50_grctx.c               |    2 
 drivers/gpu/drm/nouveau/nv50_instmem.c             |    4 
 drivers/gpu/drm/nouveau/nv50_mc.c                  |    4 
 drivers/gpu/drm/nouveau/nv50_mpeg.c                |    2 
 drivers/gpu/drm/nouveau/nv50_pm.c                  |    2 
 drivers/gpu/drm/nouveau/nv50_sor.c                 |    4 
 drivers/gpu/drm/nouveau/nv50_vm.c                  |    2 
 drivers/gpu/drm/nouveau/nv50_vram.c                |    2 
 drivers/gpu/drm/nouveau/nv84_crypt.c               |    2 
 drivers/gpu/drm/nouveau/nva3_copy.c                |    2 
 drivers/gpu/drm/nouveau/nva3_pm.c                  |    2 
 drivers/gpu/drm/nouveau/nvc0_copy.c                |    2 
 drivers/gpu/drm/nouveau/nvc0_fb.c                  |    2 
 drivers/gpu/drm/nouveau/nvc0_fbcon.c               |    2 
 drivers/gpu/drm/nouveau/nvc0_fifo.c                |    2 
 drivers/gpu/drm/nouveau/nvc0_graph.c               |    2 
 drivers/gpu/drm/nouveau/nvc0_grctx.c               |    2 
 drivers/gpu/drm/nouveau/nvc0_instmem.c             |    2 
 drivers/gpu/drm/nouveau/nvc0_vm.c                  |    2 
 drivers/gpu/drm/nouveau/nvc0_vram.c                |    2 
 drivers/gpu/drm/r128/r128_cce.c                    |    6 
 drivers/gpu/drm/r128/r128_drv.c                    |    8 
 drivers/gpu/drm/r128/r128_ioc32.c                  |    6 
 drivers/gpu/drm/r128/r128_irq.c                    |    6 
 drivers/gpu/drm/r128/r128_state.c                  |    6 
 drivers/gpu/drm/radeon/atom.h                      |    2 
 drivers/gpu/drm/radeon/atombios_dp.c               |    6 
 drivers/gpu/drm/radeon/evergreen.c                 |    4 
 drivers/gpu/drm/radeon/evergreen_blit_kms.c        |    6 
 drivers/gpu/drm/radeon/evergreen_cs.c              |    2 
 drivers/gpu/drm/radeon/ni.c                        |    4 
 drivers/gpu/drm/radeon/r100.c                      |    6 
 drivers/gpu/drm/radeon/r200.c                      |    6 
 drivers/gpu/drm/radeon/r300.c                      |    2 
 drivers/gpu/drm/radeon/r300_cmdbuf.c               |    8 
 drivers/gpu/drm/radeon/r420.c                      |    2 
 drivers/gpu/drm/radeon/r520.c                      |    2 
 drivers/gpu/drm/radeon/r600.c                      |    4 
 drivers/gpu/drm/radeon/r600_audio.c                |    2 
 drivers/gpu/drm/radeon/r600_blit.c                 |    6 
 drivers/gpu/drm/radeon/r600_blit_kms.c             |    6 
 drivers/gpu/drm/radeon/r600_cp.c                   |    6 
 drivers/gpu/drm/radeon/r600_cs.c                   |    2 
 drivers/gpu/drm/radeon/r600_hdmi.c                 |    4 
 drivers/gpu/drm/radeon/radeon_acpi.c               |    8 
 drivers/gpu/drm/radeon/radeon_agp.c                |    6 
 drivers/gpu/drm/radeon/radeon_atombios.c           |    4 
 drivers/gpu/drm/radeon/radeon_bios.c               |    2 
 drivers/gpu/drm/radeon/radeon_clocks.c             |    4 
 drivers/gpu/drm/radeon/radeon_combios.c            |    4 
 drivers/gpu/drm/radeon/radeon_connectors.c         |   10 
 drivers/gpu/drm/radeon/radeon_cp.c                 |    8 
 drivers/gpu/drm/radeon/radeon_cs.c                 |    4 
 drivers/gpu/drm/radeon/radeon_cursor.c             |    4 
 drivers/gpu/drm/radeon/radeon_display.c            |    8 
 drivers/gpu/drm/radeon/radeon_drv.c                |    8 
 drivers/gpu/drm/radeon/radeon_encoders.c           |    6 
 drivers/gpu/drm/radeon/radeon_fb.c                 |   12 
 drivers/gpu/drm/radeon/radeon_fence.c              |    4 
 drivers/gpu/drm/radeon/radeon_gart.c               |    4 
 drivers/gpu/drm/radeon/radeon_gem.c                |    6 
 drivers/gpu/drm/radeon/radeon_i2c.c                |    4 
 drivers/gpu/drm/radeon/radeon_ioc32.c              |    6 
 drivers/gpu/drm/radeon/radeon_irq.c                |    6 
 drivers/gpu/drm/radeon/radeon_irq_kms.c            |    6 
 drivers/gpu/drm/radeon/radeon_kms.c                |    6 
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c    |    6 
 drivers/gpu/drm/radeon/radeon_legacy_tv.c          |    4 
 drivers/gpu/drm/radeon/radeon_mem.c                |    6 
 drivers/gpu/drm/radeon/radeon_object.c             |    2 
 drivers/gpu/drm/radeon/radeon_pm.c                 |    2 
 drivers/gpu/drm/radeon/radeon_ring.c               |    4 
 drivers/gpu/drm/radeon/radeon_state.c              |   10 
 drivers/gpu/drm/radeon/radeon_trace_points.c       |    2 
 drivers/gpu/drm/radeon/rs600.c                     |    2 
 drivers/gpu/drm/radeon/rs690.c                     |    2 
 drivers/gpu/drm/radeon/rv515.c                     |    2 
 drivers/gpu/drm/radeon/rv770.c                     |    4 
 drivers/gpu/drm/savage/savage_bci.c                |    4 
 drivers/gpu/drm/savage/savage_drv.c                |    6 
 drivers/gpu/drm/savage/savage_state.c              |    4 
 drivers/gpu/drm/sis/sis_drv.c                      |    6 
 drivers/gpu/drm/sis/sis_drv.h                      |    2 
 drivers/gpu/drm/sis/sis_mm.c                       |    4 
 drivers/gpu/drm/tdfx/tdfx_drv.c                    |    4 
 drivers/gpu/drm/ttm/ttm_agp_backend.c              |    6 
 drivers/gpu/drm/ttm/ttm_bo.c                       |    6 
 drivers/gpu/drm/ttm/ttm_bo_manager.c               |    8 
 drivers/gpu/drm/ttm/ttm_bo_util.c                  |    4 
 drivers/gpu/drm/ttm/ttm_execbuf_util.c             |    6 
 drivers/gpu/drm/ttm/ttm_lock.c                     |    4 
 drivers/gpu/drm/ttm/ttm_memory.c                   |    6 
 drivers/gpu/drm/ttm/ttm_module.c                   |    4 
 drivers/gpu/drm/ttm/ttm_object.c                   |    4 
 drivers/gpu/drm/ttm/ttm_page_alloc.c               |    4 
 drivers/gpu/drm/ttm/ttm_tt.c                       |   12 
 drivers/gpu/drm/via/via_dma.c                      |    6 
 drivers/gpu/drm/via/via_dmablit.c                  |    4 
 drivers/gpu/drm/via/via_drv.c                      |    6 
 drivers/gpu/drm/via/via_drv.h                      |    2 
 drivers/gpu/drm/via/via_irq.c                      |    6 
 drivers/gpu/drm/via/via_map.c                      |    4 
 drivers/gpu/drm/via/via_mm.c                       |    6 
 drivers/gpu/drm/via/via_verifier.c                 |    6 
 drivers/gpu/drm/via/via_video.c                    |    4 
 drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c             |    4 
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c                |   10 
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h                |   18 
 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c            |    4 
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c                 |    4 
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c               |    4 
 drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c                |    4 
 drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c      |    6 
 drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c              |    2 
 drivers/gpu/drm/vmwgfx/vmwgfx_irq.c                |    2 
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.h                |    2 
 drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c            |    4 
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c           |    8 
 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c           |    2 
 include/acpi/acpi.h                                |   18 
 include/acpi/acpiosxf.h                            |    4 
 include/acpi/acpixf.h                              |    4 
 include/acpi/platform/acenv.h                      |    2 
 include/acpi/platform/aclinux.h                    |    2 
 include/asm-generic/Kbuild.asm                     |   85 +-
 include/asm-generic/param.h                        |   13 
 include/drm/drm.h                                  |    2 
 include/drm/drmP.h                                 |   18 
 include/drm/drm_buffer.h                           |    2 
 include/drm/drm_encoder_slave.h                    |    4 
 include/drm/drm_memory.h                           |    2 
 include/drm/drm_sarea.h                            |    2 
 include/drm/drm_sman.h                             |    4 
 include/drm/i915_drm.h                             |    2 
 include/drm/mga_drm.h                              |    2 
 include/drm/radeon_drm.h                           |    2 
 include/drm/ttm/ttm_bo_api.h                       |    2 
 include/drm/ttm/ttm_bo_driver.h                    |   16 
 include/drm/ttm/ttm_execbuf_util.h                 |    2 
 include/drm/ttm/ttm_lock.h                         |    2 
 include/drm/ttm/ttm_object.h                       |    2 
 include/drm/ttm/ttm_page_alloc.h                   |    4 
 include/drm/via_drm.h                              |    2 
 include/linux/Kbuild                               |    1 
 include/linux/acct.h                               |    5 
 include/linux/auto_fs.h                            |    2 
 include/linux/bcma/bcma.h                          |    2 
 include/linux/ceph/ceph_fs.h                       |    4 
 include/linux/ceph/debugfs.h                       |    4 
 include/linux/ceph/decode.h                        |    2 
 include/linux/ceph/libceph.h                       |   14 
 include/linux/ceph/mdsmap.h                        |    2 
 include/linux/ceph/messenger.h                     |    4 
 include/linux/ceph/mon_client.h                    |    2 
 include/linux/ceph/msgpool.h                       |    2 
 include/linux/ceph/osd_client.h                    |    6 
 include/linux/ceph/osdmap.h                        |    4 
 include/linux/ceph/rados.h                         |    2 
 include/linux/ceph/types.h                         |    6 
 include/linux/coda.h                               |    3 
 include/linux/crush/mapper.h                       |    2 
 include/linux/drbd_tag_magic.h                     |   10 
 include/linux/elf.h                                |   18 
 include/linux/input.h                              |    2 
 include/linux/isdn_divertif.h                      |    4 
 include/linux/mroute6.h                            |    4 
 include/linux/ncp.h                                |    2 
 include/linux/netfilter.h                          |    2 
 include/linux/netfilter/nf_conntrack_h323_asn1.h   |    2 
 include/linux/netfilter/xt_policy.h                |    2 
 include/linux/patchkey.h                           |    4 
 include/linux/sound.h                              |    4 
 include/linux/soundcard.h                          |    4 
 include/scsi/osd_attributes.h                      |    2 
 include/scsi/osd_initiator.h                       |    4 
 include/scsi/osd_sec.h                             |    4 
 include/sound/ac97_codec.h                         |    6 
 include/sound/ad1816a.h                            |    6 
 include/sound/ak4531_codec.h                       |    4 
 include/sound/asound.h                             |    1 
 include/sound/cs46xx.h                             |   10 
 include/sound/cs46xx_dsp_spos.h                    |    4 
 include/sound/cs46xx_dsp_task_types.h              |    2 
 include/sound/emu10k1_synth.h                      |    4 
 include/sound/emu8000.h                            |    4 
 include/sound/emux_legacy.h                        |    2 
 include/sound/emux_synth.h                         |   14 
 include/sound/es1688.h                             |    4 
 include/sound/gus.h                                |   10 
 include/sound/mpu401.h                             |    2 
 include/sound/pcm.h                                |    2 
 include/sound/rawmidi.h                            |    2 
 include/sound/sb.h                                 |    4 
 include/sound/sb16_csp.h                           |    4 
 include/sound/seq_kernel.h                         |    2 
 include/sound/seq_midi_emul.h                      |    2 
 include/sound/seq_midi_event.h                     |    2 
 include/sound/seq_oss.h                            |    4 
 include/sound/seq_virmidi.h                        |    4 
 include/sound/snd_wavefront.h                      |    8 
 include/sound/soundfont.h                          |    4 
 include/sound/tea6330t.h                           |    2 
 include/sound/trident.h                            |    8 
 include/sound/wss.h                                |    8 
 include/sound/ymfpci.h                             |    8 
 include/trace/events/compaction.h                  |    2 
 include/trace/events/kmem.h                        |    2 
 include/trace/events/vmscan.h                      |    2 
 include/uapi/Kbuild                                |   13 
 include/uapi/asm-generic/Kbuild                    |    0 
 include/uapi/asm-generic/Kbuild.asm                |   44 +
 include/uapi/drm/Kbuild                            |    0 
 include/uapi/linux/Kbuild                          |   17 
 include/uapi/linux/byteorder/Kbuild                |    0 
 include/uapi/linux/caif/Kbuild                     |    0 
 include/uapi/linux/can/Kbuild                      |    0 
 include/uapi/linux/dvb/Kbuild                      |    0 
 include/uapi/linux/hdlc/Kbuild                     |    0 
 include/uapi/linux/isdn/Kbuild                     |    0 
 include/uapi/linux/mmc/Kbuild                      |    0 
 include/uapi/linux/netfilter/Kbuild                |    1 
 include/uapi/linux/netfilter/ipset/Kbuild          |    0 
 include/uapi/linux/netfilter_arp/Kbuild            |    0 
 include/uapi/linux/netfilter_bridge/Kbuild         |    0 
 include/uapi/linux/netfilter_ipv4/Kbuild           |    0 
 include/uapi/linux/netfilter_ipv6/Kbuild           |    0 
 include/uapi/linux/nfsd/Kbuild                     |    0 
 include/uapi/linux/raid/Kbuild                     |    0 
 include/uapi/linux/spi/Kbuild                      |    0 
 include/uapi/linux/sunrpc/Kbuild                   |    0 
 include/uapi/linux/tc_act/Kbuild                   |    0 
 include/uapi/linux/tc_ematch/Kbuild                |    0 
 include/uapi/linux/usb/Kbuild                      |    0 
 include/uapi/linux/wimax/Kbuild                    |    0 
 include/uapi/mtd/Kbuild                            |    0 
 include/uapi/rdma/Kbuild                           |    0 
 include/uapi/scsi/Kbuild                           |    1 
 include/uapi/scsi/fc/Kbuild                        |    0 
 include/uapi/sound/Kbuild                          |    0 
 include/uapi/video/Kbuild                          |    0 
 include/uapi/xen/Kbuild                            |    0 
 include/video/edid.h                               |    6 
 include/xen/interface/callback.h                   |    2 
 include/xen/interface/hvm/params.h                 |    2 
 include/xen/interface/io/blkif.h                   |    4 
 include/xen/interface/io/netif.h                   |    4 
 include/xen/interface/sched.h                      |    2 
 include/xen/interface/version.h                    |    2 
 scripts/uapi-disintegration/disintegrate-1-stg.sh  |   53 +
 .../uapi-disintegration/disintegrate-many-stg.sh   |   63 +
 scripts/uapi-disintegration/disintegrate-one.pl    | 1036 ++++++++++++++++++++
 .../disintegrate-to-git-by-dir.pl                  |   69 +
 scripts/uapi-disintegration/disintegrate-to-git.pl |   70 +
 .../disintegrate-to-stg-by-dir.pl                  |   85 ++
 scripts/uapi-disintegration/drm-headers.pl         |  105 ++
 scripts/uapi-disintegration/genlist.pl             |   79 ++
 scripts/uapi-disintegration/set-up-Kbuild.pl       |  108 ++
 scripts/uapi-disintegration/sound-headers.pl       |   75 +
 scripts/uapi-disintegration/system-headers.pl      |  167 +++
 sound/sound_core.c                                 |    1 
 549 files changed, 3201 insertions(+), 1081 deletions(-)
 create mode 100644 arch/alpha/include/uapi/asm/Kbuild
 create mode 100644 arch/arm/include/uapi/asm/Kbuild
 create mode 100644 arch/avr32/include/uapi/asm/Kbuild
 create mode 100644 arch/blackfin/include/uapi/asm/Kbuild
 create mode 100644 arch/cris/include/uapi/arch-v10/arch/Kbuild
 create mode 100644 arch/cris/include/uapi/arch-v32/arch/Kbuild
 create mode 100644 arch/cris/include/uapi/asm/Kbuild
 create mode 100644 arch/frv/include/uapi/asm/Kbuild
 create mode 100644 arch/h8300/include/uapi/asm/Kbuild
 create mode 100644 arch/ia64/include/uapi/asm/Kbuild
 create mode 100644 arch/m32r/include/uapi/asm/Kbuild
 create mode 100644 arch/m68k/include/uapi/asm/Kbuild
 create mode 100644 arch/microblaze/include/uapi/asm/Kbuild
 create mode 100644 arch/mips/include/uapi/asm/Kbuild
 create mode 100644 arch/mn10300/include/uapi/asm/Kbuild
 create mode 100644 arch/parisc/include/uapi/asm/Kbuild
 create mode 100644 arch/powerpc/include/uapi/asm/Kbuild
 create mode 100644 arch/s390/include/uapi/asm/Kbuild
 create mode 100644 arch/score/include/uapi/asm/Kbuild
 create mode 100644 arch/sh/include/uapi/asm/Kbuild
 create mode 100644 arch/sparc/include/uapi/asm/Kbuild
 create mode 100644 arch/tile/include/uapi/asm/Kbuild
 create mode 100644 arch/unicore32/include/uapi/asm/Kbuild
 create mode 100644 arch/x86/include/uapi/asm/Kbuild
 create mode 100644 arch/xtensa/include/uapi/asm/Kbuild
 create mode 100644 include/uapi/Kbuild
 create mode 100644 include/uapi/asm-generic/Kbuild
 create mode 100644 include/uapi/asm-generic/Kbuild.asm
 create mode 100644 include/uapi/drm/Kbuild
 create mode 100644 include/uapi/linux/Kbuild
 create mode 100644 include/uapi/linux/byteorder/Kbuild
 create mode 100644 include/uapi/linux/caif/Kbuild
 create mode 100644 include/uapi/linux/can/Kbuild
 create mode 100644 include/uapi/linux/dvb/Kbuild
 create mode 100644 include/uapi/linux/hdlc/Kbuild
 create mode 100644 include/uapi/linux/isdn/Kbuild
 create mode 100644 include/uapi/linux/mmc/Kbuild
 create mode 100644 include/uapi/linux/netfilter/Kbuild
 create mode 100644 include/uapi/linux/netfilter/ipset/Kbuild
 create mode 100644 include/uapi/linux/netfilter_arp/Kbuild
 create mode 100644 include/uapi/linux/netfilter_bridge/Kbuild
 create mode 100644 include/uapi/linux/netfilter_ipv4/Kbuild
 create mode 100644 include/uapi/linux/netfilter_ipv6/Kbuild
 create mode 100644 include/uapi/linux/nfsd/Kbuild
 create mode 100644 include/uapi/linux/raid/Kbuild
 create mode 100644 include/uapi/linux/spi/Kbuild
 create mode 100644 include/uapi/linux/sunrpc/Kbuild
 create mode 100644 include/uapi/linux/tc_act/Kbuild
 create mode 100644 include/uapi/linux/tc_ematch/Kbuild
 create mode 100644 include/uapi/linux/usb/Kbuild
 create mode 100644 include/uapi/linux/wimax/Kbuild
 create mode 100644 include/uapi/mtd/Kbuild
 create mode 100644 include/uapi/rdma/Kbuild
 create mode 100644 include/uapi/scsi/Kbuild
 create mode 100644 include/uapi/scsi/fc/Kbuild
 create mode 100644 include/uapi/sound/Kbuild
 create mode 100644 include/uapi/video/Kbuild
 create mode 100644 include/uapi/xen/Kbuild
 create mode 100755 scripts/uapi-disintegration/disintegrate-1-stg.sh
 create mode 100755 scripts/uapi-disintegration/disintegrate-many-stg.sh
 create mode 100755 scripts/uapi-disintegration/disintegrate-one.pl
 create mode 100755 scripts/uapi-disintegration/disintegrate-to-git-by-dir.pl
 create mode 100755 scripts/uapi-disintegration/disintegrate-to-git.pl
 create mode 100755 scripts/uapi-disintegration/disintegrate-to-stg-by-dir.pl
 create mode 100755 scripts/uapi-disintegration/drm-headers.pl
 create mode 100755 scripts/uapi-disintegration/genlist.pl
 create mode 100755 scripts/uapi-disintegration/set-up-Kbuild.pl
 create mode 100755 scripts/uapi-disintegration/sound-headers.pl
 create mode 100755 scripts/uapi-disintegration/system-headers.pl
#1 lore raw

PATCH 1/1 01/39] UAPI: Add script to convert #include "..." to #include <path/...> in sys headers

Add a script to convert #include "..." to #include <path/...> in kernel system headers.

Observations:

(1) There are quite a lot of #includes of things like "linux/fs.h" which should really use <...>. These are changed within include/ dirs.

(2) Some referenced header files are missing for no obvious reason - pm2fb.h and via_drmclient.h for example.

(3) The DRM video driving code uses -Iinclude/drm when it should probably just preface its header file names with drm/ in #include. These are changed within include/drm/.

(4) Under arch/cris/include/ there are some directories (arch-v10 and arch-v32) that should perhaps be renamed to arch/cris/arch-vXX/include.

Similarly, under arch/sh/, arch/sh/include/mach-X/ should perhaps be arch/sh/boards/mach-X/include/.

However, I've left these alone as they aren't really a problem.

---

 scripts/uapi-disintegration/system-headers.pl |  167 +++++++++++++++++++++++++
 1 files changed, 167 insertions(+), 0 deletions(-)
 create mode 100755 scripts/uapi-disintegration/system-headers.pl
scripts/uapi-disintegration/system-headers.pl new file +167 -0
new file mode 100755
index 0000000..e494c01
@@ -0,0 +1,167 @@
+#!/usr/bin/perl -w
+
+use File::Find;
+
+my @sys_header_dirs = (
+    "include"
+    );
+
+#
+# Changes must be committed first
+#
+system("git diff --quiet") == 0 or die "Uncommitted changes; aborting\n";
+
+#
+# Delete the old patch under StGIT
+#
+system("stg delete uapi-convert-include-quote-to-angle.diff");
+
+#
+# Set up the patch under StGIT
+#
+system("stg new -m '" .
+       "UAPI: Convert #include \"...\" to #include <path/...> in kernel system headers\n" .
+       "\n" .
+       "Convert #include \"...\" to #include <path/...> in kernel system headers.\n" .
+       "\n" .
+       "scripts/uapi-disintegrate/system-headers.pl was used\n" .
+       "\n" .
+       "Signed-off-by: David Howells <dhowells\@redhat.com>\n" .
+       "' uapi-convert-include-quote-to-angle.diff"
+    ) == 0 or die;
+
+#
+# Find all the system header directories under arch
+#
+opendir DIR, "arch" or die;
+push @sys_header_dirs,
+    map { "arch/$_/include"; }
+sort grep { -d "arch/$_/include"; }
+grep { $_ !~ /^[.]/ }
+readdir DIR;
+closedir DIR;
+
+#
+# Find all the header files
+#
+%headers = ();
+sub find_header()
+{
+    $headers{$File::Find::name} = 1 if ($_ =~ /[.]h$/);
+}
+
+find(\&find_header, @sys_header_dirs);
+
+#print join("\n", sort keys %headers), "\n";
+
+foreach my $hdr (sort grep { $_ !~ m@arch/um/@} keys %headers) {
+    my $dir = $hdr;
+    $dir =~ m@(^.*/)@, $dir = $1;
+
+    open FD, '<', $hdr or die "open $hdr: $!\n";
+    my @lines = <FD>;
+    close FD or die;
+
+    my $printed_name = 0;
+    my $alter_header = 0;
+
+    for (my $l = 0; $l <= $#lines; $l++) {
+	my $line = $lines[$l];
+
+	if ($line =~ /^(#\s*include\s+)["]([^"]+)["](.*[\n])/) {
+	    #print $1, '@', $2, '@', $3;
+
+	    if (!$printed_name) {
+		#print "[[[ $hdr [\e[36m$dir\e[m] ]]]\n";
+		$printed_name = 1;
+	    }
+
+	    my $pre = $1;
+	    my $name = $2;
+	    my $post = $3;
+
+	    my $inc = undef;
+	    my $base = "??";
+	    my $path = "??";
+	    my $realpath = "??";
+	    my $do_existence_check = 1;
+
+	    if ($name eq "platform/acenv.h") {
+		# ACPI includes this relative to the current dir
+		$inc = $dir . $name;
+	    } elsif ($name =~ m@^[a-z].*/@) {
+		# We found something like "linux/foo.h" so just accept as is
+		$base = "";
+		$realpath = $path = $name;
+		$do_existence_check = 0;
+		goto no_disassemble;
+	    } elsif ($name =~ m@^[.][.]/@) {
+		# We found something like "../foo.h" so we jam the dir on the
+		# front and then remove "dir/.." pairs
+		$inc = $dir . $name;
+		while ($inc =~ m@[^/]*/[.][.]/@) {
+		    $inc =~ s@[^/]*/[.][.]/@@;
+		}
+	    } elsif ($name !~ m@/@) {
+		# We found something like "foo.h" so we again stick the dir on
+		# the front and then cut off the "include/" prefix.
+		if ($name =~ m@^drm_@) {
+		    # Unless it's a DRM header - the drm stuff adds
+		    # -Iinclude/drm to the build flags rather than use
+		    # <drm/foo.h> for some reason
+		    $inc = "include/drm/$name";
+		} else {
+		    $inc = $dir . $name;
+		}
+	    } else {
+		die "Don't handle \"$name\"\n";
+	    }
+
+	    $inc =~ m@(.*include/)(.*/[^/]*)@, $base = $1, $path = $2;
+
+	    $realpath = $path;
+	    if ($dir =~ m@^arch/cris/@ && $path =~ m@^arch-v[0-9]+/(arch/.*)@) {
+		$realpath = $1;
+	    } elsif ($dir =~ m@^arch/sh/@ && $path =~ m@^mach-[^/]+/(mach/.*)@) {
+		$realpath = $1;
+	    }
+
+	  no_disassemble:
+	    print $hdr, ": ", $name, " -> \e[36m", $base, "\e[m", $path;
+
+	    if ($do_existence_check && ! -f $inc) {
+		if (($hdr eq "arch/powerpc/include/asm/bootx.h" && $name eq "linux_type_defs.h") ||
+		    ($hdr eq "include/acpi/platform/acenv.h" && $name =~ /ac[a-z]*[0-9]*[.]h/) ||
+		    ($hdr eq "include/linux/jbd.h" && $name eq "jfs_compat.h") ||
+		    ($hdr eq "include/linux/jbd2.h" && $name eq "jfs_compat.h") ||
+		    ($hdr eq "include/video/cvisionppc.h" && $name eq "pm2fb.h") ||
+		    ($hdr eq "include/drm/via_drm.h" && $name eq "via_drmclient.h")
+		    ) {
+		    print " \e[33mnot present\e[m\n";
+		} else {
+		    print " \e[31mnot found\e[m\n";
+		    die;
+		}
+	    } else {
+		$lines[$l] = $pre . "<" . $realpath . ">" . $post;
+		$alter_header = 1;
+		print "\n";
+	    }
+	}
+    }
+
+    if ($alter_header) {
+	my $temp = $hdr . ".syshdr";
+	open FD, '>', $temp or die "create $temp: $!\n";
+	print FD @lines or die "write $temp: $!\n";
+	close FD or die "close $temp: $!\n";
+	rename $temp, $hdr or die "move $temp -> $hdr: $!\n";
+    }
+}
+
+#
+# Commit the changes
+#
+system("stg ref") == 0 or die;
+
+exit 0;
#2 lore raw

PATCH 1/1 02/39] UAPI: Convert #include "..." to #include <path/...> in kernel system headers

In reply to David Howells

Convert #include "..." to #include <path/...> in kernel system headers.

scripts/uapi-disintegrate/system-headers.pl was used

---

 arch/arm/include/asm/localtimer.h                |    2 +
 arch/arm/include/asm/page.h                      |    2 +
 arch/arm/include/asm/pgtable.h                   |    2 +
 arch/arm/include/asm/vfpmacros.h                 |    2 +
 arch/cris/include/arch-v10/arch/sv_addr_ag.h     |    2 +
 arch/cris/include/arch-v10/arch/svinto.h         |    2 +
 arch/cris/include/arch-v32/arch/dma.h            |    2 +
 arch/cris/include/arch-v32/arch/hwregs/dma.h     |    2 +
 arch/m68k/include/asm/bitops.h                   |    4 +-
 arch/m68k/include/asm/cacheflush.h               |    4 +-
 arch/m68k/include/asm/delay.h                    |    4 +-
 arch/m68k/include/asm/entry.h                    |    4 +-
 arch/m68k/include/asm/hardirq.h                  |    4 +-
 arch/m68k/include/asm/io.h                       |    4 +-
 arch/m68k/include/asm/m68360.h                   |    8 ++---
 arch/m68k/include/asm/m68360_enet.h              |    2 +
 arch/m68k/include/asm/page.h                     |    4 +-
 arch/m68k/include/asm/pgtable.h                  |    4 +-
 arch/m68k/include/asm/q40_master.h               |    2 +
 arch/m68k/include/asm/system.h                   |    4 +-
 arch/m68k/include/asm/uaccess.h                  |    4 +-
 arch/microblaze/include/asm/mmu_context.h        |    2 +
 arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h  |    2 +
 arch/mips/include/asm/mach-pnx833x/gpio.h        |    2 +
 arch/mips/include/asm/octeon/cvmx-asm.h          |    2 +
 arch/mips/include/asm/octeon/cvmx-spinlock.h     |    2 +
 arch/mips/include/asm/octeon/cvmx.h              |   36 +++++++++++-----------
 arch/mips/include/asm/octeon/octeon-model.h      |    2 +
 arch/mips/include/asm/octeon/octeon.h            |    2 +
 arch/mips/include/asm/sibyte/bcm1480_int.h       |    2 +
 arch/mips/include/asm/sibyte/bcm1480_l2c.h       |    2 +
 arch/mips/include/asm/sibyte/bcm1480_mc.h        |    2 +
 arch/mips/include/asm/sibyte/bcm1480_regs.h      |    4 +-
 arch/mips/include/asm/sibyte/bcm1480_scd.h       |    4 +-
 arch/mips/include/asm/sibyte/sb1250_dma.h        |    2 +
 arch/mips/include/asm/sibyte/sb1250_genbus.h     |    2 +
 arch/mips/include/asm/sibyte/sb1250_int.h        |    2 +
 arch/mips/include/asm/sibyte/sb1250_l2c.h        |    2 +
 arch/mips/include/asm/sibyte/sb1250_ldt.h        |    2 +
 arch/mips/include/asm/sibyte/sb1250_mac.h        |    2 +
 arch/mips/include/asm/sibyte/sb1250_mc.h         |    2 +
 arch/mips/include/asm/sibyte/sb1250_regs.h       |    2 +
 arch/mips/include/asm/sibyte/sb1250_scd.h        |    2 +
 arch/mips/include/asm/sibyte/sb1250_smbus.h      |    2 +
 arch/mips/include/asm/sibyte/sb1250_syncser.h    |    2 +
 arch/mips/include/asm/sibyte/sb1250_uart.h       |    2 +
 arch/powerpc/include/asm/ps3.h                   |    2 +
 arch/powerpc/include/asm/ucc_fast.h              |    2 +
 arch/powerpc/include/asm/ucc_slow.h              |    2 +
 arch/sh/include/asm/checksum.h                   |    2 +
 arch/sh/include/asm/mmu_context.h                |    4 +-
 arch/sh/include/asm/posix_types.h                |    8 ++---
 arch/sh/include/asm/processor.h                  |    4 +-
 arch/sh/include/asm/ptrace.h                     |    4 +-
 arch/sh/include/asm/string.h                     |    4 +-
 arch/sh/include/asm/syscall.h                    |    4 +-
 arch/sh/include/asm/syscalls.h                   |    4 +-
 arch/sh/include/asm/system.h                     |    4 +-
 arch/sh/include/asm/tlb.h                        |    2 +
 arch/sh/include/asm/uaccess.h                    |    4 +-
 arch/sh/include/asm/unistd.h                     |    8 ++---
 arch/sh/include/mach-ecovec24/mach/romimage.h    |    2 +
 arch/sh/include/mach-kfr2r09/mach/romimage.h     |    2 +
 arch/unicore32/include/mach/PKUnity.h            |   36 +++++++++++-----------
 arch/unicore32/include/mach/hardware.h           |    2 +
 arch/unicore32/include/mach/uncompress.h         |    4 +-
 arch/x86/include/asm/atomic.h                    |    4 +-
 arch/x86/include/asm/checksum.h                  |    4 +-
 arch/x86/include/asm/cmpxchg.h                   |    4 +-
 arch/x86/include/asm/mmzone.h                    |    4 +-
 arch/x86/include/asm/mutex.h                     |    4 +-
 arch/x86/include/asm/numa.h                      |    4 +-
 arch/x86/include/asm/pci.h                       |    2 +
 arch/x86/include/asm/pgtable.h                   |    4 +-
 arch/x86/include/asm/pgtable_types.h             |    4 +-
 arch/x86/include/asm/posix_types.h               |    8 ++---
 arch/x86/include/asm/seccomp.h                   |    4 +-
 arch/x86/include/asm/string.h                    |    4 +-
 arch/x86/include/asm/suspend.h                   |    4 +-
 arch/x86/include/asm/uaccess.h                   |    4 +-
 arch/x86/include/asm/unistd.h                    |    8 ++---
 arch/x86/include/asm/user.h                      |    4 +-
 arch/x86/include/asm/xen/interface.h             |    4 +-
 arch/x86/include/asm/xor.h                       |    4 +-
 include/acpi/acpi.h                              |   18 ++++++-----
 include/acpi/acpiosxf.h                          |    4 +-
 include/acpi/acpixf.h                            |    4 +-
 include/acpi/platform/acenv.h                    |    2 +
 include/acpi/platform/aclinux.h                  |    2 +
 include/drm/drm.h                                |    2 +
 include/drm/drmP.h                               |   16 +++++-----
 include/drm/drm_buffer.h                         |    2 +
 include/drm/drm_encoder_slave.h                  |    4 +-
 include/drm/drm_memory.h                         |    2 +
 include/drm/drm_sarea.h                          |    2 +
 include/drm/drm_sman.h                           |    4 +-
 include/drm/i915_drm.h                           |    2 +
 include/drm/mga_drm.h                            |    2 +
 include/drm/radeon_drm.h                         |    2 +
 include/drm/ttm/ttm_bo_api.h                     |    2 +
 include/drm/ttm/ttm_bo_driver.h                  |   16 +++++-----
 include/drm/ttm/ttm_execbuf_util.h               |    2 +
 include/drm/ttm/ttm_lock.h                       |    2 +
 include/drm/ttm/ttm_object.h                     |    2 +
 include/drm/ttm/ttm_page_alloc.h                 |    4 +-
 include/drm/via_drm.h                            |    2 +
 include/linux/bcma/bcma.h                        |    2 +
 include/linux/ceph/ceph_fs.h                     |    4 +-
 include/linux/ceph/debugfs.h                     |    4 +-
 include/linux/ceph/decode.h                      |    2 +
 include/linux/ceph/libceph.h                     |   14 ++++-----
 include/linux/ceph/mdsmap.h                      |    2 +
 include/linux/ceph/messenger.h                   |    4 +-
 include/linux/ceph/mon_client.h                  |    2 +
 include/linux/ceph/msgpool.h                     |    2 +
 include/linux/ceph/osd_client.h                  |    6 ++--
 include/linux/ceph/osdmap.h                      |    4 +-
 include/linux/ceph/rados.h                       |    2 +
 include/linux/ceph/types.h                       |    6 ++--
 include/linux/crush/mapper.h                     |    2 +
 include/linux/drbd_tag_magic.h                   |   10 +++---
 include/linux/netfilter/nf_conntrack_h323_asn1.h |    2 +
 include/scsi/osd_attributes.h                    |    2 +
 include/scsi/osd_initiator.h                     |    4 +-
 include/scsi/osd_sec.h                           |    4 +-
 include/sound/ac97_codec.h                       |    6 ++--
 include/sound/ad1816a.h                          |    6 ++--
 include/sound/ak4531_codec.h                     |    4 +-
 include/sound/cs46xx.h                           |   10 +++---
 include/sound/cs46xx_dsp_spos.h                  |    4 +-
 include/sound/cs46xx_dsp_task_types.h            |    2 +
 include/sound/emu10k1_synth.h                    |    4 +-
 include/sound/emu8000.h                          |    4 +-
 include/sound/emux_legacy.h                      |    2 +
 include/sound/emux_synth.h                       |   14 ++++-----
 include/sound/es1688.h                           |    4 +-
 include/sound/gus.h                              |   10 +++---
 include/sound/mpu401.h                           |    2 +
 include/sound/pcm.h                              |    2 +
 include/sound/rawmidi.h                          |    2 +
 include/sound/sb.h                               |    4 +-
 include/sound/sb16_csp.h                         |    4 +-
 include/sound/seq_kernel.h                       |    2 +
 include/sound/seq_midi_emul.h                    |    2 +
 include/sound/seq_midi_event.h                   |    2 +
 include/sound/seq_oss.h                          |    4 +-
 include/sound/seq_virmidi.h                      |    4 +-
 include/sound/snd_wavefront.h                    |    8 ++---
 include/sound/soundfont.h                        |    4 +-
 include/sound/tea6330t.h                         |    2 +
 include/sound/trident.h                          |    8 ++---
 include/sound/wss.h                              |    8 ++---
 include/sound/ymfpci.h                           |    8 ++---
 include/trace/events/compaction.h                |    2 +
 include/trace/events/kmem.h                      |    2 +
 include/trace/events/vmscan.h                    |    2 +
 include/xen/interface/callback.h                 |    2 +
 include/xen/interface/hvm/params.h               |    2 +
 include/xen/interface/io/blkif.h                 |    4 +-
 include/xen/interface/io/netif.h                 |    4 +-
 include/xen/interface/sched.h                    |    2 +
 include/xen/interface/version.h                  |    2 +
 162 files changed, 336 insertions(+), 336 deletions(-)
arch/arm/include/asm/localtimer.h +1 -1
index 080d74f..8c67ead 100644
@@ -27,7 +27,7 @@ asmlinkage void do_local_timer(struct pt_regs *);
 
 #ifdef CONFIG_HAVE_ARM_TWD
 
-#include "smp_twd.h"
+#include <asm/smp_twd.h>
 
 #define local_timer_ack()	twd_timer_ack()
 
arch/arm/include/asm/page.h +1 -1
index ac75d08..f9629a7 100644
@@ -19,7 +19,7 @@
 
 #ifndef CONFIG_MMU
 
-#include "page-nommu.h"
+#include <asm/page-nommu.h>
 
 #else
 
arch/arm/include/asm/pgtable.h +1 -1
index 5750704..0f64e0c 100644
@@ -16,7 +16,7 @@
 
 #ifndef CONFIG_MMU
 
-#include "pgtable-nommu.h"
+#include <asm/pgtable-nommu.h>
 
 #else
 
arch/arm/include/asm/vfpmacros.h +1 -1
index 3d5fc41..a7aadbd 100644
@@ -5,7 +5,7 @@
  */
 #include <asm/hwcap.h>
 
-#include "vfp.h"
+#include <asm/vfp.h>
 
 @ Macros to allow building with old toolkits (with no VFP support)
 	.macro	VFPFMRX, rd, sysreg, cond
arch/cris/include/arch-v10/arch/sv_addr_ag.h +1 -1
index e4a6b68..5517f04 100644
@@ -114,7 +114,7 @@
 
 /*------------------------------------------------------------*/
 
-#include "sv_addr.agh"
+#include <arch/sv_addr.agh>
 
 #if __test_sv_addr__
 /* IO_MASK( R_BUS_CONFIG , CE ) */
arch/cris/include/arch-v10/arch/svinto.h +1 -1
index 0881a1a..da5c152 100644
@@ -1,7 +1,7 @@
 #ifndef _ASM_CRIS_SVINTO_H
 #define _ASM_CRIS_SVINTO_H
 
-#include "sv_addr_ag.h"
+#include <arch/sv_addr_ag.h>
 
 extern unsigned int genconfig_shadow; /* defined and set in head.S */
 
arch/cris/include/arch-v32/arch/dma.h +1 -1
index 6190615..6f92f4f 100644
@@ -1 +1 @@
-#include "mach/dma.h"
+#include <mach/dma.h>
arch/cris/include/arch-v32/arch/hwregs/dma.h +1 -1
index 3ce322b..52bf679 100644
@@ -7,7 +7,7 @@
 #define dma_h
 
 /* registers */ /* Really needed, since both are listed in sw.list? */
-#include "dma_defs.h"
+#include <arch/hwregs/dma_defs.h>
 
 
 /* descriptors */
arch/m68k/include/asm/bitops.h +2 -2
index ce163ab..2d13854 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "bitops_no.h"
+#include <asm/bitops_no.h>
 #else
-#include "bitops_mm.h"
+#include <asm/bitops_mm.h>
 #endif
arch/m68k/include/asm/cacheflush.h +2 -2
index a70d731..4fc7382 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "cacheflush_no.h"
+#include <asm/cacheflush_no.h>
 #else
-#include "cacheflush_mm.h"
+#include <asm/cacheflush_mm.h>
 #endif
arch/m68k/include/asm/delay.h +2 -2
index d2598e3..5bab01b 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "delay_no.h"
+#include <asm/delay_no.h>
 #else
-#include "delay_mm.h"
+#include <asm/delay_mm.h>
 #endif
arch/m68k/include/asm/entry.h +2 -2
index 876eec6..7308daf 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "entry_no.h"
+#include <asm/entry_no.h>
 #else
-#include "entry_mm.h"
+#include <asm/entry_mm.h>
 #endif
arch/m68k/include/asm/hardirq.h +2 -2
index 56d0d5d..b9605bc 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "hardirq_no.h"
+#include <asm/hardirq_no.h>
 #else
-#include "hardirq_mm.h"
+#include <asm/hardirq_mm.h>
 #endif
arch/m68k/include/asm/io.h +2 -2
index c7210ba..c70cc91 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "io_no.h"
+#include <asm/io_no.h>
 #else
-#include "io_mm.h"
+#include <asm/io_mm.h>
 #endif
arch/m68k/include/asm/m68360.h +4 -4
index eb7d39e..4664180 100644
@@ -1,7 +1,7 @@
-#include "m68360_regs.h"
-#include "m68360_pram.h"
-#include "m68360_quicc.h"
-#include "m68360_enet.h"
+#include <asm/m68360_regs.h>
+#include <asm/m68360_pram.h>
+#include <asm/m68360_quicc.h>
+#include <asm/m68360_enet.h>
 
 #ifdef CONFIG_M68360
 
arch/m68k/include/asm/m68360_enet.h +1 -1
index c36f4d0..4d04037 100644
@@ -10,7 +10,7 @@
 #ifndef __ETHER_H
 #define __ETHER_H
 
-#include "quicc_simple.h"
+#include <asm/quicc_simple.h>
 
 /*
  * transmit BD's
arch/m68k/include/asm/page.h +2 -2
index dfebb7c..095d829 100644
@@ -39,9 +39,9 @@ typedef struct page *pgtable_t;
 #endif /* !__ASSEMBLY__ */
 
 #ifdef CONFIG_MMU
-#include "page_mm.h"
+#include <asm/page_mm.h>
 #else
-#include "page_no.h"
+#include <asm/page_no.h>
 #endif
 
 #include <asm-generic/getorder.h>
arch/m68k/include/asm/pgtable.h +2 -2
index ee6759e..a3d733b 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "pgtable_no.h"
+#include <asm/pgtable_no.h>
 #else
-#include "pgtable_mm.h"
+#include <asm/pgtable_mm.h>
 #endif
arch/m68k/include/asm/q40_master.h +1 -1
index 3907a09..fc5b362 100644
@@ -60,7 +60,7 @@
 #define Q40_RTC_WRITE  128
 
 /* define some Q40 specific ints */
-#include "q40ints.h"
+#include <asm/q40ints.h>
 
 /* misc defs */
 #define DAC_LEFT  ((unsigned char *)0xff008000)
arch/m68k/include/asm/system.h +2 -2
index ccea925..f99dcd2 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "system_no.h"
+#include <asm/system_no.h>
 #else
-#include "system_mm.h"
+#include <asm/system_mm.h>
 #endif
arch/m68k/include/asm/uaccess.h +2 -2
index 38f92db..639c731 100644
@@ -1,5 +1,5 @@
 #ifdef __uClinux__
-#include "uaccess_no.h"
+#include <asm/uaccess_no.h>
 #else
-#include "uaccess_mm.h"
+#include <asm/uaccess_mm.h>
 #endif
arch/microblaze/include/asm/mmu_context.h +1 -1
index 24eab16..0ccd8c4 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_MMU
-# include "mmu_context_mm.h"
+# include <asm/mmu_context_mm.h>
 #else
 # include <asm-generic/mmu_context.h>
 #endif
arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h +1 -1
index 91180fa..1e08044 100644
@@ -1,7 +1,7 @@
 #ifndef BCM63XX_IO_H_
 #define BCM63XX_IO_H_
 
-#include "bcm63xx_cpu.h"
+#include <asm/mach-bcm63xx/bcm63xx_cpu.h>
 
 /*
  * Physical memory map, RAM is mapped at 0x0.
arch/mips/include/asm/mach-pnx833x/gpio.h +1 -1
index ed3a88d..f192acf 100644
@@ -30,7 +30,7 @@
    - including locking between different uses
 */
 
-#include "pnx833x.h"
+#include <asm/mach-pnx833x/pnx833x.h>
 
 #define SET_REG_BIT(reg, bit)		do { (reg |= (1 << (bit))); } while (0)
 #define CLEAR_REG_BIT(reg, bit)		do { (reg &= ~(1 << (bit))); } while (0)
arch/mips/include/asm/octeon/cvmx-asm.h +1 -1
index 5de5de9..31eacc2 100644
@@ -32,7 +32,7 @@
 #ifndef __CVMX_ASM_H__
 #define __CVMX_ASM_H__
 
-#include "octeon-model.h"
+#include <asm/octeon/octeon-model.h>
 
 /* other useful stuff */
 #define CVMX_SYNC asm volatile ("sync" : : : "memory")
arch/mips/include/asm/octeon/cvmx-spinlock.h +1 -1
index 2fbf087..a672abb 100644
@@ -35,7 +35,7 @@
 #ifndef __CVMX_SPINLOCK_H__
 #define __CVMX_SPINLOCK_H__
 
-#include "cvmx-asm.h"
+#include <asm/octeon/cvmx-asm.h>
 
 /* Spinlocks for Octeon */
 
arch/mips/include/asm/octeon/cvmx.h +18 -18
index 7e12867..3a143a6 100644
@@ -31,24 +31,24 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 
-#include "cvmx-asm.h"
-#include "cvmx-packet.h"
-#include "cvmx-sysinfo.h"
-
-#include "cvmx-ciu-defs.h"
-#include "cvmx-gpio-defs.h"
-#include "cvmx-iob-defs.h"
-#include "cvmx-ipd-defs.h"
-#include "cvmx-l2c-defs.h"
-#include "cvmx-l2d-defs.h"
-#include "cvmx-l2t-defs.h"
-#include "cvmx-led-defs.h"
-#include "cvmx-mio-defs.h"
-#include "cvmx-pow-defs.h"
-
-#include "cvmx-bootinfo.h"
-#include "cvmx-bootmem.h"
-#include "cvmx-l2c.h"
+#include <asm/octeon/cvmx-asm.h>
+#include <asm/octeon/cvmx-packet.h>
+#include <asm/octeon/cvmx-sysinfo.h>
+
+#include <asm/octeon/cvmx-ciu-defs.h>
+#include <asm/octeon/cvmx-gpio-defs.h>
+#include <asm/octeon/cvmx-iob-defs.h>
+#include <asm/octeon/cvmx-ipd-defs.h>
+#include <asm/octeon/cvmx-l2c-defs.h>
+#include <asm/octeon/cvmx-l2d-defs.h>
+#include <asm/octeon/cvmx-l2t-defs.h>
+#include <asm/octeon/cvmx-led-defs.h>
+#include <asm/octeon/cvmx-mio-defs.h>
+#include <asm/octeon/cvmx-pow-defs.h>
+
+#include <asm/octeon/cvmx-bootinfo.h>
+#include <asm/octeon/cvmx-bootmem.h>
+#include <asm/octeon/cvmx-l2c.h>
 
 #ifndef CVMX_ENABLE_DEBUG_PRINTS
 #define CVMX_ENABLE_DEBUG_PRINTS 1
arch/mips/include/asm/octeon/octeon-model.h +1 -1
index 700f88e..40b81ce 100644
@@ -336,6 +336,6 @@ static inline int __octeon_is_model_runtime__(uint32_t model)
 const char *octeon_model_get_string(uint32_t chip_id);
 const char *octeon_model_get_string_buffer(uint32_t chip_id, char *buffer);
 
-#include "octeon-feature.h"
+#include <asm/octeon/octeon-feature.h>
 
 #endif /* __OCTEON_MODEL_H__ */
arch/mips/include/asm/octeon/octeon.h +1 -1
index f72f768..e314b35 100644
@@ -8,7 +8,7 @@
 #ifndef __ASM_OCTEON_OCTEON_H
 #define __ASM_OCTEON_OCTEON_H
 
-#include "cvmx.h"
+#include <asm/octeon/cvmx.h>
 
 extern uint64_t octeon_bootmem_alloc_range_phys(uint64_t size,
 						uint64_t alignment,
arch/mips/include/asm/sibyte/bcm1480_int.h +1 -1
index 6109557..fffb224 100644
@@ -34,7 +34,7 @@
 #ifndef _BCM1480_INT_H
 #define _BCM1480_INT_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*  *********************************************************************
     *  Interrupt Mapper Constants
arch/mips/include/asm/sibyte/bcm1480_l2c.h +1 -1
index fd75817..725d38c 100644
@@ -33,7 +33,7 @@
 #ifndef _BCM1480_L2C_H
 #define _BCM1480_L2C_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*
  * Format of level 2 cache management address (Table 55)
arch/mips/include/asm/sibyte/bcm1480_mc.h +1 -1
index f26a41a..4307a75 100644
@@ -33,7 +33,7 @@
 #ifndef _BCM1480_MC_H
 #define _BCM1480_MC_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*
  * Memory Channel Configuration Register (Table 81)
arch/mips/include/asm/sibyte/bcm1480_regs.h +2 -2
index b4077bb..84d168d 100644
@@ -32,14 +32,14 @@
 #ifndef _BCM1480_REGS_H
 #define _BCM1480_REGS_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*  *********************************************************************
     *  Pull in the BCM1250's registers since a great deal of the 1480's
     *  functions are the same as the BCM1250.
     ********************************************************************* */
 
-#include "sb1250_regs.h"
+#include <asm/sibyte/sb1250_regs.h>
 
 
 /*  *********************************************************************
arch/mips/include/asm/sibyte/bcm1480_scd.h +2 -2
index 25ef24c..2af3706 100644
@@ -32,13 +32,13 @@
 #ifndef _BCM1480_SCD_H
 #define _BCM1480_SCD_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*  *********************************************************************
     *  Pull in the BCM1250's SCD since lots of stuff is the same.
     ********************************************************************* */
 
-#include "sb1250_scd.h"
+#include <asm/sibyte/sb1250_scd.h>
 
 /*  *********************************************************************
     *  Some general notes:
arch/mips/include/asm/sibyte/sb1250_dma.h +1 -1
index bad5617..6c44dfb 100644
@@ -36,7 +36,7 @@
 #define _SB1250_DMA_H
 
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*  *********************************************************************
     *  DMA Registers
arch/mips/include/asm/sibyte/sb1250_genbus.h +1 -1
index 94e9c7c..a96ded1 100644
@@ -34,7 +34,7 @@
 #ifndef _SB1250_GENBUS_H
 #define _SB1250_GENBUS_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*
  * Generic Bus Region Configuration Registers (Table 11-4)
arch/mips/include/asm/sibyte/sb1250_int.h +1 -1
index f2850b4..dbea73d 100644
@@ -33,7 +33,7 @@
 #ifndef _SB1250_INT_H
 #define _SB1250_INT_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*  *********************************************************************
     *  Interrupt Mapper Constants
arch/mips/include/asm/sibyte/sb1250_l2c.h +1 -1
index 6554dcf..b61a749 100644
@@ -33,7 +33,7 @@
 #ifndef _SB1250_L2C_H
 #define _SB1250_L2C_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*
  * Level 2 Cache Tag register (Table 5-3)
arch/mips/include/asm/sibyte/sb1250_ldt.h +1 -1
index 1e76cf1..bf7f320 100644
@@ -33,7 +33,7 @@
 #ifndef _SB1250_LDT_H
 #define _SB1250_LDT_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 #define K_LDT_VENDOR_SIBYTE	0x166D
 #define K_LDT_DEVICE_SB1250	0x0002
arch/mips/include/asm/sibyte/sb1250_mac.h +1 -1
index 77f7872..cfc4d78 100644
@@ -33,7 +33,7 @@
 #ifndef _SB1250_MAC_H
 #define _SB1250_MAC_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*  *********************************************************************
     *  Ethernet MAC Registers
arch/mips/include/asm/sibyte/sb1250_mc.h +1 -1
index 1eb1b5a..15048dc 100644
@@ -33,7 +33,7 @@
 #ifndef _SB1250_MC_H
 #define _SB1250_MC_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*
  * Memory Channel Config Register (table 6-14)
arch/mips/include/asm/sibyte/sb1250_regs.h +1 -1
index 8f53ec8..29b9f0b 100644
@@ -33,7 +33,7 @@
 #ifndef _SB1250_REGS_H
 #define _SB1250_REGS_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 
 /*  *********************************************************************
arch/mips/include/asm/sibyte/sb1250_scd.h +1 -1
index e49c3e8..615e165 100644
@@ -32,7 +32,7 @@
 #ifndef _SB1250_SCD_H
 #define _SB1250_SCD_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*  *********************************************************************
     *  System control/debug registers
arch/mips/include/asm/sibyte/sb1250_smbus.h +1 -1
index 0476992..128d6b7 100644
@@ -34,7 +34,7 @@
 #ifndef _SB1250_SMBUS_H
 #define _SB1250_SMBUS_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*
  * SMBus Clock Frequency Register (Table 14-2)
arch/mips/include/asm/sibyte/sb1250_syncser.h +1 -1
index d4b8558..274e917 100644
@@ -33,7 +33,7 @@
 #ifndef _SB1250_SYNCSER_H
 #define _SB1250_SYNCSER_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*
  * Serial Mode Configuration Register
arch/mips/include/asm/sibyte/sb1250_uart.h +1 -1
index d835bf2..bb99eca 100644
@@ -33,7 +33,7 @@
 #ifndef _SB1250_UART_H
 #define _SB1250_UART_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /* **********************************************************************
    * DUART Registers
arch/powerpc/include/asm/ps3.h +1 -1
index 7f065e1..0e15db4 100644
@@ -24,7 +24,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/device.h>
-#include "cell-pmu.h"
+#include <asm/cell-pmu.h>
 
 union ps3_firmware_version {
 	u64 raw;
arch/powerpc/include/asm/ucc_fast.h +1 -1
index 839aab8..4644c84 100644
@@ -19,7 +19,7 @@
 #include <asm/immap_qe.h>
 #include <asm/qe.h>
 
-#include "ucc.h"
+#include <asm/ucc.h>
 
 /* Receive BD's status */
 #define R_E	0x80000000	/* buffer empty */
arch/powerpc/include/asm/ucc_slow.h +1 -1
index 0980e6a..cf131ff 100644
@@ -20,7 +20,7 @@
 #include <asm/immap_qe.h>
 #include <asm/qe.h>
 
-#include "ucc.h"
+#include <asm/ucc.h>
 
 /* transmit BD's status */
 #define T_R	0x80000000	/* ready bit */
arch/sh/include/asm/checksum.h +1 -1
index fc26d1f..34ae262 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_SUPERH32
-# include "checksum_32.h"
+# include <asm/checksum_32.h>
 #else
 # include <asm-generic/checksum.h>
 #endif
arch/sh/include/asm/mmu_context.h +2 -2
index 384c747..21c5088 100644
@@ -46,9 +46,9 @@
 #define MMU_VPN_MASK	0xfffff000
 
 #if defined(CONFIG_SUPERH32)
-#include "mmu_context_32.h"
+#include <asm/mmu_context_32.h>
 #else
-#include "mmu_context_64.h"
+#include <asm/mmu_context_64.h>
 #endif
 
 /*
arch/sh/include/asm/posix_types.h +4 -4
index 4eeb723..f08449b 100644
@@ -1,13 +1,13 @@
 #ifdef __KERNEL__
 # ifdef CONFIG_SUPERH32
-#  include "posix_types_32.h"
+#  include <asm/posix_types_32.h>
 # else
-#  include "posix_types_64.h"
+#  include <asm/posix_types_64.h>
 # endif
 #else
 # ifdef __SH5__
-#  include "posix_types_64.h"
+#  include <asm/posix_types_64.h>
 # else
-#  include "posix_types_32.h"
+#  include <asm/posix_types_32.h>
 # endif
 #endif /* __KERNEL__ */
arch/sh/include/asm/processor.h +2 -2
index 9c7bdfc..9dc9475 100644
@@ -164,9 +164,9 @@ int vsyscall_init(void);
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_SUPERH32
-# include "processor_32.h"
+# include <asm/processor_32.h>
 #else
-# include "processor_64.h"
+# include <asm/processor_64.h>
 #endif
 
 #endif /* __ASM_SH_PROCESSOR_H */
arch/sh/include/asm/ptrace.h +2 -2
index 88bd6be..3ba25f3 100644
@@ -25,9 +25,9 @@
 #define PT_TEXT_LEN		252
 
 #if defined(__SH5__) || defined(CONFIG_CPU_SH5)
-#include "ptrace_64.h"
+#include <asm/ptrace_64.h>
 #else
-#include "ptrace_32.h"
+#include <asm/ptrace_32.h>
 #endif
 
 #ifdef __KERNEL__
arch/sh/include/asm/string.h +2 -2
index 8c1ea21d..114011f 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_SUPERH32
-# include "string_32.h"
+# include <asm/string_32.h>
 #else
-# include "string_64.h"
+# include <asm/string_64.h>
 #endif
arch/sh/include/asm/syscall.h +2 -2
index aa7777b..847128d 100644
@@ -4,9 +4,9 @@
 extern const unsigned long sys_call_table[];
 
 #ifdef CONFIG_SUPERH32
-# include "syscall_32.h"
+# include <asm/syscall_32.h>
 #else
-# include "syscall_64.h"
+# include <asm/syscall_64.h>
 #endif
 
 #endif /* __ASM_SH_SYSCALL_H */
arch/sh/include/asm/syscalls.h +2 -2
index 507725a..3dbfef0 100644
@@ -11,9 +11,9 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
 			  unsigned long fd, unsigned long pgoff);
 
 #ifdef CONFIG_SUPERH32
-# include "syscalls_32.h"
+# include <asm/syscalls_32.h>
 #else
-# include "syscalls_64.h"
+# include <asm/syscalls_64.h>
 #endif
 
 #endif /* __KERNEL__ */
arch/sh/include/asm/system.h +2 -2
index 10c8b18..507d082 100644
@@ -176,9 +176,9 @@ struct mem_access {
 };
 
 #ifdef CONFIG_SUPERH32
-# include "system_32.h"
+# include <asm/system_32.h>
 #else
-# include "system_64.h"
+# include <asm/system_64.h>
 #endif
 
 #endif
arch/sh/include/asm/tlb.h +1 -1
index ec88bfc..e61d43d 100644
@@ -2,7 +2,7 @@
 #define __ASM_SH_TLB_H
 
 #ifdef CONFIG_SUPERH64
-# include "tlb_64.h"
+# include <asm/tlb_64.h>
 #endif
 
 #ifndef __ASSEMBLY__
arch/sh/include/asm/uaccess.h +2 -2
index 075848f..ee4cf16 100644
@@ -95,9 +95,9 @@ struct __large_struct { unsigned long buf[100]; };
 })
 
 #ifdef CONFIG_SUPERH32
-# include "uaccess_32.h"
+# include <asm/uaccess_32.h>
 #else
-# include "uaccess_64.h"
+# include <asm/uaccess_64.h>
 #endif
 
 /* Generic arbitrary sized copy.  */
arch/sh/include/asm/unistd.h +4 -4
index 65be656..5e845e8 100644
@@ -1,13 +1,13 @@
 #ifdef __KERNEL__
 # ifdef CONFIG_SUPERH32
-#  include "unistd_32.h"
+#  include <asm/unistd_32.h>
 # else
-#  include "unistd_64.h"
+#  include <asm/unistd_64.h>
 # endif
 #else
 # ifdef __SH5__
-#  include "unistd_64.h"
+#  include <asm/unistd_64.h>
 # else
-#  include "unistd_32.h"
+#  include <asm/unistd_32.h>
 # endif
 #endif
arch/sh/include/mach-ecovec24/mach/romimage.h +1 -1
index d63ef51..60f3e8a 100644
@@ -6,7 +6,7 @@
  */
 
 #include <asm/romimage-macros.h>
-#include "partner-jet-setup.txt"
+#include <mach/partner-jet-setup.txt>
 
 	/* execute icbi after enabling cache */
 	mov.l	1f, r0
arch/sh/include/mach-kfr2r09/mach/romimage.h +1 -1
index 7a88316..1afae21 100644
@@ -6,7 +6,7 @@
  */
 
 #include <asm/romimage-macros.h>
-#include "partner-jet-setup.txt"
+#include <mach/partner-jet-setup.txt>
 
 	/* execute icbi after enabling cache */
 	mov.l	1f, r0
arch/unicore32/include/mach/PKUnity.h +18 -18
index 8040d57..46705af 100644
@@ -15,7 +15,7 @@
 #error You must include hardware.h not PKUnity.h
 #endif
 
-#include "bitfield.h"
+#include <mach/bitfield.h>
 
 /*
  * Memory Definitions
@@ -32,7 +32,7 @@
  * 0x98000000 - 0x9FFFFFFF 128MB  PCI PCI-AHB MEM-mapping
  */
 #define PKUNITY_PCI_BASE		io_p2v(0x80000000) /* 0x80000000 - 0xBFFFFFFF 1GB */
-#include "regs-pci.h"
+#include <mach/regs-pci.h>
 
 #define PKUNITY_PCICFG_BASE		(PKUNITY_PCI_BASE + 0x0)
 #define PKUNITY_PCIBRI_BASE		(PKUNITY_PCI_BASE + 0x00010000)
@@ -50,18 +50,18 @@
 #define PKUNITY_ARBITER_BASE		(PKUNITY_AHB_BASE + 0x000000) /* AHB-2 */
 #define PKUNITY_DDR2CTRL_BASE		(PKUNITY_AHB_BASE + 0x100000) /* AHB-3 */
 #define PKUNITY_DMAC_BASE		(PKUNITY_AHB_BASE + 0x200000) /* AHB-4 */
-#include "regs-dmac.h"
+#include <mach/regs-dmac.h>
 #define PKUNITY_UMAL_BASE		(PKUNITY_AHB_BASE + 0x300000) /* AHB-5 */
-#include "regs-umal.h"
+#include <mach/regs-umal.h>
 #define PKUNITY_USB_BASE		(PKUNITY_AHB_BASE + 0x400000) /* AHB-6 */
 #define PKUNITY_SATA_BASE		(PKUNITY_AHB_BASE + 0x500000) /* AHB-7 */
 #define PKUNITY_SMC_BASE		(PKUNITY_AHB_BASE + 0x600000) /* AHB-8 */
 /* AHB-9 is for APB bridge */
 #define PKUNITY_MME_BASE		(PKUNITY_AHB_BASE + 0x700000) /* AHB-10 */
 #define PKUNITY_UNIGFX_BASE		(PKUNITY_AHB_BASE + 0x800000) /* AHB-11 */
-#include "regs-unigfx.h"
+#include <mach/regs-unigfx.h>
 #define PKUNITY_NAND_BASE		(PKUNITY_AHB_BASE + 0x900000) /* AHB-12 */
-#include "regs-nand.h"
+#include <mach/regs-nand.h>
 #define PKUNITY_H264D_BASE		(PKUNITY_AHB_BASE + 0xA00000) /* AHB-13 */
 #define PKUNITY_H264E_BASE		(PKUNITY_AHB_BASE + 0xB00000) /* AHB-14 */
 
@@ -72,27 +72,27 @@
 
 #define PKUNITY_UART0_BASE		(PKUNITY_APB_BASE + 0x000000) /* APB-0 */
 #define PKUNITY_UART1_BASE		(PKUNITY_APB_BASE + 0x100000) /* APB-1 */
-#include "regs-uart.h"
+#include <mach/regs-uart.h>
 #define PKUNITY_I2C_BASE		(PKUNITY_APB_BASE + 0x200000) /* APB-2 */
-#include "regs-i2c.h"
+#include <mach/regs-i2c.h>
 #define PKUNITY_SPI_BASE		(PKUNITY_APB_BASE + 0x300000) /* APB-3 */
-#include "regs-spi.h"
+#include <mach/regs-spi.h>
 #define PKUNITY_AC97_BASE		(PKUNITY_APB_BASE + 0x400000) /* APB-4 */
-#include "regs-ac97.h"
+#include <mach/regs-ac97.h>
 #define PKUNITY_GPIO_BASE		(PKUNITY_APB_BASE + 0x500000) /* APB-5 */
-#include "regs-gpio.h"
+#include <mach/regs-gpio.h>
 #define PKUNITY_INTC_BASE		(PKUNITY_APB_BASE + 0x600000) /* APB-6 */
-#include "regs-intc.h"
+#include <mach/regs-intc.h>
 #define PKUNITY_RTC_BASE		(PKUNITY_APB_BASE + 0x700000) /* APB-7 */
-#include "regs-rtc.h"
+#include <mach/regs-rtc.h>
 #define PKUNITY_OST_BASE		(PKUNITY_APB_BASE + 0x800000) /* APB-8 */
-#include "regs-ost.h"
+#include <mach/regs-ost.h>
 #define PKUNITY_RESETC_BASE		(PKUNITY_APB_BASE + 0x900000) /* APB-9 */
-#include "regs-resetc.h"
+#include <mach/regs-resetc.h>
 #define PKUNITY_PM_BASE			(PKUNITY_APB_BASE + 0xA00000) /* APB-10 */
-#include "regs-pm.h"
+#include <mach/regs-pm.h>
 #define PKUNITY_PS2_BASE		(PKUNITY_APB_BASE + 0xB00000) /* APB-11 */
-#include "regs-ps2.h"
+#include <mach/regs-ps2.h>
 #define PKUNITY_SDC_BASE		(PKUNITY_APB_BASE + 0xC00000) /* APB-12 */
-#include "regs-sdc.h"
+#include <mach/regs-sdc.h>
 
arch/unicore32/include/mach/hardware.h +1 -1
index 930bea6..9e20b5d 100644
@@ -15,7 +15,7 @@
 #ifndef __MACH_PUV3_HARDWARE_H__
 #define __MACH_PUV3_HARDWARE_H__
 
-#include "PKUnity.h"
+#include <mach/PKUnity.h>
 
 #ifndef __ASSEMBLY__
 #define io_p2v(x)	(void __iomem *)((x) - PKUNITY_MMIO_BASE)
arch/unicore32/include/mach/uncompress.h +2 -2
index 142d3e7..9be67c9 100644
@@ -13,8 +13,8 @@
 #ifndef __MACH_PUV3_UNCOMPRESS_H__
 #define __MACH_PUV3_UNCOMPRESS_H__
 
-#include "hardware.h"
-#include "ocd.h"
+#include <mach/hardware.h>
+#include <mach/ocd.h>
 
 extern char input_data[];
 extern char input_data_end[];
arch/x86/include/asm/atomic.h +2 -2
index 952a826..cfe5df8 100644
@@ -314,9 +314,9 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2)
 #define smp_mb__after_atomic_inc()	barrier()
 
 #ifdef CONFIG_X86_32
-# include "atomic64_32.h"
+# include <asm/atomic64_32.h>
 #else
-# include "atomic64_64.h"
+# include <asm/atomic64_64.h>
 #endif
 
 #include <asm-generic/atomic-long.h>
arch/x86/include/asm/checksum.h +2 -2
index 848850f..5f5bb0f 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_X86_32
-# include "checksum_32.h"
+# include <asm/checksum_32.h>
 #else
-# include "checksum_64.h"
+# include <asm/checksum_64.h>
 #endif
arch/x86/include/asm/cmpxchg.h +2 -2
index a460fa0..ed14064 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_X86_32
-# include "cmpxchg_32.h"
+# include <asm/cmpxchg_32.h>
 #else
-# include "cmpxchg_64.h"
+# include <asm/cmpxchg_64.h>
 #endif
arch/x86/include/asm/mmzone.h +2 -2
index 64217ea..d497bc4 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_X86_32
-# include "mmzone_32.h"
+# include <asm/mmzone_32.h>
 #else
-# include "mmzone_64.h"
+# include <asm/mmzone_64.h>
 #endif
arch/x86/include/asm/mutex.h +2 -2
index a731b9c..7d3a482 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_X86_32
-# include "mutex_32.h"
+# include <asm/mutex_32.h>
 #else
-# include "mutex_64.h"
+# include <asm/mutex_64.h>
 #endif
arch/x86/include/asm/numa.h +2 -2
index bfacd2c..49119fc 100644
@@ -53,9 +53,9 @@ static inline int numa_cpu_node(int cpu)
 #endif	/* CONFIG_NUMA */
 
 #ifdef CONFIG_X86_32
-# include "numa_32.h"
+# include <asm/numa_32.h>
 #else
-# include "numa_64.h"
+# include <asm/numa_64.h>
 #endif
 
 #ifdef CONFIG_NUMA
arch/x86/include/asm/pci.h +1 -1
index d498943..65de77d 100644
@@ -132,7 +132,7 @@ void default_teardown_msi_irqs(struct pci_dev *dev);
 #endif  /* __KERNEL__ */
 
 #ifdef CONFIG_X86_64
-#include "pci_64.h"
+#include <asm/pci_64.h>
 #endif
 
 /* implement the pci_ DMA API in terms of the generic device dma_ one */
arch/x86/include/asm/pgtable.h +2 -2
index 18601c8..fe8576b 100644
@@ -384,9 +384,9 @@ pte_t *populate_extra_pte(unsigned long vaddr);
 #endif	/* __ASSEMBLY__ */
 
 #ifdef CONFIG_X86_32
-# include "pgtable_32.h"
+# include <asm/pgtable_32.h>
 #else
-# include "pgtable_64.h"
+# include <asm/pgtable_64.h>
 #endif
 
 #ifndef __ASSEMBLY__
arch/x86/include/asm/pgtable_types.h +2 -2
index d56187c..602a028 100644
@@ -172,9 +172,9 @@
 #endif
 
 #ifdef CONFIG_X86_32
-# include "pgtable_32_types.h"
+# include <asm/pgtable_32_types.h>
 #else
-# include "pgtable_64_types.h"
+# include <asm/pgtable_64_types.h>
 #endif
 
 #ifndef __ASSEMBLY__
arch/x86/include/asm/posix_types.h +4 -4
index bb7133d..8ddf6f5 100644
@@ -1,13 +1,13 @@
 #ifdef __KERNEL__
 # ifdef CONFIG_X86_32
-#  include "posix_types_32.h"
+#  include <asm/posix_types_32.h>
 # else
-#  include "posix_types_64.h"
+#  include <asm/posix_types_64.h>
 # endif
 #else
 # ifdef __i386__
-#  include "posix_types_32.h"
+#  include <asm/posix_types_32.h>
 # else
-#  include "posix_types_64.h"
+#  include <asm/posix_types_64.h>
 # endif
 #endif
arch/x86/include/asm/seccomp.h +2 -2
index c62e58a..0f3d7f0 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_X86_32
-# include "seccomp_32.h"
+# include <asm/seccomp_32.h>
 #else
-# include "seccomp_64.h"
+# include <asm/seccomp_64.h>
 #endif
arch/x86/include/asm/string.h +2 -2
index 6dfd6d9..09224d7 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_X86_32
-# include "string_32.h"
+# include <asm/string_32.h>
 #else
-# include "string_64.h"
+# include <asm/string_64.h>
 #endif
arch/x86/include/asm/suspend.h +2 -2
index 9bd521f..2fab6c2 100644
@@ -1,5 +1,5 @@
 #ifdef CONFIG_X86_32
-# include "suspend_32.h"
+# include <asm/suspend_32.h>
 #else
-# include "suspend_64.h"
+# include <asm/suspend_64.h>
 #endif
arch/x86/include/asm/uaccess.h +2 -2
index 99ddd14..f7d304d 100644
@@ -567,9 +567,9 @@ extern struct movsl_mask {
 #define ARCH_HAS_NOCACHE_UACCESS 1
 
 #ifdef CONFIG_X86_32
-# include "uaccess_32.h"
+# include <asm/uaccess_32.h>
 #else
-# include "uaccess_64.h"
+# include <asm/uaccess_64.h>
 #endif
 
 #endif /* _ASM_X86_UACCESS_H */
arch/x86/include/asm/unistd.h +4 -4
index 2a58ed3..762be46 100644
@@ -1,13 +1,13 @@
 #ifdef __KERNEL__
 # ifdef CONFIG_X86_32
-#  include "unistd_32.h"
+#  include <asm/unistd_32.h>
 # else
-#  include "unistd_64.h"
+#  include <asm/unistd_64.h>
 # endif
 #else
 # ifdef __i386__
-#  include "unistd_32.h"
+#  include <asm/unistd_32.h>
 # else
-#  include "unistd_64.h"
+#  include <asm/unistd_64.h>
 # endif
 #endif
arch/x86/include/asm/user.h +2 -2
index 24532c7..ccab4af 100644
@@ -2,9 +2,9 @@
 #define _ASM_X86_USER_H
 
 #ifdef CONFIG_X86_32
-# include "user_32.h"
+# include <asm/user_32.h>
 #else
-# include "user_64.h"
+# include <asm/user_64.h>
 #endif
 
 #include <asm/types.h>
arch/x86/include/asm/xen/interface.h +2 -2
index 5d4922a..b85afb6 100644
@@ -114,9 +114,9 @@ struct arch_shared_info {
 #endif	/* !__ASSEMBLY__ */
 
 #ifdef CONFIG_X86_32
-#include "interface_32.h"
+#include <asm/xen/interface_32.h>
 #else
-#include "interface_64.h"
+#include <asm/xen/interface_64.h>
 #endif
 
 #ifndef __ASSEMBLY__
arch/x86/include/asm/xor.h +2 -2
index 7fcf6f3..f8fde90 100644
@@ -3,8 +3,8 @@
 # include <asm-generic/xor.h>
 #else
 #ifdef CONFIG_X86_32
-# include "xor_32.h"
+# include <asm/xor_32.h>
 #else
-# include "xor_64.h"
+# include <asm/xor_64.h>
 #endif
 #endif
include/acpi/acpi.h +9 -9
index de39915..b187b49 100644
@@ -53,14 +53,14 @@
  *
  * Note: The order of these include files is important.
  */
-#include "platform/acenv.h"	/* Environment-specific items */
-#include "acnames.h"		/* Common ACPI names and strings */
-#include "actypes.h"		/* ACPICA data types and structures */
-#include "acexcep.h"		/* ACPICA exceptions */
-#include "actbl.h"		/* ACPI table definitions */
-#include "acoutput.h"		/* Error output and Debug macros */
-#include "acrestyp.h"		/* Resource Descriptor structs */
-#include "acpiosxf.h"		/* OSL interfaces (ACPICA-to-OS) */
-#include "acpixf.h"		/* ACPI core subsystem external interfaces */
+#include <acpi/platform/acenv.h>	/* Environment-specific items */
+#include <acpi/acnames.h>		/* Common ACPI names and strings */
+#include <acpi/actypes.h>		/* ACPICA data types and structures */
+#include <acpi/acexcep.h>		/* ACPICA exceptions */
+#include <acpi/actbl.h>		/* ACPI table definitions */
+#include <acpi/acoutput.h>		/* Error output and Debug macros */
+#include <acpi/acrestyp.h>		/* Resource Descriptor structs */
+#include <acpi/acpiosxf.h>		/* OSL interfaces (ACPICA-to-OS) */
+#include <acpi/acpixf.h>		/* ACPI core subsystem external interfaces */
 
 #endif				/* __ACPI_H__ */
include/acpi/acpiosxf.h +2 -2
index a756bc8..aa7c3d6 100644
@@ -47,8 +47,8 @@
 #ifndef __ACPIOSXF_H__
 #define __ACPIOSXF_H__
 
-#include "platform/acenv.h"
-#include "actypes.h"
+#include <acpi/platform/acenv.h>
+#include <acpi/actypes.h>
 
 /* Types for acpi_os_execute */
 
include/acpi/acpixf.h +2 -2
index 2ed0a84..dae6451 100644
@@ -49,8 +49,8 @@
 
 #define ACPI_CA_VERSION                 0x20110413
 
-#include "actypes.h"
-#include "actbl.h"
+#include <acpi/actypes.h>
+#include <acpi/actbl.h>
 
 extern u8 acpi_gbl_permanent_mmap;
 
include/acpi/platform/acenv.h +1 -1
index 5af3ed5..f6cb696 100644
@@ -138,7 +138,7 @@
 /*! [Begin] no source code translation */
 
 #if defined(_LINUX) || defined(__linux__)
-#include "aclinux.h"
+#include <acpi/platform/aclinux.h>
 
 #elif defined(_AED_EFI)
 #include "acefi.h"
include/acpi/platform/aclinux.h +1 -1
index 5d2a5e9..ab69a6c 100644
@@ -108,7 +108,7 @@
 
 /* Linux uses GCC */
 
-#include "acgcc.h"
+#include <acpi/platform/acgcc.h>
 
 
 #ifdef __KERNEL__
include/drm/drm.h +1 -1
index 4be33b4..cc23e0f 100644
@@ -617,7 +617,7 @@ struct drm_get_cap {
 	__u64 value;
 };
 
-#include "drm_mode.h"
+#include <drm/drm_mode.h>
 
 #define DRM_IOCTL_BASE			'd'
 #define DRM_IO(nr)			_IO(DRM_IOCTL_BASE,nr)
include/drm/drmP.h +8 -8
index 738b3a5..00c02fc 100644
@@ -73,7 +73,7 @@
 #include <linux/workqueue.h>
 #include <linux/poll.h>
 #include <asm/pgalloc.h>
-#include "drm.h"
+#include <drm/drm.h>
 
 #include <linux/idr.h>
 
@@ -83,9 +83,9 @@
 struct drm_file;
 struct drm_device;
 
-#include "drm_os_linux.h"
-#include "drm_hashtab.h"
-#include "drm_mm.h"
+#include <drm/drm_os_linux.h>
+#include <drm/drm_hashtab.h>
+#include <drm/drm_mm.h>
 
 #define DRM_UT_CORE 		0x01
 #define DRM_UT_DRIVER		0x02
@@ -653,7 +653,7 @@ struct drm_gem_object {
 	void *driver_private;
 };
 
-#include "drm_crtc.h"
+#include <drm/drm_crtc.h>
 
 /* per-master structure */
 struct drm_master {
@@ -1258,7 +1258,7 @@ extern void drm_vm_close_locked(struct vm_area_struct *vma);
 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
 
 				/* Memory management support (drm_memory.h) */
-#include "drm_memory.h"
+#include <drm/drm_memory.h>
 extern void drm_mem_init(void);
 extern int drm_mem_info(char *buf, char **start, off_t offset,
 			int request, int *eof, void *data);
@@ -1544,7 +1544,7 @@ void drm_gem_vm_open(struct vm_area_struct *vma);
 void drm_gem_vm_close(struct vm_area_struct *vma);
 int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
 
-#include "drm_global.h"
+#include <drm/drm_global.h>
 
 static inline void
 drm_gem_object_reference(struct drm_gem_object *obj)
@@ -1650,7 +1650,7 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map)
 {
 }
 
-#include "drm_mem_util.h"
+#include <drm/drm_mem_util.h>
 
 extern int drm_fill_in_dev(struct drm_device *dev,
 			   const struct pci_device_id *ent,
include/drm/drm_buffer.h +1 -1
index 322dbff..c80d3a3 100644
@@ -35,7 +35,7 @@
 #ifndef _DRM_BUFFER_H_
 #define _DRM_BUFFER_H_
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 struct drm_buffer {
 	int iterator;
include/drm/drm_encoder_slave.h +2 -2
index 2f65633..a8d8053 100644
@@ -27,8 +27,8 @@
 #ifndef __DRM_ENCODER_SLAVE_H__
 #define __DRM_ENCODER_SLAVE_H__
 
-#include "drmP.h"
-#include "drm_crtc.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
 
 /**
  * struct drm_encoder_slave_funcs - Entry points exposed by a slave encoder driver
include/drm/drm_memory.h +1 -1
index 15af9b3..4baf57a 100644
@@ -35,7 +35,7 @@
 
 #include <linux/highmem.h>
 #include <linux/vmalloc.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /**
  * Cut down version of drm_memory_debug.h, which used to be called
include/drm/drm_sarea.h +1 -1
index ee5389d..d3aedc9 100644
@@ -32,7 +32,7 @@
 #ifndef _DRM_SAREA_H_
 #define _DRM_SAREA_H_
 
-#include "drm.h"
+#include <drm/drm.h>
 
 /* SAREA area needs to be at least a page */
 #if defined(__alpha__)
include/drm/drm_sman.h +2 -2
index 08ecf83..d333112 100644
@@ -39,8 +39,8 @@
 #ifndef DRM_SMAN_H
 #define DRM_SMAN_H
 
-#include "drmP.h"
-#include "drm_hashtab.h"
+#include <drm/drmP.h>
+#include <drm/drm_hashtab.h>
 
 /*
  * A class that is an abstration of a simple memory allocator.
include/drm/i915_drm.h +1 -1
index c4d6dbf..e458c1f 100644
@@ -27,7 +27,7 @@
 #ifndef _I915_DRM_H_
 #define _I915_DRM_H_
 
-#include "drm.h"
+#include <drm/drm.h>
 
 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
include/drm/mga_drm.h +1 -1
index fca8170..2375bfd 100644
@@ -35,7 +35,7 @@
 #ifndef __MGA_DRM_H__
 #define __MGA_DRM_H__
 
-#include "drm.h"
+#include <drm/drm.h>
 
 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the Xserver file (mga_sarea.h)
include/drm/radeon_drm.h +1 -1
index 787f7b6..a86005a 100644
@@ -33,7 +33,7 @@
 #ifndef __RADEON_DRM_H__
 #define __RADEON_DRM_H__
 
-#include "drm.h"
+#include <drm/drm.h>
 
 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the X server file (radeon_sarea.h)
include/drm/ttm/ttm_bo_api.h +1 -1
index 62a0e4c..40d3139 100644
@@ -31,7 +31,7 @@
 #ifndef _TTM_BO_API_H_
 #define _TTM_BO_API_H_
 
-#include "drm_hashtab.h"
+#include <drm/drm_hashtab.h>
 #include <linux/kref.h>
 #include <linux/list.h>
 #include <linux/wait.h>
include/drm/ttm/ttm_bo_driver.h +8 -8
index 09af2d7..859a1ef 100644
@@ -30,14 +30,14 @@
 #ifndef _TTM_BO_DRIVER_H_
 #define _TTM_BO_DRIVER_H_
 
-#include "ttm/ttm_bo_api.h"
-#include "ttm/ttm_memory.h"
-#include "ttm/ttm_module.h"
-#include "drm_mm.h"
-#include "drm_global.h"
-#include "linux/workqueue.h"
-#include "linux/fs.h"
-#include "linux/spinlock.h"
+#include <ttm/ttm_bo_api.h>
+#include <ttm/ttm_memory.h>
+#include <ttm/ttm_module.h>
+#include <drm/drm_mm.h>
+#include <drm/drm_global.h>
+#include <linux/workqueue.h>
+#include <linux/fs.h>
+#include <linux/spinlock.h>
 
 struct ttm_backend;
 
include/drm/ttm/ttm_execbuf_util.h +1 -1
index 26cc7f9..1926cae 100644
@@ -31,7 +31,7 @@
 #ifndef _TTM_EXECBUF_UTIL_H_
 #define _TTM_EXECBUF_UTIL_H_
 
-#include "ttm/ttm_bo_api.h"
+#include <ttm/ttm_bo_api.h>
 #include <linux/list.h>
 
 /**
include/drm/ttm/ttm_lock.h +1 -1
index 81ba0b0..9866968 100644
@@ -49,7 +49,7 @@
 #ifndef _TTM_LOCK_H_
 #define _TTM_LOCK_H_
 
-#include "ttm/ttm_object.h"
+#include <ttm/ttm_object.h>
 #include <linux/wait.h>
 #include <asm/atomic.h>
 
include/drm/ttm/ttm_object.h +1 -1
index 0d9db09..0d82477 100644
@@ -38,7 +38,7 @@
 #define _TTM_OBJECT_H_
 
 #include <linux/list.h>
-#include "drm_hashtab.h"
+#include <drm/drm_hashtab.h>
 #include <linux/kref.h>
 #include <ttm/ttm_memory.h>
 
include/drm/ttm/ttm_page_alloc.h +2 -2
index 8062890..7879722 100644
@@ -26,8 +26,8 @@
 #ifndef TTM_PAGE_ALLOC
 #define TTM_PAGE_ALLOC
 
-#include "ttm_bo_driver.h"
-#include "ttm_memory.h"
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_memory.h>
 
 /**
  * Get count number of pages from pool to pages list.
include/drm/via_drm.h +1 -1
index fd11a5b..45bc80c 100644
@@ -24,7 +24,7 @@
 #ifndef _VIA_DRM_H_
 #define _VIA_DRM_H_
 
-#include "drm.h"
+#include <drm/drm.h>
 
 /* WARNING: These defines must be the same as what the Xserver uses.
  * if you change them, you must change the defines in the Xserver.
include/linux/bcma/bcma.h +1 -1
index 08763e4..6d9d1cf 100644
@@ -7,7 +7,7 @@
 #include <linux/bcma/bcma_driver_chipcommon.h>
 #include <linux/bcma/bcma_driver_pci.h>
 
-#include "bcma_regs.h"
+#include <linux/bcma/bcma_regs.h>
 
 struct bcma_device;
 struct bcma_bus;
include/linux/ceph/ceph_fs.h +2 -2
index b8c6069..b8d618a 100644
@@ -12,8 +12,8 @@
 #ifndef CEPH_FS_H
 #define CEPH_FS_H
 
-#include "msgr.h"
-#include "rados.h"
+#include <linux/ceph/msgr.h>
+#include <linux/ceph/rados.h>
 
 /*
  * subprotocol versions.  when specific messages types or high-level
include/linux/ceph/debugfs.h +2 -2
index 2a79702..1df086d 100644
@@ -1,8 +1,8 @@
 #ifndef _FS_CEPH_DEBUGFS_H
 #define _FS_CEPH_DEBUGFS_H
 
-#include "ceph_debug.h"
-#include "types.h"
+#include <linux/ceph/ceph_debug.h>
+#include <linux/ceph/types.h>
 
 #define CEPH_DEFINE_SHOW_FUNC(name)					\
 static int name##_open(struct inode *inode, struct file *file)		\
include/linux/ceph/decode.h +1 -1
index c5b6939..930441d 100644
@@ -4,7 +4,7 @@
 #include <asm/unaligned.h>
 #include <linux/time.h>
 
-#include "types.h"
+#include <linux/ceph/types.h>
 
 /*
  * in all cases,
include/linux/ceph/libceph.h +7 -7
index 6365f04..54e054c 100644
@@ -1,7 +1,7 @@
 #ifndef _FS_CEPH_LIBCEPH_H
 #define _FS_CEPH_LIBCEPH_H
 
-#include "ceph_debug.h"
+#include <linux/ceph/ceph_debug.h>
 
 #include <asm/unaligned.h>
 #include <linux/backing-dev.h>
@@ -14,12 +14,12 @@
 #include <linux/writeback.h>
 #include <linux/slab.h>
 
-#include "types.h"
-#include "messenger.h"
-#include "msgpool.h"
-#include "mon_client.h"
-#include "osd_client.h"
-#include "ceph_fs.h"
+#include <linux/ceph/types.h>
+#include <linux/ceph/messenger.h>
+#include <linux/ceph/msgpool.h>
+#include <linux/ceph/mon_client.h>
+#include <linux/ceph/osd_client.h>
+#include <linux/ceph/ceph_fs.h>
 
 /*
  * Supported features
include/linux/ceph/mdsmap.h +1 -1
index 4c5cb08..3abff9e 100644
@@ -1,7 +1,7 @@
 #ifndef _FS_CEPH_MDSMAP_H
 #define _FS_CEPH_MDSMAP_H
 
-#include "types.h"
+#include <linux/ceph/types.h>
 
 /*
  * mds map - describe servers in the mds cluster.
include/linux/ceph/messenger.h +2 -2
index 31d91a6..50a785c 100644
@@ -9,8 +9,8 @@
 #include <linux/version.h>
 #include <linux/workqueue.h>
 
-#include "types.h"
-#include "buffer.h"
+#include <linux/ceph/types.h>
+#include <linux/ceph/buffer.h>
 
 struct ceph_msg;
 struct ceph_connection;
include/linux/ceph/mon_client.h +1 -1
index 545f859..6b80e63 100644
@@ -5,7 +5,7 @@
 #include <linux/kref.h>
 #include <linux/rbtree.h>
 
-#include "messenger.h"
+#include <linux/ceph/messenger.h>
 
 struct ceph_client;
 struct ceph_mount_args;
include/linux/ceph/msgpool.h +1 -1
index a362605..0d92733 100644
@@ -2,7 +2,7 @@
 #define _FS_CEPH_MSGPOOL
 
 #include <linux/mempool.h>
-#include "messenger.h"
+#include <linux/ceph/messenger.h>
 
 /*
  * we use memory pools for preallocating messages we may receive, to
include/linux/ceph/osd_client.h +3 -3
index f88eacb..caaf03a 100644
@@ -6,9 +6,9 @@
 #include <linux/mempool.h>
 #include <linux/rbtree.h>
 
-#include "types.h"
-#include "osdmap.h"
-#include "messenger.h"
+#include <linux/ceph/types.h>
+#include <linux/ceph/osdmap.h>
+#include <linux/ceph/messenger.h>
 
 struct ceph_msg;
 struct ceph_snap_context;
include/linux/ceph/osdmap.h +2 -2
index ba4c205..4ae6e27 100644
@@ -2,8 +2,8 @@
 #define _FS_CEPH_OSDMAP_H
 
 #include <linux/rbtree.h>
-#include "types.h"
-#include "ceph_fs.h"
+#include <linux/ceph/types.h>
+#include <linux/ceph/ceph_fs.h>
 #include <linux/crush/crush.h>
 
 /*
include/linux/ceph/rados.h +1 -1
index 0a99099..de91fbd 100644
@@ -6,7 +6,7 @@
  * (Reliable Autonomic Distributed Object Store).
  */
 
-#include "msgr.h"
+#include <linux/ceph/msgr.h>
 
 /*
  * osdmap encoding versions
include/linux/ceph/types.h +3 -3
index 28b35a0..d3ff1cf 100644
@@ -7,9 +7,9 @@
 #include <linux/fcntl.h>
 #include <linux/string.h>
 
-#include "ceph_fs.h"
-#include "ceph_frag.h"
-#include "ceph_hash.h"
+#include <linux/ceph/ceph_fs.h>
+#include <linux/ceph/ceph_frag.h>
+#include <linux/ceph/ceph_hash.h>
 
 /*
  * Identify inodes by both their ino AND snapshot id (a u64).
include/linux/crush/mapper.h +1 -1
index c46b99c..bfe81a5 100644
@@ -8,7 +8,7 @@
  * LGPL2
  */
 
-#include "crush.h"
+#include <linux/crush/crush.h>
 
 extern int crush_find_rule(struct crush_map *map, int pool, int type, int size);
 extern int crush_do_rule(struct crush_map *map,
include/linux/drbd_tag_magic.h +5 -5
index 0695431..82de1f9 100644
@@ -12,7 +12,7 @@ enum packet_types {
 #define NL_INT64(pn, pr, member)
 #define NL_BIT(pn, pr, member)
 #define NL_STRING(pn, pr, member, len)
-#include "drbd_nl.h"
+#include <linux/drbd_nl.h>
 	P_nl_after_last_packet,
 };
 
@@ -28,7 +28,7 @@ enum packet_types {
 #define NL_STRING(pn, pr, member, len)	\
 	unsigned char member[len]; int member ## _len; \
 	int tag_and_len ## member;
-#include "linux/drbd_nl.h"
+#include <linux/drbd_nl.h>
 
 /* declare tag-list-sizes */
 static const int tag_list_sizes[] = {
@@ -37,7 +37,7 @@ static const int tag_list_sizes[] = {
 #define NL_INT64(pn, pr, member)        + 4 + 8
 #define NL_BIT(pn, pr, member)          + 4 + 1
 #define NL_STRING(pn, pr, member, len)  + 4 + (len)
-#include "drbd_nl.h"
+#include <linux/drbd_nl.h>
 };
 
 /* The two highest bits are used for the tag type */
@@ -62,7 +62,7 @@ enum drbd_tags {
 #define NL_INT64(pn, pr, member)       T_ ## member = pn | TT_INT64   | pr ,
 #define NL_BIT(pn, pr, member)         T_ ## member = pn | TT_BIT     | pr ,
 #define NL_STRING(pn, pr, member, len) T_ ## member = pn | TT_STRING  | pr ,
-#include "drbd_nl.h"
+#include <linux/drbd_nl.h>
 };
 
 struct tag {
@@ -78,7 +78,7 @@ static const struct tag tag_descriptions[] = {
 #define NL_INT64(pn, pr, member)       [ pn ] = { #member, TT_INT64   | pr, sizeof(__u64) },
 #define NL_BIT(pn, pr, member)         [ pn ] = { #member, TT_BIT     | pr, sizeof(int)   },
 #define NL_STRING(pn, pr, member, len) [ pn ] = { #member, TT_STRING  | pr, (len)         },
-#include "drbd_nl.h"
+#include <linux/drbd_nl.h>
 };
 
 #endif
include/linux/netfilter/nf_conntrack_h323_asn1.h +1 -1
index 8dab596..3176a27 100644
@@ -40,7 +40,7 @@
 /*****************************************************************************
  * H.323 Types
  ****************************************************************************/
-#include "nf_conntrack_h323_types.h"
+#include <linux/netfilter/nf_conntrack_h323_types.h>
 
 typedef struct {
 	enum {
include/scsi/osd_attributes.h +1 -1
index 56e920a..303ba11 100644
@@ -1,7 +1,7 @@
 #ifndef __OSD_ATTRIBUTES_H__
 #define __OSD_ATTRIBUTES_H__
 
-#include "osd_protocol.h"
+#include <scsi/osd_protocol.h>
 
 /*
  * Contains types and constants that define attribute pages and attribute
include/scsi/osd_initiator.h +2 -2
index 0a50799..8463233 100644
@@ -14,8 +14,8 @@
 #ifndef __OSD_INITIATOR_H__
 #define __OSD_INITIATOR_H__
 
-#include "osd_protocol.h"
-#include "osd_types.h"
+#include <scsi/osd_protocol.h>
+#include <scsi/osd_types.h>
 
 #include <linux/blkdev.h>
 #include <scsi/scsi_device.h>
include/scsi/osd_sec.h +2 -2
index 4c09fee..f96151c 100644
@@ -14,8 +14,8 @@
 #ifndef __OSD_SEC_H__
 #define __OSD_SEC_H__
 
-#include "osd_protocol.h"
-#include "osd_types.h"
+#include <scsi/osd_protocol.h>
+#include <scsi/osd_types.h>
 
 /*
  * Contains types and constants of osd capabilities and security
include/sound/ac97_codec.h +3 -3
index 02cbb50..fdeb8dc 100644
@@ -28,9 +28,9 @@
 #include <linux/bitops.h>
 #include <linux/device.h>
 #include <linux/workqueue.h>
-#include "pcm.h"
-#include "control.h"
-#include "info.h"
+#include <sound/pcm.h>
+#include <sound/control.h>
+#include <sound/info.h>
 
 /* maximum number of devices on the AC97 bus */
 #define	AC97_BUS_MAX_DEVICES	4
include/sound/ad1816a.h +3 -3
index d010858..a7d8dc7 100644
@@ -20,9 +20,9 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */
 
-#include "control.h"
-#include "pcm.h"
-#include "timer.h"
+#include <sound/control.h>
+#include <sound/pcm.h>
+#include <sound/timer.h>
 
 #define AD1816A_REG(r)			(chip->port + r)
 
include/sound/ak4531_codec.h +2 -2
index 575296c..85ea86e 100644
@@ -25,8 +25,8 @@
  *
  */
 
-#include "info.h"
-#include "control.h"
+#include <sound/info.h>
+#include <sound/control.h>
 
 /*
  *  ASAHI KASEI - AK4531 codec
include/sound/cs46xx.h +5 -5
index e3005a6..bc246a1 100644
@@ -23,11 +23,11 @@
  *
  */
 
-#include "pcm.h"
-#include "pcm-indirect.h"
-#include "rawmidi.h"
-#include "ac97_codec.h"
-#include "cs46xx_dsp_spos.h"
+#include <sound/pcm.h>
+#include <sound/pcm-indirect.h>
+#include <sound/rawmidi.h>
+#include <sound/ac97_codec.h>
+#include <sound/cs46xx_dsp_spos.h>
 
 /*
  *  Direct registers
include/sound/cs46xx_dsp_spos.h +2 -2
index 8008c59..b4ed2b4 100644
@@ -22,8 +22,8 @@
 #ifndef __CS46XX_DSP_SPOS_H__
 #define __CS46XX_DSP_SPOS_H__
 
-#include "cs46xx_dsp_scb_types.h"
-#include "cs46xx_dsp_task_types.h"
+#include <sound/cs46xx_dsp_scb_types.h>
+#include <sound/cs46xx_dsp_task_types.h>
 
 #define SYMBOL_CONSTANT  0x0
 #define SYMBOL_SAMPLE    0x1
include/sound/cs46xx_dsp_task_types.h +1 -1
index 5cf920b..27df60e 100644
@@ -27,7 +27,7 @@
 #ifndef __CS46XX_DSP_TASK_TYPES_H__
 #define __CS46XX_DSP_TASK_TYPES_H__
 
-#include "cs46xx_dsp_scb_types.h"
+#include <sound/cs46xx_dsp_scb_types.h>
 
 /*********************************************************************************************
 Example hierarchy of stream control blocks in the SP
include/sound/emu10k1_synth.h +2 -2
index 6ef61c4..9f211e9 100644
@@ -20,8 +20,8 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include "emu10k1.h"
-#include "emux_synth.h"
+#include <sound/emu10k1.h>
+#include <sound/emux_synth.h>
 
 /* sequencer device id */
 #define SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH	"emu10k1-synth"
include/sound/emu8000.h +2 -2
index c8f66bd..c321302 100644
@@ -21,8 +21,8 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include "emux_synth.h"
-#include "seq_kernel.h"
+#include <sound/emux_synth.h>
+#include <sound/seq_kernel.h>
 
 /*
  * Hardware parameters.
include/sound/emux_legacy.h +1 -1
index 6fe3da2..baf43fc 100644
@@ -22,7 +22,7 @@
  *
  */
 
-#include "seq_oss_legacy.h"
+#include <sound/seq_oss_legacy.h>
 
 /*
  * awe hardware controls
include/sound/emux_synth.h +7 -7
index d8cb51b..fb81f37 100644
@@ -21,15 +21,15 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include "seq_kernel.h"
-#include "seq_device.h"
-#include "soundfont.h"
-#include "seq_midi_emul.h"
+#include <sound/seq_kernel.h>
+#include <sound/seq_device.h>
+#include <sound/soundfont.h>
+#include <sound/seq_midi_emul.h>
 #ifdef CONFIG_SND_SEQUENCER_OSS
-#include "seq_oss.h"
+#include <sound/seq_oss.h>
 #endif
-#include "emux_legacy.h"
-#include "seq_virmidi.h"
+#include <sound/emux_legacy.h>
+#include <sound/seq_virmidi.h>
 
 /*
  * compile flags
include/sound/es1688.h +2 -2
index 3ec7ecb..7bd4243 100644
@@ -22,8 +22,8 @@
  *
  */
 
-#include "control.h"
-#include "pcm.h"
+#include <sound/control.h>
+#include <sound/pcm.h>
 #include <linux/interrupt.h>
 
 #define ES1688_HW_AUTO		0x0000
include/sound/gus.h +5 -5
index 841bb8d..42905d8 100644
@@ -22,11 +22,11 @@
  *
  */
 
-#include "pcm.h"
-#include "rawmidi.h"
-#include "timer.h"
-#include "seq_midi_emul.h"
-#include "seq_device.h"
+#include <sound/pcm.h>
+#include <sound/rawmidi.h>
+#include <sound/timer.h>
+#include <sound/seq_midi_emul.h>
+#include <sound/seq_device.h>
 #include <asm/io.h>
 
 /* IO ports */
include/sound/mpu401.h +1 -1
index 1f1d53f..a85ce16 100644
@@ -22,7 +22,7 @@
  *
  */
 
-#include "rawmidi.h"
+#include <sound/rawmidi.h>
 #include <linux/interrupt.h>
 
 #define MPU401_HW_MPU401		1	/* native MPU401 */
include/sound/pcm.h +1 -1
index e1bad11..720402c 100644
@@ -35,7 +35,7 @@
 #define snd_pcm_chip(pcm) ((pcm)->private_data)
 
 #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
-#include "pcm_oss.h"
+#include <sound/pcm_oss.h>
 #endif
 
 /*
include/sound/rawmidi.h +1 -1
index 2480e7d..956fa35 100644
@@ -29,7 +29,7 @@
 #include <linux/mutex.h>
 
 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
-#include "seq_device.h"
+#include <sound/seq_device.h>
 #endif
 
 /*
include/sound/sb.h +2 -2
index 9535354..ba39603 100644
@@ -22,8 +22,8 @@
  *
  */
 
-#include "pcm.h"
-#include "rawmidi.h"
+#include <sound/pcm.h>
+#include <sound/rawmidi.h>
 #include <linux/interrupt.h>
 #include <asm/io.h>
 
include/sound/sb16_csp.h +2 -2
index af1b49e..7e95056 100644
@@ -119,8 +119,8 @@ struct snd_sb_csp_info {
 #define SNDRV_SB_CSP_IOCTL_RESTART	_IO('H', 0x16)
 
 #ifdef __KERNEL__
-#include "sb.h"
-#include "hwdep.h"
+#include <sound/sb.h>
+#include <sound/hwdep.h>
 #include <linux/firmware.h>
 
 struct snd_sb_csp;
include/sound/seq_kernel.h +1 -1
index 3d9afb6..34fb34c 100644
@@ -22,7 +22,7 @@
  *
  */
 #include <linux/time.h>
-#include "asequencer.h"
+#include <sound/asequencer.h>
 
 typedef struct snd_seq_real_time snd_seq_real_time_t;
 typedef union snd_seq_timestamp snd_seq_timestamp_t;
include/sound/seq_midi_emul.h +1 -1
index d6c4615..8139d8c 100644
@@ -22,7 +22,7 @@
  *
  */
 
-#include "seq_kernel.h"
+#include <sound/seq_kernel.h>
 
 /*
  * This structure is used to keep track of the current state on each
include/sound/seq_midi_event.h +1 -1
index 5efab8b..e40f43e 100644
@@ -22,7 +22,7 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include "asequencer.h"
+#include <sound/asequencer.h>
 
 #define MAX_MIDI_EVENT_BUF	256
 
include/sound/seq_oss.h +2 -2
index 9b060bb..d0b27ec 100644
@@ -21,8 +21,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include "asequencer.h"
-#include "seq_kernel.h"
+#include <sound/asequencer.h>
+#include <sound/seq_kernel.h>
 
 /*
  * argument structure for synthesizer operations
include/sound/seq_virmidi.h +2 -2
index d888433..a03acd0 100644
@@ -22,8 +22,8 @@
  *
  */
 
-#include "rawmidi.h"
-#include "seq_midi_event.h"
+#include <sound/rawmidi.h>
+#include <sound/seq_midi_event.h>
 
 /*
  * device file instance:
include/sound/snd_wavefront.h +4 -4
index fa149ca..35e94b3 100644
@@ -1,10 +1,10 @@
 #ifndef __SOUND_SND_WAVEFRONT_H__
 #define __SOUND_SND_WAVEFRONT_H__
 
-#include "mpu401.h"
-#include "hwdep.h"
-#include "rawmidi.h"
-#include "wavefront.h"  /* generic OSS/ALSA/user-level wavefront header */
+#include <sound/mpu401.h>
+#include <sound/hwdep.h>
+#include <sound/rawmidi.h>
+#include <sound/wavefront.h>  /* generic OSS/ALSA/user-level wavefront header */
 
 /* MIDI interface */
 
include/sound/soundfont.h +2 -2
index f95d99b..337ff47 100644
@@ -22,8 +22,8 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include "sfnt_info.h"
-#include "util_mem.h"
+#include <sound/sfnt_info.h>
+#include <sound/util_mem.h>
 
 #define SF_MAX_INSTRUMENTS	128	/* maximum instrument number */
 #define SF_MAX_PRESETS  256	/* drums are mapped from 128 to 256 */
include/sound/tea6330t.h +1 -1
index 51b282b..e6beec2 100644
@@ -22,7 +22,7 @@
  *
  */
 
-#include "i2c.h"		/* generic i2c support */
+#include <sound/i2c.h>		/* generic i2c support */
 
 int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer);
 int snd_tea6330t_update_mixer(struct snd_card *card, struct snd_i2c_bus *bus,
include/sound/trident.h +4 -4
index 9f191a0..9b3b03e 100644
@@ -23,10 +23,10 @@
  *
  */
 
-#include "pcm.h"
-#include "mpu401.h"
-#include "ac97_codec.h"
-#include "util_mem.h"
+#include <sound/pcm.h>
+#include <sound/mpu401.h>
+#include <sound/ac97_codec.h>
+#include <sound/util_mem.h>
 
 #define TRIDENT_DEVICE_ID_DX		((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_DX)
 #define TRIDENT_DEVICE_ID_NX		((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX)
include/sound/wss.h +4 -4
index fd01f22..0c7f034 100644
@@ -22,11 +22,11 @@
  *
  */
 
-#include "control.h"
-#include "pcm.h"
-#include "timer.h"
+#include <sound/control.h>
+#include <sound/pcm.h>
+#include <sound/timer.h>
 
-#include "cs4231-regs.h"
+#include <sound/cs4231-regs.h>
 
 /* defines for codec.mode */
 
include/sound/ymfpci.h +4 -4
index 444cd6b..5db53b6 100644
@@ -22,10 +22,10 @@
  *
  */
 
-#include "pcm.h"
-#include "rawmidi.h"
-#include "ac97_codec.h"
-#include "timer.h"
+#include <sound/pcm.h>
+#include <sound/rawmidi.h>
+#include <sound/ac97_codec.h>
+#include <sound/timer.h>
 #include <linux/gameport.h>
 
 /*
include/trace/events/compaction.h +1 -1
index 388bcdd..fde1b3e 100644
@@ -6,7 +6,7 @@
 
 #include <linux/types.h>
 #include <linux/tracepoint.h>
-#include "gfpflags.h"
+#include <trace/events/gfpflags.h>
 
 DECLARE_EVENT_CLASS(mm_compaction_isolate_template,
 
include/trace/events/kmem.h +1 -1
index a9c87ad..f0e1523 100644
@@ -6,7 +6,7 @@
 
 #include <linux/types.h>
 #include <linux/tracepoint.h>
-#include "gfpflags.h"
+#include <trace/events/gfpflags.h>
 
 DECLARE_EVENT_CLASS(kmem_alloc,
 
include/trace/events/vmscan.h +1 -1
index b2c33bd..4d50427 100644
@@ -8,7 +8,7 @@
 #include <linux/tracepoint.h>
 #include <linux/mm.h>
 #include <linux/memcontrol.h>
-#include "gfpflags.h"
+#include <trace/events/gfpflags.h>
 
 #define RECLAIM_WB_ANON		0x0001u
 #define RECLAIM_WB_FILE		0x0002u
include/xen/interface/callback.h +1 -1
index 2ae3cd2..8c5fa0e 100644
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_CALLBACK_H__
 #define __XEN_PUBLIC_CALLBACK_H__
 
-#include "xen.h"
+#include <xen/interface/xen.h>
 
 /*
  * Prototype for this hypercall is:
include/xen/interface/hvm/params.h +1 -1
index 1888d8c..f5bc22b 100644
@@ -21,7 +21,7 @@
 #ifndef __XEN_PUBLIC_HVM_PARAMS_H__
 #define __XEN_PUBLIC_HVM_PARAMS_H__
 
-#include "hvm_op.h"
+#include <xen/interface/hvm/hvm_op.h>
 
 /*
  * Parameter space for HVMOP_{set,get}_param.
include/xen/interface/io/blkif.h +2 -2
index 3d5d6db..2165651 100644
@@ -9,8 +9,8 @@
 #ifndef __XEN_PUBLIC_IO_BLKIF_H__
 #define __XEN_PUBLIC_IO_BLKIF_H__
 
-#include "ring.h"
-#include "../grant_table.h"
+#include <xen/interface/io/ring.h>
+#include <xen/interface/grant_table.h>
 
 /*
  * Front->back notifications: When enqueuing a new request, sending a
include/xen/interface/io/netif.h +2 -2
index cb94668..9dfc120 100644
@@ -9,8 +9,8 @@
 #ifndef __XEN_PUBLIC_IO_NETIF_H__
 #define __XEN_PUBLIC_IO_NETIF_H__
 
-#include "ring.h"
-#include "../grant_table.h"
+#include <xen/interface/io/ring.h>
+#include <xen/interface/grant_table.h>
 
 /*
  * Notifications after enqueuing any type of message should be conditional on
include/xen/interface/sched.h +1 -1
index dd55dac..9ce0839 100644
@@ -9,7 +9,7 @@
 #ifndef __XEN_PUBLIC_SCHED_H__
 #define __XEN_PUBLIC_SCHED_H__
 
-#include "event_channel.h"
+#include <xen/interface/event_channel.h>
 
 /*
  * The prototype for this hypercall is:
include/xen/interface/version.h +1 -1
index e8b6519..ff372a5 100644
@@ -55,7 +55,7 @@ struct xen_feature_info {
 };
 
 /* Declares the features reported by XENVER_get_features. */
-#include "features.h"
+#include <xen/interface/features.h>
 
 /* arg == NULL; returns host memory page size. */
 #define XENVER_pagesize 7
#3 lore raw

PATCH 1/1 03/39] UAPI: Add script to audit drivers/gpu/ for #including system headers with "..."

In reply to David Howells

Add a script to audit drivers/gpu/ for #include "..." referring to system headers and change them to <...>.

---

 scripts/uapi-disintegration/drm-headers.pl |  105 ++++++++++++++++++++++++++++
 1 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100755 scripts/uapi-disintegration/drm-headers.pl
scripts/uapi-disintegration/drm-headers.pl new file +105 -0
new file mode 100755
index 0000000..09ba790
@@ -0,0 +1,105 @@
+#!/usr/bin/perl -w
+
+use File::Find;
+
+#
+# Changes must be committed first
+#
+system("git diff --quiet") == 0 or die "Uncommitted changes; aborting\n";
+
+#
+# Delete the old patch under StGIT
+#
+system("stg delete uapi-convert-drivers_gpu-includes.diff");
+
+#
+# Set up the patch under StGIT
+#
+system("stg new -m '" .
+       "UAPI: Convert #include \"...\" to #include <path/...> in kernel system headers\n" .
+       "\n" .
+       "Convert #include \"...\" to #include <path/...> in kernel system headers.\n" .
+       "\n" .
+       "scripts/uapi-disintegrate/drm-headers.pl was used\n" .
+       "\n" .
+       "Signed-off-by: David Howells <dhowells\@redhat.com>\n" .
+       "' uapi-convert-drivers_gpu-includes.diff"
+    ) == 0 or die;
+
+#
+# Find all the .c and .h files under drivers/gpu/
+#
+%files = ();
+sub find_file()
+{
+    $files{$File::Find::name} = 1 if ($_ =~ /[.][ch]$/);
+}
+
+find(\&find_file, "drivers/gpu");
+
+#print join("\n", sort keys %files), "\n";
+
+foreach my $file (sort keys %files) {
+    my $dir = $file;
+    $dir =~ m@(^.*/)@, $dir = $1;
+
+    open FD, '<', $file or die "open $file: $!\n";
+    my @lines = <FD>;
+    close FD or die;
+
+    my $printed_name = 0;
+    my $alter_file = 0;
+
+    for (my $l = 0; $l <= $#lines; $l++) {
+	my $line = $lines[$l];
+
+	if ($line =~ /^(#\s*include\s+)["]([^"]+)["](.*[\n])/) {
+	    my $pre = $1;
+	    my $name = $2;
+	    my $post = $3;
+
+	    # If the included file really is in this directory, then "..." is
+	    # correct.
+	    next if (-f $dir.$2);
+
+	    if (!$printed_name) {
+		print "[[[ \e[36m$file\e[m ]]]\n";
+		$printed_name = 1;
+	    }
+
+	    my $path = "??";
+
+	    if ($name =~ m@[.][.]@) {
+		die;
+	    } else {
+		# Look in the system include paths for it
+		if (-f "include/$name") {
+		    $path = $name;
+		} elsif (-f "include/drm/$name") {
+		    $path = "drm/$name";
+		} else {
+		    die;
+		}
+	    }
+
+	    print $file, ": ", $name, " -> ", $path, "\n";
+	    $lines[$l] = $pre . "<" . $path . ">" . $post;
+	    $alter_file = 1;
+	}
+    }
+
+    if ($alter_file) {
+	my $temp = $file . ".drminc";
+	open FD, '>', $temp or die "create $temp: $!\n";
+	print FD @lines or die "write $temp: $!\n";
+	close FD or die "close $temp: $!\n";
+	rename $temp, $file or die "move $temp -> $file: $!\n";
+    }
+}
+
+#
+# Commit the changes
+#
+system("stg ref") == 0 or die;
+
+exit 0;
#4 lore raw

PATCH 1/1 05/39] UAPI: Add include/uapi/ directories to build

In reply to David Howells

Add include/uapi/ directories to build after the ordinary include directories so that #include will pick up the UAPI header directly if the kernel header has been moved there.

---

 Makefile |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
Makefile +6 -2
index 86f47a0..b66bab5 100644
@@ -357,8 +357,12 @@ CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage
 
 # Use LINUXINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
-LINUXINCLUDE    := -I$(srctree)/arch/$(hdr-arch)/include \
-                   -Iarch/$(hdr-arch)/include/generated -Iinclude \
+LINUXINCLUDE    := \
+		-I$(srctree)/arch/$(hdr-arch)/include \
+		-Iarch/$(hdr-arch)/include/generated \
+		-I$(srctree)/arch/$(hdr-arch)/include/uapi \
+		-Iinclude \
+		-Iinclude/uapi \
                    $(if $(KBUILD_SRC), -I$(srctree)/include) \
                    -include include/generated/autoconf.h
 
#5 lore raw

PATCH 1/1 06/39] UAPI: Differentiate userspace build and kernelspace build include path sets

In reply to David Howells

Differentiate userspace build and kernelspace build (LINUXINCLUDE) include path sets by adding a new make variable (USERINCLUDE) that has everything barring the kernel-specific include paths, and then make LINUXINCLUDE simply preface that with the kernel-specific include paths.

Then use USERINCLUDE in building the x86 boot code.

---

 Makefile                          |   12 ++++++++----
 arch/x86/boot/Makefile            |    4 ++--
 arch/x86/boot/mkcpustr.c          |    2 ++
 arch/x86/include/asm/cpufeature.h |    2 ++
 arch/x86/kernel/cpu/mkcapflags.pl |    5 ++++-
 5 files changed, 18 insertions(+), 7 deletions(-)
Makefile +8 -4
index b66bab5..0fe2209 100644
@@ -355,16 +355,20 @@ AFLAGS_KERNEL	=
 CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage
 
 
+# Use USERINCLUDE when you must reference the UAPI directories only.
+USERINCLUDE    := \
+		-I$(srctree)/arch/$(hdr-arch)/include/uapi \
+		-Iinclude/uapi \
+                   $(if $(KBUILD_SRC), -I$(srctree)/include) \
+                   -include include/generated/autoconf.h
+
 # Use LINUXINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
 LINUXINCLUDE    := \
 		-I$(srctree)/arch/$(hdr-arch)/include \
 		-Iarch/$(hdr-arch)/include/generated \
-		-I$(srctree)/arch/$(hdr-arch)/include/uapi \
 		-Iinclude \
-		-Iinclude/uapi \
-                   $(if $(KBUILD_SRC), -I$(srctree)/include) \
-                   -include include/generated/autoconf.h
+		$(USERINCLUDE)
 
 KBUILD_CPPFLAGS := -D__KERNEL__
 
arch/x86/boot/Makefile +2 -2
index f7cb086..84592cf 100644
@@ -43,7 +43,7 @@ setup-y		+= video-bios.o
 targets		+= $(setup-y)
 hostprogs-y	:= mkcpustr tools/build
 
-HOST_EXTRACFLAGS += $(LINUXINCLUDE)
+HOST_EXTRACFLAGS += $(USERINCLUDE)
 
 $(obj)/cpu.o: $(obj)/cpustr.h
 
@@ -57,7 +57,7 @@ $(obj)/cpustr.h: $(obj)/mkcpustr FORCE
 
 # How to compile the 16-bit code.  Note we always compile for -march=i386,
 # that way we can complain to the user if the CPU is insufficient.
-KBUILD_CFLAGS	:= $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
+KBUILD_CFLAGS	:= $(USERINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
 		   -DDISABLE_BRANCH_PROFILING \
 		   -Wall -Wstrict-prototypes \
 		   -march=i386 -mregparm=3 \
arch/x86/boot/mkcpustr.c +2 -0
index 919257f..4579eff 100644
@@ -15,6 +15,8 @@
 
 #include <stdio.h>
 
+#include "../include/asm/required-features.h"
+#include "../include/asm/cpufeature.h"
 #include "../kernel/cpu/capflags.c"
 
 int main(void)
arch/x86/include/asm/cpufeature.h +2 -0
index 71cc380..eba9354 100644
@@ -4,7 +4,9 @@
 #ifndef _ASM_X86_CPUFEATURE_H
 #define _ASM_X86_CPUFEATURE_H
 
+#ifndef _ASM_X86_REQUIRED_FEATURES_H
 #include <asm/required-features.h>
+#endif
 
 #define NCAPINTS	10	/* N 32-bit words worth of info */
 
arch/x86/kernel/cpu/mkcapflags.pl +4 -1
index dfea390..6c3c4f1 100644
@@ -8,7 +8,10 @@
 open(IN, "< $in\0")   or die "$0: cannot open: $in: $!\n";
 open(OUT, "> $out\0") or die "$0: cannot create: $out: $!\n";
 
-print OUT "#include <asm/cpufeature.h>\n\n";
+print OUT "#ifndef _ASM_X86_CPUFEATURE_H\n";
+print OUT "#include <asm/cpufeature.h>\n";
+print OUT "#endif\n";
+print OUT "\n";
 print OUT "const char * const x86_cap_flags[NCAPINTS*32] = {\n";
 
 while (defined($line = <IN>)) {
#6 lore raw

PATCH 1/1 07/39] UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed

In reply to David Howells

---

 include/linux/acct.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/linux/acct.h +3 -0
index 3e4737f..d537aa0 100644
@@ -146,6 +146,9 @@ extern void acct_exit_ns(struct pid_namespace *);
  *
  */
 
+#undef ACCT_VERSION
+#undef AHZ
+
 #ifdef CONFIG_BSD_PROCESS_ACCT_V3
 #define ACCT_VERSION	3
 #define AHZ		100
#7 lore raw

PATCH 1/1 08/39] UAPI: ac_etime in linux/acct.h must keep its __KERNEL__ guards

In reply to David Howells

ac_etime in linux/acct.h must keep its __KERNEL__ guards.

---

 include/linux/acct.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/acct.h +1 -1
index d537aa0..55e88b5 100644
@@ -81,7 +81,7 @@ struct acct_v3
 	__u32		ac_pid;			/* Process ID */
 	__u32		ac_ppid;		/* Parent Process ID */
 	__u32		ac_btime;		/* Process Creation Time */
-#ifdef __KERNEL__
+#ifdef __KERNEL__ // DISINTEGRATE: RETAIN
 	__u32		ac_etime;		/* Elapsed Time */
 #else
 	float		ac_etime;		/* Elapsed Time */
#8 lore raw

PATCH 1/1 09/39] UAPI: Make linux/patchkey.h easier to parse

In reply to David Howells

Make linux/patchkey.h easier to parse by:

(1) Switching the reinclusion guard and the indirect-inclusion checks in linux/patchkey.h to put the guard around the outside.

(2) Making the #elif case associated with the __KERNEL__ guard a nested #if in a #else of the __KERNEL__ guard.

---

 include/linux/patchkey.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
include/linux/patchkey.h +3 -1
index d974a6e..aefda0e 100644
@@ -32,7 +32,8 @@
 #  else
 #    error "could not determine byte order"
 #  endif
-#elif defined(__BYTE_ORDER)
+#else
+#if defined(__BYTE_ORDER)
 #  if __BYTE_ORDER == __BIG_ENDIAN
 #    define _PATCHKEY(id) (0xfd00|id)
 #  elif __BYTE_ORDER == __LITTLE_ENDIAN
@@ -41,5 +42,6 @@
 #    error "could not determine byte order"
 #  endif
 #endif
+#endif
 
 #endif /* _LINUX_PATCHKEY_H */
#9 lore raw

PATCH 1/1 10/39] UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h

In reply to David Howells

Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h to make parsing easier.

---

 include/linux/soundcard.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
include/linux/soundcard.h +3 -1
index fe204fe..dfcf86f 100644
@@ -198,7 +198,8 @@ typedef struct seq_event_rec {
 #  else
 #    error "could not determine byte order"
 #  endif
-#elif defined(__BYTE_ORDER)
+#else
+# if defined(__BYTE_ORDER)
 #  if __BYTE_ORDER == __BIG_ENDIAN
 #    define AFMT_S16_NE AFMT_S16_BE
 #  elif __BYTE_ORDER == __LITTLE_ENDIAN
@@ -206,6 +207,7 @@ typedef struct seq_event_rec {
 #  else
 #    error "could not determine byte order"
 #  endif
+# endif
 #endif
 
 /*
#10 lore raw

PATCH 1/1 11/39] UAPI: Fix nested __KERNEL__ guards in video/edid.h

In reply to David Howells

Fix nested __KERNEL__ guards in video/edid.h to make parsing easier.

---

 include/video/edid.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
include/video/edid.h +2 -4
index 928c342..c5f1987 100644
@@ -1,16 +1,14 @@
 #ifndef __linux_video_edid_h__
 #define __linux_video_edid_h__
 
-#if !defined(__KERNEL__) || defined(CONFIG_X86)
-
 struct edid_info {
 	unsigned char dummy[128];
 };
 
 #ifdef __KERNEL__
+#ifdef CONFIG_X86
 extern struct edid_info edid_info;
-#endif /* __KERNEL__ */
-
+#endif
 #endif
 
 #endif /* __linux_video_edid_h__ */
#11 lore raw

PATCH 1/1 12/39] UAPI: Split trivial #if defined(__KERNEL__) && X conditionals

In reply to David Howells

Split trivial #if defined(__KERNEL__) && X conditionals to make automated disintegration easier.

---

 arch/arm/include/asm/hwcap.h       |    4 +++-
 arch/arm/include/asm/swab.h        |    7 +++++--
 arch/arm/include/asm/unistd.h      |    4 +++-
 arch/ia64/include/asm/intrinsics.h |   21 +++++++++++++--------
 arch/mips/include/asm/types.h      |   10 +++++++---
 arch/s390/include/asm/mman.h       |    4 +++-
 arch/tile/include/asm/signal.h     |    4 +++-
 include/linux/mroute6.h            |    4 +++-
 8 files changed, 40 insertions(+), 18 deletions(-)
arch/arm/include/asm/hwcap.h +3 -1
index c1062c3..aedc859 100644
@@ -21,7 +21,8 @@
 #define HWCAP_VFPv3D16	16384
 #define HWCAP_TLS	32768
 
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#if defined(__KERNEL__)
+#if !defined(__ASSEMBLY__)
 /*
  * This yields a mask that user programs can use to figure out what
  * instruction set this cpu supports.
@@ -29,5 +30,6 @@
 #define ELF_HWCAP	(elf_hwcap)
 extern unsigned int elf_hwcap;
 #endif
+#endif
 
 #endif
arch/arm/include/asm/swab.h +5 -2
index 9997ad2..e82adf6 100644
@@ -22,7 +22,8 @@
 #  define __SWAB_64_THRU_32__
 #endif
 
-#if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6
+#if defined(__KERNEL__)
+#if __LINUX_ARM_ARCH__ >= 6
 
 static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
 {
@@ -38,8 +39,10 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 }
 #define __arch_swab32 __arch_swab32
 
-#else
+#endif
+#endif
 
+#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
 static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 {
 	__u32 t;
arch/arm/include/asm/unistd.h +3 -1
index 2c04ed5..59d0f02 100644
@@ -425,7 +425,8 @@
 /*
  * The following syscalls are obsolete and no longer available for EABI.
  */
-#if defined(__ARM_EABI__) && !defined(__KERNEL__)
+#if !defined(__KERNEL__)
+#if defined(__ARM_EABI__)
 #undef __NR_time
 #undef __NR_umount
 #undef __NR_stime
@@ -439,6 +440,7 @@
 #undef __NR_syscall
 #undef __NR_ipc
 #endif
+#endif
 
 #ifdef __KERNEL__
 
arch/ia64/include/asm/intrinsics.h +13 -8
index 111ed52..e4076b5 100644
@@ -201,16 +201,21 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void);
 #endif
 
 #ifndef __ASSEMBLY__
-#if defined(CONFIG_PARAVIRT) && defined(__KERNEL__)
-#ifdef ASM_SUPPORTED
-# define IA64_INTRINSIC_API(name)	paravirt_ ## name
-#else
-# define IA64_INTRINSIC_API(name)	pv_cpu_ops.name
-#endif
-#define IA64_INTRINSIC_MACRO(name)	paravirt_ ## name
-#else
+
 #define IA64_INTRINSIC_API(name)	ia64_native_ ## name
 #define IA64_INTRINSIC_MACRO(name)	ia64_native_ ## name
+
+#if defined(__KERNEL__)
+#if defined(CONFIG_PARAVIRT)
+# undef IA64_INTRINSIC_API
+# undef IA64_INTRINSIC_MACRO
+# ifdef ASM_SUPPORTED
+#  define IA64_INTRINSIC_API(name)	paravirt_ ## name
+# else
+#  define IA64_INTRINSIC_API(name)	pv_cpu_ops.name
+# endif
+#define IA64_INTRINSIC_MACRO(name)	paravirt_ ## name
+#endif
 #endif
 
 /************************************************/
arch/mips/include/asm/types.h +7 -3
index 533812b..9b96461 100644
@@ -15,10 +15,14 @@
  * We don't use int-l64.h for the kernel anymore but still use it for
  * userspace to avoid code changes.
  */
-#if (_MIPS_SZLONG == 64) && !defined(__KERNEL__)
-# include <asm-generic/int-l64.h>
-#else
+#ifdef __KERNEL__
 # include <asm-generic/int-ll64.h>
+#else
+# if _MIPS_SZLONG == 64
+#  include <asm-generic/int-l64.h>
+# else
+#  include <asm-generic/int-ll64.h>
+# endif
 #endif
 
 #ifndef __ASSEMBLY__
arch/s390/include/asm/mman.h +3 -1
index 4e9c8ae..d49760e 100644
@@ -11,9 +11,11 @@
 
 #include <asm-generic/mman.h>
 
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
+#if defined(__KERNEL__)
+#if !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
 int s390_mmap_check(unsigned long addr, unsigned long len);
 #define arch_mmap_check(addr,len,flags)	s390_mmap_check(addr,len)
 #endif
+#endif
 
 #endif /* __S390_MMAN_H__ */
arch/tile/include/asm/signal.h +3 -1
index 1e1e616..1e5e49a 100644
@@ -23,7 +23,8 @@
 
 #include <asm-generic/signal.h>
 
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#if defined(__KERNEL__)
+#if !defined(__ASSEMBLY__)
 struct pt_regs;
 int restore_sigcontext(struct pt_regs *, struct sigcontext __user *);
 int setup_sigcontext(struct sigcontext __user *, struct pt_regs *);
@@ -33,5 +34,6 @@ void signal_fault(const char *type, struct pt_regs *,
 void trace_unhandled_signal(const char *type, struct pt_regs *regs,
 			    unsigned long address, int signo);
 #endif
+#endif
 
 #endif /* _ASM_TILE_SIGNAL_H */
include/linux/mroute6.h +3 -1
index a3759cb..6d8c725 100644
@@ -43,9 +43,11 @@ typedef unsigned short mifi_t;
 typedef	__u32		if_mask;
 #define NIFBITS (sizeof(if_mask) * 8)        /* bits per mask */
 
-#if !defined(__KERNEL__) && !defined(DIV_ROUND_UP)
+#if !defined(__KERNEL__)
+#if !defined(DIV_ROUND_UP)
 #define	DIV_ROUND_UP(x,y)	(((x) + ((y) - 1)) / (y))
 #endif
+#endif
 
 typedef struct if_set {
 	if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
#12 lore raw

PATCH 1/1 13/39] UAPI: Remove the inclusion of linux/types.h from x86's asm/page.h

In reply to David Howells

Remove the inclusion of linux/types.h from x86's asm/page.h as it's included via asm/page_types.h. Make asm/page_types.h's inclusion dependent on not being in assembly.

---

 arch/x86/include/asm/page.h       |    2 --
 arch/x86/include/asm/page_types.h |    3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/include/asm/page.h +0 -2
index 8ca8283..d4ee8d8 100644
@@ -1,8 +1,6 @@
 #ifndef _ASM_X86_PAGE_H
 #define _ASM_X86_PAGE_H
 
-#include <linux/types.h>
-
 #ifdef __KERNEL__
 
 #include <asm/page_types.h>
arch/x86/include/asm/page_types.h +3 -0
index bce688d..eeff662 100644
@@ -2,7 +2,10 @@
 #define _ASM_X86_PAGE_DEFS_H
 
 #include <linux/const.h>
+
+#ifndef __ASSEMBLY__
 #include <linux/types.h>
+#endif
 
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT	12
#13 lore raw

PATCH 1/1 14/39] UAPI: Fix definition of HZ in asm-generic/param.h

In reply to David Howells

Fix definition of HZ in asm-generic/param.h so that the user-specific one is #undef'd before the kernel-specific one is defined.

---

 include/asm-generic/param.h |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
include/asm-generic/param.h +7 -6
index cdf8251..835632a 100644
@@ -1,12 +1,6 @@
 #ifndef __ASM_GENERIC_PARAM_H
 #define __ASM_GENERIC_PARAM_H
 
-#ifdef __KERNEL__
-# define HZ		CONFIG_HZ	/* Internal kernel timer frequency */
-# define USER_HZ	100		/* some user interfaces are */
-# define CLOCKS_PER_SEC	(USER_HZ)       /* in "ticks" like times() */
-#endif
-
 #ifndef HZ
 #define HZ 100
 #endif
@@ -21,4 +15,11 @@
 
 #define MAXHOSTNAMELEN	64	/* max length of hostname */
 
+#ifdef __KERNEL__
+# undef HZ
+# define HZ		CONFIG_HZ	/* Internal kernel timer frequency */
+# define USER_HZ	100		/* some user interfaces are */
+# define CLOCKS_PER_SEC	(USER_HZ)       /* in "ticks" like times() */
+#endif
+
 #endif /* __ASM_GENERIC_PARAM_H */
#14 lore raw

PATCH 1/1 15/39] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace

In reply to David Howells

elf_read_implies_exec() is a kernel-only feature as the second parameter is a constant that isn't exported to userspace. Not only that, but the arch-specific overrides are not exported either.

So hide the macro from userspace.

Similarly, struct file should not be predeclared in userspace.

---

 include/linux/elf.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
include/linux/elf.h +9 -9
index 110821c..411d7b8 100644
@@ -7,15 +7,6 @@
 #include <asm/elf.h>
 #endif
 
-struct file;
-
-#ifndef elf_read_implies_exec
-  /* Executables for which elf_read_implies_exec() returns TRUE will
-     have the READ_IMPLIES_EXEC personality flag set automatically.
-     Override in asm/elf.h as needed.  */
-# define elf_read_implies_exec(ex, have_pt_gnu_stack)	0
-#endif
-
 /* 32-bit ELF base types. */
 typedef __u32	Elf32_Addr;
 typedef __u16	Elf32_Half;
@@ -413,6 +404,13 @@ typedef struct elf64_note {
 } Elf64_Nhdr;
 
 #ifdef __KERNEL__
+#ifndef elf_read_implies_exec
+  /* Executables for which elf_read_implies_exec() returns TRUE will
+     have the READ_IMPLIES_EXEC personality flag set automatically.
+     Override in asm/elf.h as needed.  */
+# define elf_read_implies_exec(ex, have_pt_gnu_stack)	0
+#endif
+
 #if ELF_CLASS == ELFCLASS32
 
 extern Elf32_Dyn _DYNAMIC [];
@@ -436,6 +434,8 @@ extern Elf64_Dyn _DYNAMIC [];
 #endif
 
 /* Optional callbacks to write extra ELF notes. */
+struct file;
+
 #ifndef ARCH_HAVE_EXTRA_ELF_NOTES
 static inline int elf_coredump_extra_notes_size(void) { return 0; }
 static inline int elf_coredump_extra_notes_write(struct file *file,
#15 lore raw

PATCH 1/1 16/39] UAPI: Fix sigset_t ordering problem

In reply to David Howells

There's an ordering problem around the definition of sigset_t: the definition in the kernel-specific header is referred to in the user-specific header data structures, at least for x86. When compiling userspace, the user-specific header provides an alternate version of sigset_t.

To get around this problem, place a marker specifically to indicate the point at which the #include_next should be placed in the kernel-specific file.

---

 arch/x86/include/asm/signal.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/include/asm/signal.h +2 -0
index 598457c..40ef827 100644
@@ -40,6 +40,8 @@ typedef unsigned long sigset_t;
 #endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 
+// DISINTEGRATE: INCLUDE UAPI HERE
+
 #define SIGHUP		 1
 #define SIGINT		 2
 #define SIGQUIT		 3
#16 lore raw

PATCH 1/1 17/39] UAPI: Fix E820_X_MAX ordering problem

In reply to David Howells

There's an ordering problem around the definition of E820_X_MAX: the definition in the kernel-specific header is referred to in the user-specific header data structures, at least for x86. When compiling userspace, the user-specific header provides an alternate version of E820_X_MAX.

To get around this problem, place a marker specifically to indicate the point at which the #include_next should be placed in the kernel-specific file.

---

 arch/x86/include/asm/e820.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/include/asm/e820.h +2 -0
index 908b969..e02512f 100644
@@ -45,6 +45,8 @@
 #define E820_NVS	4
 #define E820_UNUSABLE	5
 
+// DISINTEGRATE: INCLUDE UAPI HERE
+
 /*
  * reserved RAM used by kernel itself
  * if CONFIG_INTEL_TXT is enabled, memory of this type will be
#17 lore raw

PATCH 1/1 18/39] UAPI: Fix linux/netfilter.h inclusion order

In reply to David Howells

Fix linux/netfilter.h inclusion order to make sure that the inclusion of the user-specific file happens after the inclusion of the header file that provides struct in_addr and struct in6_addr.

To get around this problem, place a marker specifically to indicate the point at which the #include_next should be placed in the kernel-specific file.

---

 include/linux/netfilter.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/netfilter.h +2 -0
index 857f502..4faf53d 100644
@@ -15,6 +15,8 @@
 #include <linux/compiler.h>
 #include <linux/sysctl.h>
 
+// DISINTEGRATE: INCLUDE UAPI HERE
+
 /* Responses from hook functions. */
 #define NF_DROP 0
 #define NF_ACCEPT 1
#18 lore raw

PATCH 1/1 19/39] UAPI: Fix linux/input.h inclusion order

In reply to David Howells

Fix linux/input.h inclusion order to make sure that the inclusion of the user-specific file happens after the inclusion of the header file that provides struct timeval.

To get around this problem, place a marker specifically to indicate the point at which the #include_next should be placed in the kernel-specific file.

---

 include/linux/input.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/input.h +2 -0
index 771d6d8..ad6a33f 100644
@@ -19,6 +19,8 @@
 #include <linux/types.h>
 #endif
 
+// DISINTEGRATE: INCLUDE UAPI HERE
+
 /*
  * The event structure itself
  */
#19 lore raw

PATCH 1/1 20/39] UAPI: Fix up linux/netfilter/xt_policy.h

In reply to David Howells

Fix up linux/netfilter/xt_policy.h to make it splittable. This requires a mark to be placed on the #ifdef __KERNEL__ in struct xt_policy_elem to tell the splitter to ignore it.

Would it be possible, I wonder, to rename union nf_inet_addr to xt_policy_addr instead?

---

 include/linux/netfilter/xt_policy.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/netfilter/xt_policy.h +1 -1
index be8ead0..573da52 100644
@@ -35,7 +35,7 @@ union xt_policy_addr {
 
 struct xt_policy_elem {
 	union {
-#ifdef __KERNEL__
+#ifdef __KERNEL__ // DISINTEGRATE: RETAIN
 		struct {
 			union nf_inet_addr saddr;
 			union nf_inet_addr smask;
#20 lore raw

PATCH 1/1 21/39] UAPI: Fix linux/auto_fs.h inclusion order

In reply to David Howells

Fix linux/auto_fs.h inclusion order to make sure that the inclusion of the user-specific file happens after the inclusion of the header file that provides NAME_MAX.

To get around this problem, place a marker specifically to indicate the point at which the #include_next should be placed in the kernel-specific file.

---

 include/linux/auto_fs.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/auto_fs.h +2 -0
index da64e15..f9ca4e6 100644
@@ -23,6 +23,8 @@
 #include <sys/ioctl.h>
 #endif /* __KERNEL__ */
 
+// DISINTEGRATE: INCLUDE UAPI HERE
+
 /* This file describes autofs v3 */
 #define AUTOFS_PROTO_VERSION	3
 
#21 lore raw

PATCH 1/1 22/39] UAPI: Fix drmP.h to use #include <...> when referring to system header files

In reply to David Howells

Fix drmP.h to use #include <...> when referring to system header files, otherwise #include_next breaks.

---

 include/drm/drmP.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
include/drm/drmP.h +10 -0
index 00c02fc..fc13402 100644
@@ -73,7 +73,11 @@
 #include <linux/workqueue.h>
 #include <linux/poll.h>
 #include <asm/pgalloc.h>
+#ifdef __KERNEL__
 #include <drm/drm.h>
+#else
+#include "drm.h"
+#endif
 
 #include <linux/idr.h>
 
@@ -83,9 +87,15 @@
 struct drm_file;
 struct drm_device;
 
+#ifdef __KERNEL__
 #include <drm/drm_os_linux.h>
 #include <drm/drm_hashtab.h>
 #include <drm/drm_mm.h>
+#else
+#include "drm_os_linux.h"
+#include "drm_hashtab.h"
+#include "drm_mm.h"
+#endif
 
 #define DRM_UT_CORE 		0x01
 #define DRM_UT_DRIVER		0x02
#22 lore raw

PATCH 1/1 23/39] UAPI: sound/sound_core.c should include linux/fs.h

In reply to David Howells

sound/sound_core.c should include linux/fs.h to get the definition of struct file_operations.

---

 sound/sound_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/sound_core.c +1 -0
index 6ce2778..b6bc127 100644
@@ -12,6 +12,7 @@
 #include <linux/err.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
+#include <linux/fs.h>
 #include <sound/core.h>
 
 #ifdef CONFIG_SOUND_OSS_CORE
#23 lore raw

PATCH 1/1 24/39] UAPI: Fix SNDRV_*_ENDIAN ordering problem

In reply to David Howells

There's an ordering problem around the definition of SNDRV_*_ENDIAN: the definition in the kernel-specific header is referred to in the user-specific header data structures.

To get around this problem, place a marker specifically to indicate the point at which the #include_next should be placed in the kernel-specific file.

---

 include/sound/asound.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/sound/asound.h +1 -0
index 5d6074f..e4918f6 100644
@@ -40,6 +40,7 @@
 #endif
 #endif
 
+// DISINTEGRATE: INCLUDE UAPI HERE
 #endif /* __KERNEL__ **/
 
 /*
#24 lore raw

PATCH 1/1 25/39] UAPI: Fix u_quad_t ordering problem in linux/coda.h

In reply to David Howells

There's an ordering problem around the definition of u_quad_t in linux/coda.h:
the definition in the kernel-specific header is referred to in the user-specific header data structures. When compiling userspace, the user-specific header provides an alternate version of u_quad_t.

To get around this problem, place a marker specifically to indicate the point at which the #include_next should be placed in the kernel-specific file.

---

 include/linux/coda.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/coda.h +1 -0
index 96c8769..5a2c1a0 100644
@@ -111,6 +111,7 @@ typedef unsigned long long u_quad_t;
 #else
 #define cdev_t dev_t
 #endif
+// DISINTEGRATE: INCLUDE UAPI HERE
 
 #ifdef __CYGWIN32__
 struct timespec {
#25 lore raw

PATCH 1/1 26/39] UAPI: Fix linux/coda.h

In reply to David Howells

Fix linux/coda.h to retain the #ifdef __KERNEL__ in struct coda_open_by_fd_out in the userspace struct rather than splitting that member out into a separate header.

This is done by placing a marker to manually control the splitter script.

---

 include/linux/coda.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/coda.h +1 -1
index 5a2c1a0..2ae9dcd 100644
@@ -618,7 +618,7 @@ struct coda_open_by_fd_out {
     struct coda_out_hdr oh;
     int fd;
 
-#ifdef __KERNEL__
+#ifdef __KERNEL__ // DISINTEGRATE: RETAIN
     struct file *fh; /* not passed from userspace but used in-kernel only */
 #endif
 };
#26 lore raw

PATCH 1/1 27/39] UAPI: Guard linux/isdn_divertif.h

In reply to David Howells

Place reinclusion guards on linux/isdn_divertif.h otherwise the splitter script won't insert a #include_next.

---

 include/linux/isdn_divertif.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/isdn_divertif.h +4 -0
index 07821ca..a5a50f5 100644
@@ -10,6 +10,8 @@
  *
  */
 
+#ifndef _LINUX_ISDN_DIVERTIF_H
+#define _LINUX_ISDN_DIVERTIF_H
 
 /***********************************************************/
 /* magic value is also used to control version information */
@@ -45,3 +47,5 @@ typedef struct
 /*********************/
 extern int DIVERT_REG_NAME(isdn_divert_if *);
 #endif
+
+#endif /* _LINUX_ISDN_DIVERTIF_H */
#27 lore raw

PATCH 1/1 28/39] UAPI: Guard linux/sound.h

In reply to David Howells

Place reinclusion guards on linux/sound.h otherwise the splitter script won't insert a #include_next.

---

 include/linux/sound.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/sound.h +4 -0
index 44dcf05..fae20ba 100644
@@ -1,3 +1,5 @@
+#ifndef _LINUX_SOUND_H
+#define _LINUX_SOUND_H
 
 /*
  * Minor numbers for the sound driver.
@@ -42,3 +44,5 @@ extern void unregister_sound_mixer(int unit);
 extern void unregister_sound_midi(int unit);
 extern void unregister_sound_dsp(int unit);
 #endif /* __KERNEL__ */
+
+#endif /* _LINUX_SOUND_H */
#28 lore raw

PATCH 1/1 29/39] UAPI: Fix linux/ncp.h

In reply to David Howells

Fix linux/coda.h to retain the #ifdef __KERNEL__ in struct nw_info_struct in the userspace struct rather than splitting that member out into a separate header.

This is done by placing a marker to manually control the splitter script.

---

 include/linux/ncp.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/ncp.h +1 -1
index 99f0ade..4717262 100644
@@ -155,7 +155,7 @@ struct nw_info_struct {
 	__u8 nameLen;
 	__u8 entryName[256];
 	/* libncp may depend on there being nothing after entryName */
-#ifdef __KERNEL__
+#ifdef __KERNEL__ // DISINTEGRATE: RETAIN
 	struct nw_nfs_info nfs;
 #endif
 } __attribute__((packed));
#29 lore raw

PATCH 1/1 30/39] UAPI: Fix x86_64 system call count and generation

In reply to David Howells

The x86_64 system call count and system call pointer table are generated by #undef'ing the guard on asm/unistd.h and reincluding it with the __SYSCALL() macro suitably set.

To achieve this once the header has been split, the UAPI header guard must also be #undef'd.

---

 arch/x86/kernel/asm-offsets_64.c |    1 +
 arch/x86/kernel/syscall_64.c     |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
arch/x86/kernel/asm-offsets_64.c +1 -0
index e72a119..8cad3e3 100644
@@ -3,6 +3,7 @@
 #define __NO_STUBS 1
 #undef __SYSCALL
 #undef _ASM_X86_UNISTD_64_H
+#undef _UAPI_ASM_X86_UNISTD_64_H
 #define __SYSCALL(nr, sym) [nr] = 1,
 static char syscalls[] = {
 #include <asm/unistd.h>
arch/x86/kernel/syscall_64.c +2 -0
index de87d60..b659abc 100644
@@ -9,11 +9,13 @@
 
 #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ;
 #undef _ASM_X86_UNISTD_64_H
+#undef _UAPI_ASM_X86_UNISTD_64_H
 #include <asm/unistd_64.h>
 
 #undef __SYSCALL
 #define __SYSCALL(nr, sym) [nr] = sym,
 #undef _ASM_X86_UNISTD_64_H
+#undef _UAPI_ASM_X86_UNISTD_64_H
 
 typedef void (*sys_call_ptr_t)(void);
 
#30 lore raw

PATCH 1/1 31/39] UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines

In reply to David Howells

Fix arch/mips/include/asm/Kbuild to have a separate header-y line for each header to make them easier to delete individually.

---

 arch/mips/include/asm/Kbuild |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/mips/include/asm/Kbuild +3 -1
index 7897f05..f53f9ca 100644
@@ -1,3 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
-header-y += cachectl.h sgidefs.h sysmips.h
+header-y += cachectl.h
+header-y += sgidefs.h
+header-y += sysmips.h
#32 lore raw

PATCH 1/1 32/39] UAPI: Add a script to create a commit to set up new UAPI dirs

In reply to David Howells

Add a script to create and set up new UAPI dirs and then commit them to GIT or StGIT:

scripts/uapi-disintegration/set-up-Kbuild.pl

---

 scripts/uapi-disintegration/set-up-Kbuild.pl |  108 ++++++++++++++++++++++++++
 1 files changed, 108 insertions(+), 0 deletions(-)
 create mode 100755 scripts/uapi-disintegration/set-up-Kbuild.pl
scripts/uapi-disintegration/set-up-Kbuild.pl new file +108 -0
new file mode 100755
index 0000000..f81af83
@@ -0,0 +1,108 @@
+#!/usr/bin/perl -w
+
+use File::Find;
+use File::Path;
+use strict;
+
+my @sys_header_dirs = (
+    "include"
+    );
+
+#
+# Changes must be committed first
+#
+system("git diff --quiet") == 0 or die "Uncommitted changes; aborting\n";
+
+#
+# Delete the old patch under StGIT
+#
+system("stg delete uapi-set-up-Kbuild.diff");
+
+#
+# Set up the patch under StGIT
+#
+system("stg new -m '" .
+       "UAPI: Set up UAPI Kbuild files\n" .
+       "\n" .
+       "Set up empty UAPI Kbuild files to be populated by the header splitter using\n" .
+       "scripts/uapi-disintegrate/set-up-Kbuild.pl\n" .
+       "\n" .
+       "Signed-off-by: David Howells <dhowells\@redhat.com>\n" .
+       "' uapi-set-up-Kbuild.diff"
+    ) == 0 or die;
+
+#
+# Find all the system header directories under arch
+#
+opendir DIR, "arch" or die;
+push @sys_header_dirs,
+    map { "arch/$_/include"; }
+sort grep { -d "arch/$_/include"; }
+grep { $_ !~ /^[.]/ }
+readdir DIR;
+closedir DIR;
+
+#
+# Find all the header files
+#
+my %kbuilds = ();
+sub find_Kbuild()
+{
+    $kbuilds{$File::Find::name} = 1 if ($_ =~ /Kbuild$/);
+}
+
+find(\&find_Kbuild, @sys_header_dirs);
+
+#print join("\n", sort keys %kbuilds), "\n";
+
+foreach my $kbuild (sort grep { $_ !~ m@arch/um/@} keys %kbuilds) {
+
+    my $uapi_kbuild = $kbuild;
+    $uapi_kbuild =~ s@include/@include/uapi/@;
+
+    print "[[[ $uapi_kbuild ]]]\n";
+
+    open FD, '<', $kbuild or die "open $kbuild: $!\n";
+    my @old = <FD>;
+    close FD or die;
+
+    my @new = ();
+
+    if ($#old > -1) {
+	if ($old[0] =~ /^#/) {
+	    for (my $l = 0; $l <= $#old; $l++) {
+		last if ($old[$l] !~ /^#/);
+		push @new, $old[$l];
+	    }
+	    push @new, "\n";
+	}
+
+	push @new, map {
+	    my $x = $_;
+	    $x =~ s@include/@include/uapi/@;
+	    $x;
+	} grep { $_ =~ m@^include@; } @old;
+
+	push @new, "\n" if ($#new > -1);
+
+	push @new, grep { $_ =~ m@header-y\s+[+]=\s+[a-z0-9A-Z-]+/\s*@; } @old;
+    }
+
+    #print @new;
+
+    my $uapidir = $uapi_kbuild;
+    $uapidir = $1 if ($uapidir =~ m!(.*)/!);
+    mkpath($uapidir) if (! -d $uapidir);
+
+    open FD, '>', $uapi_kbuild or die "create $uapi_kbuild: $!\n";
+    print FD @new or die "write $uapi_kbuild: $!\n";
+    close FD or die "close $uapi_kbuild: $!\n";
+    system("stg add $uapi_kbuild") == 0 or die;
+}
+
+#
+# Commit the changes
+#
+system("stg ref") == 0 or die;
+
+exit 0;
#33 lore raw

PATCH 1/1 33/39] UAPI: Set up UAPI Kbuild files

In reply to David Howells

Set up empty UAPI Kbuild files to be populated by the header splitter using scripts/uapi-disintegrate/set-up-Kbuild.pl

---

 arch/alpha/include/uapi/asm/Kbuild          |    2 ++
 arch/arm/include/uapi/asm/Kbuild            |    2 ++
 arch/avr32/include/uapi/asm/Kbuild          |    2 ++
 arch/blackfin/include/uapi/asm/Kbuild       |    2 ++
 arch/cris/include/uapi/arch-v10/arch/Kbuild |    0 
 arch/cris/include/uapi/arch-v32/arch/Kbuild |    0 
 arch/cris/include/uapi/asm/Kbuild           |    4 ++++
 arch/frv/include/uapi/asm/Kbuild            |    2 ++
 arch/h8300/include/uapi/asm/Kbuild          |    2 ++
 arch/ia64/include/uapi/asm/Kbuild           |    2 ++
 arch/m32r/include/uapi/asm/Kbuild           |    2 ++
 arch/m68k/include/uapi/asm/Kbuild           |    2 ++
 arch/microblaze/include/uapi/asm/Kbuild     |    2 ++
 arch/mips/include/uapi/asm/Kbuild           |    2 ++
 arch/mn10300/include/uapi/asm/Kbuild        |    2 ++
 arch/parisc/include/uapi/asm/Kbuild         |    2 ++
 arch/powerpc/include/uapi/asm/Kbuild        |    2 ++
 arch/s390/include/uapi/asm/Kbuild           |    2 ++
 arch/score/include/uapi/asm/Kbuild          |    2 ++
 arch/sh/include/uapi/asm/Kbuild             |    2 ++
 arch/sparc/include/uapi/asm/Kbuild          |    4 ++++
 arch/tile/include/uapi/asm/Kbuild           |    2 ++
 arch/unicore32/include/uapi/asm/Kbuild      |    2 ++
 arch/x86/include/uapi/asm/Kbuild            |    2 ++
 arch/xtensa/include/uapi/asm/Kbuild         |    2 ++
 include/uapi/Kbuild                         |   13 +++++++++++++
 include/uapi/asm-generic/Kbuild             |    0 
 include/uapi/drm/Kbuild                     |    0 
 include/uapi/linux/Kbuild                   |   14 ++++++++++++++
 include/uapi/linux/byteorder/Kbuild         |    0 
 include/uapi/linux/caif/Kbuild              |    0 
 include/uapi/linux/can/Kbuild               |    0 
 include/uapi/linux/dvb/Kbuild               |    0 
 include/uapi/linux/hdlc/Kbuild              |    0 
 include/uapi/linux/isdn/Kbuild              |    0 
 include/uapi/linux/mmc/Kbuild               |    0 
 include/uapi/linux/netfilter/Kbuild         |    1 +
 include/uapi/linux/netfilter/ipset/Kbuild   |    0 
 include/uapi/linux/netfilter_arp/Kbuild     |    0 
 include/uapi/linux/netfilter_bridge/Kbuild  |    0 
 include/uapi/linux/netfilter_ipv4/Kbuild    |    0 
 include/uapi/linux/netfilter_ipv6/Kbuild    |    0 
 include/uapi/linux/nfsd/Kbuild              |    0 
 include/uapi/linux/raid/Kbuild              |    0 
 include/uapi/linux/spi/Kbuild               |    0 
 include/uapi/linux/sunrpc/Kbuild            |    0 
 include/uapi/linux/tc_act/Kbuild            |    0 
 include/uapi/linux/tc_ematch/Kbuild         |    0 
 include/uapi/linux/usb/Kbuild               |    0 
 include/uapi/linux/wimax/Kbuild             |    0 
 include/uapi/mtd/Kbuild                     |    0 
 include/uapi/rdma/Kbuild                    |    0 
 include/uapi/scsi/Kbuild                    |    1 +
 include/uapi/scsi/fc/Kbuild                 |    0 
 include/uapi/sound/Kbuild                   |    0 
 include/uapi/video/Kbuild                   |    0 
 include/uapi/xen/Kbuild                     |    0 
 57 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 arch/alpha/include/uapi/asm/Kbuild
 create mode 100644 arch/arm/include/uapi/asm/Kbuild
 create mode 100644 arch/avr32/include/uapi/asm/Kbuild
 create mode 100644 arch/blackfin/include/uapi/asm/Kbuild
 create mode 100644 arch/cris/include/uapi/arch-v10/arch/Kbuild
 create mode 100644 arch/cris/include/uapi/arch-v32/arch/Kbuild
 create mode 100644 arch/cris/include/uapi/asm/Kbuild
 create mode 100644 arch/frv/include/uapi/asm/Kbuild
 create mode 100644 arch/h8300/include/uapi/asm/Kbuild
 create mode 100644 arch/ia64/include/uapi/asm/Kbuild
 create mode 100644 arch/m32r/include/uapi/asm/Kbuild
 create mode 100644 arch/m68k/include/uapi/asm/Kbuild
 create mode 100644 arch/microblaze/include/uapi/asm/Kbuild
 create mode 100644 arch/mips/include/uapi/asm/Kbuild
 create mode 100644 arch/mn10300/include/uapi/asm/Kbuild
 create mode 100644 arch/parisc/include/uapi/asm/Kbuild
 create mode 100644 arch/powerpc/include/uapi/asm/Kbuild
 create mode 100644 arch/s390/include/uapi/asm/Kbuild
 create mode 100644 arch/score/include/uapi/asm/Kbuild
 create mode 100644 arch/sh/include/uapi/asm/Kbuild
 create mode 100644 arch/sparc/include/uapi/asm/Kbuild
 create mode 100644 arch/tile/include/uapi/asm/Kbuild
 create mode 100644 arch/unicore32/include/uapi/asm/Kbuild
 create mode 100644 arch/x86/include/uapi/asm/Kbuild
 create mode 100644 arch/xtensa/include/uapi/asm/Kbuild
 create mode 100644 include/uapi/Kbuild
 create mode 100644 include/uapi/asm-generic/Kbuild
 create mode 100644 include/uapi/drm/Kbuild
 create mode 100644 include/uapi/linux/Kbuild
 create mode 100644 include/uapi/linux/byteorder/Kbuild
 create mode 100644 include/uapi/linux/caif/Kbuild
 create mode 100644 include/uapi/linux/can/Kbuild
 create mode 100644 include/uapi/linux/dvb/Kbuild
 create mode 100644 include/uapi/linux/hdlc/Kbuild
 create mode 100644 include/uapi/linux/isdn/Kbuild
 create mode 100644 include/uapi/linux/mmc/Kbuild
 create mode 100644 include/uapi/linux/netfilter/Kbuild
 create mode 100644 include/uapi/linux/netfilter/ipset/Kbuild
 create mode 100644 include/uapi/linux/netfilter_arp/Kbuild
 create mode 100644 include/uapi/linux/netfilter_bridge/Kbuild
 create mode 100644 include/uapi/linux/netfilter_ipv4/Kbuild
 create mode 100644 include/uapi/linux/netfilter_ipv6/Kbuild
 create mode 100644 include/uapi/linux/nfsd/Kbuild
 create mode 100644 include/uapi/linux/raid/Kbuild
 create mode 100644 include/uapi/linux/spi/Kbuild
 create mode 100644 include/uapi/linux/sunrpc/Kbuild
 create mode 100644 include/uapi/linux/tc_act/Kbuild
 create mode 100644 include/uapi/linux/tc_ematch/Kbuild
 create mode 100644 include/uapi/linux/usb/Kbuild
 create mode 100644 include/uapi/linux/wimax/Kbuild
 create mode 100644 include/uapi/mtd/Kbuild
 create mode 100644 include/uapi/rdma/Kbuild
 create mode 100644 include/uapi/scsi/Kbuild
 create mode 100644 include/uapi/scsi/fc/Kbuild
 create mode 100644 include/uapi/sound/Kbuild
 create mode 100644 include/uapi/video/Kbuild
 create mode 100644 include/uapi/xen/Kbuild
arch/alpha/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/arm/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/avr32/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/blackfin/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/cris/include/uapi/arch-v10/arch/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
arch/cris/include/uapi/arch-v32/arch/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
arch/cris/include/uapi/asm/Kbuild new file +4 -0
new file mode 100644
index 0000000..e5a54fe
@@ -0,0 +1,4 @@
+include include/uapi/asm-generic/Kbuild.asm
+
+header-y += arch-v10/
+header-y += arch-v32/
arch/frv/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/h8300/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/ia64/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/m32r/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/m68k/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/microblaze/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/mips/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/mn10300/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/parisc/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/powerpc/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/s390/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/score/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/sh/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/sparc/include/uapi/asm/Kbuild new file +4 -0
new file mode 100644
index 0000000..c27001d
@@ -0,0 +1,4 @@
+# User exported sparc header files
+
+include include/uapi/asm-generic/Kbuild.asm
+
arch/tile/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/unicore32/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/x86/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
arch/xtensa/include/uapi/asm/Kbuild new file +2 -0
new file mode 100644
index 0000000..f44fd2e
@@ -0,0 +1,2 @@
+include include/uapi/asm-generic/Kbuild.asm
+
include/uapi/Kbuild new file +13 -0
new file mode 100644
index 0000000..796249d
@@ -0,0 +1,13 @@
+# Top-level Makefile calls into asm-$(ARCH)
+# List only non-arch directories below
+
+
+header-y += asm-generic/
+header-y += linux/
+header-y += sound/
+header-y += mtd/
+header-y += rdma/
+header-y += video/
+header-y += drm/
+header-y += xen/
+header-y += scsi/
include/uapi/asm-generic/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/drm/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/Kbuild new file +14 -0
new file mode 100644
index 0000000..b29b895
@@ -0,0 +1,14 @@
+header-y += byteorder/
+header-y += can/
+header-y += caif/
+header-y += dvb/
+header-y += hdlc/
+header-y += isdn/
+header-y += mmc/
+header-y += nfsd/
+header-y += raid/
+header-y += spi/
+header-y += sunrpc/
+header-y += netfilter/
+header-y += usb/
+header-y += wimax/
include/uapi/linux/byteorder/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/caif/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/can/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/dvb/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/hdlc/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/isdn/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/mmc/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/netfilter/Kbuild new file +1 -0
new file mode 100644
index 0000000..b332202
@@ -0,0 +1 @@
+header-y += ipset/
include/uapi/linux/netfilter/ipset/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/netfilter_arp/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/netfilter_bridge/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/netfilter_ipv4/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/netfilter_ipv6/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/nfsd/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/raid/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/spi/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/sunrpc/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/tc_act/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/tc_ematch/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/usb/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/linux/wimax/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/mtd/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/rdma/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/scsi/Kbuild new file +1 -0
new file mode 100644
index 0000000..562ff9d
@@ -0,0 +1 @@
+header-y += fc/
include/uapi/scsi/fc/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/sound/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/video/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
include/uapi/xen/Kbuild new file +0 -0
new file mode 100644
index 0000000..e69de29
#34 lore raw

PATCH 1/1 34/39] UAPI: Plumb the UAPI Kbuilds into the user header handling system

In reply to David Howells

Plumb the UAPI Kbuilds into the user header handling system. As the headers are split the entries will be transferred across.

---

 Makefile |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Makefile +6 -0
index 0fe2209..ca2bae7 100644
@@ -1069,6 +1069,10 @@ headers_install: __headers
 	$(error Headers not exportable for the $(SRCARCH) architecture))
 	$(Q)$(MAKE) $(hdr-inst)=include
 	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst)
+	$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
+	$(error Headers not exportable for the $(SRCARCH) architecture))
+	$(Q)$(MAKE) $(hdr-inst)=include/uapi
+	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)
 
 PHONY += headers_check_all
 headers_check_all: headers_install_all
@@ -1078,6 +1082,8 @@ PHONY += headers_check
 headers_check: headers_install
 	$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
 	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1
+	$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
+	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
 
 # ---------------------------------------------------------------------------
 # Modules
#35 lore raw

PATCH 1/1 35/39] UAPI: Set up uapi/asm/Kbuild.asm

In reply to David Howells

Set up uapi/asm/Kbuild.asm. This requires the mandatory headers to be dynamically detected. The same goes for include/asm/Kbuild.asm. The problem is that the header files will be split or moved one at a time, but each header file in Kbuild.asm's list applies to all arch headers of that name simultaneously.

The dynamic detection of mandatory files can be undone later.

---

 include/asm-generic/Kbuild.asm      |   85 +++++++++++++++++------------------
 include/uapi/asm-generic/Kbuild.asm |   44 ++++++++++++++++++
 2 files changed, 86 insertions(+), 43 deletions(-)
 create mode 100644 include/uapi/asm-generic/Kbuild.asm
include/asm-generic/Kbuild.asm +42 -43
index c5d2e5d..4923b27 100644
@@ -1,45 +1,44 @@
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
-		  $(srctree)/include/asm-$(SRCARCH)/kvm.h),)
-header-y  += kvm.h
-endif
+#
+# Headers that are optional in arch/*/include/asm/
+#
+opt-header += kvm.h
+opt-header += kvm_para.h
+opt-header += a.out.h
 
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
-		  $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
-header-y  += kvm_para.h
-endif
+#
+# Headers that are mandatory in arch/*/include/asm/
+#
+asm-headers += auxvec.h
+asm-headers += bitsperlong.h
+asm-headers += byteorder.h
+asm-headers += errno.h
+asm-headers += fcntl.h
+asm-headers += ioctl.h
+asm-headers += ioctls.h
+asm-headers += ipcbuf.h
+asm-headers += mman.h
+asm-headers += msgbuf.h
+asm-headers += param.h
+asm-headers += poll.h
+asm-headers += posix_types.h
+asm-headers += ptrace.h
+asm-headers += resource.h
+asm-headers += sembuf.h
+asm-headers += setup.h
+asm-headers += shmbuf.h
+asm-headers += sigcontext.h
+asm-headers += siginfo.h
+asm-headers += signal.h
+asm-headers += socket.h
+asm-headers += sockios.h
+asm-headers += stat.h
+asm-headers += statfs.h
+asm-headers += swab.h
+asm-headers += termbits.h
+asm-headers += termios.h
+asm-headers += types.h
+asm-headers += unistd.h
 
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
-		  $(srctree)/include/asm-$(SRCARCH)/a.out.h),)
-header-y += a.out.h
-endif
-
-header-y += auxvec.h
-header-y += bitsperlong.h
-header-y += byteorder.h
-header-y += errno.h
-header-y += fcntl.h
-header-y += ioctl.h
-header-y += ioctls.h
-header-y += ipcbuf.h
-header-y += mman.h
-header-y += msgbuf.h
-header-y += param.h
-header-y += poll.h
-header-y += posix_types.h
-header-y += ptrace.h
-header-y += resource.h
-header-y += sembuf.h
-header-y += setup.h
-header-y += shmbuf.h
-header-y += sigcontext.h
-header-y += siginfo.h
-header-y += signal.h
-header-y += socket.h
-header-y += sockios.h
-header-y += stat.h
-header-y += statfs.h
-header-y += swab.h
-header-y += termbits.h
-header-y += termios.h
-header-y += types.h
-header-y += unistd.h
+header-y := $(foreach hdr,$(asm-headers) $(opt-headers), \
+		$(if $(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/$(hdr)), \
+		  $(hdr)))
include/uapi/asm-generic/Kbuild.asm new file +44 -0

44 lines not on this page · raw message

#36 lore raw

PATCH 1/1 36/39] UAPI: Move linux/version.h

In reply to David Howells

Move include/linux/version.h to the UAPI header directory.

---

 Makefile                  |   10 +++++-----
 include/linux/Kbuild      |    1 -
 include/uapi/linux/Kbuild |    3 +++
 3 files changed, 8 insertions(+), 6 deletions(-)
Makefile +5 -5
index ca2bae7..9a165a7 100644
@@ -450,7 +450,7 @@ asm-generic:
 
 no-dot-config-targets := clean mrproper distclean \
 			 cscope gtags TAGS tags help %docs check% coccicheck \
-			 include/linux/version.h headers_% \
+			 include/uapi/linux/version.h headers_% \
 			 kernelversion %src-pkg
 
 config-targets := 0
@@ -983,7 +983,7 @@ endif
 # prepare2 creates a makefile if using a separate output directory
 prepare2: prepare3 outputmakefile asm-generic
 
-prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
+prepare1: prepare2 include/uapi/linux/version.h include/generated/utsrelease.h \
                    include/config/auto.conf
 	$(cmd_crmodverdir)
 
@@ -1017,7 +1017,7 @@ define filechk_version.h
 	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
 endef
 
-include/linux/version.h: $(srctree)/Makefile FORCE
+include/uapi/linux/version.h: $(srctree)/Makefile FORCE
 	$(call filechk,version.h)
 
 include/generated/utsrelease.h: include/config/kernel.release FORCE
@@ -1056,7 +1056,7 @@ hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
 hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
 
 PHONY += __headers
-__headers: include/linux/version.h scripts_basic asm-generic FORCE
+__headers: include/uapi/linux/version.h scripts_basic asm-generic FORCE
 	$(Q)$(MAKE) $(build)=scripts build_unifdef
 
 PHONY += headers_install_all
@@ -1175,7 +1175,7 @@ CLEAN_FILES +=	vmlinux System.map \
 MRPROPER_DIRS  += include/config usr/include include/generated          \
                   arch/*/include/generated
 MRPROPER_FILES += .config .config.old .version .old_version             \
-                  include/linux/version.h                               \
+                  include/uapi/linux/version.h                          \
 		  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
 
 # clean - Delete most, but leave enough to build external modules
include/linux/Kbuild +0 -1
index 01f6362..f429b36 100644
@@ -19,7 +19,6 @@ header-y += netfilter_ipv6/
 header-y += usb/
 header-y += wimax/
 
-objhdr-y += version.h
 
 ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
 		  $(srctree)/include/asm-$(SRCARCH)/a.out.h \
include/uapi/linux/Kbuild +3 -0
index b29b895..2731127 100644
@@ -12,3 +12,6 @@ header-y += sunrpc/
 header-y += netfilter/
 header-y += usb/
 header-y += wimax/
+
+objhdr-y += version.h
+
#37 lore raw

PATCH 1/1 37/39] UAPI: Make UAPI headers install to usr/include/

In reply to David Howells

Make core UAPI headers install to the usr/include/ directory.

---

 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 9a165a7..60ff965 100644
@@ -1071,7 +1071,7 @@ headers_install: __headers
 	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst)
 	$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
 	$(error Headers not exportable for the $(SRCARCH) architecture))
-	$(Q)$(MAKE) $(hdr-inst)=include/uapi
+	$(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include
 	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)
 
 PHONY += headers_check_all
@@ -1082,7 +1082,7 @@ PHONY += headers_check
 headers_check: headers_install
 	$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
 	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1
-	$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
+	$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1 dst=include
 	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
 
 # ---------------------------------------------------------------------------
#38 lore raw

PATCH 1/1 38/39] UAPI: Fix the page-types query program in the docs

In reply to David Howells

Fix the page-types query program in Documentation/vm/ as that refers to the magic numbers header file directly, but the magic numbers are now in the UAPI headers.

---

 Documentation/vm/page-types.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/vm/page-types.c +1 -1
index 7445caa..8d6a54f 100644
@@ -34,7 +34,7 @@
 #include <sys/fcntl.h>
 #include <sys/mount.h>
 #include <sys/statfs.h>
-#include "../../include/linux/magic.h"
+#include "../../include/uapi/linux/magic.h"
 
 
 #ifndef MAX_PATH
#39 lore raw

PATCH 1/1 39/39] UAPI: Scripts to disintegrate header files

In reply to David Howells

Add three scripts that together can be used to disintegrate the exported header files to extract the userspace API into its own header directories. The results are checked into GIT or StGIT in per-directory batches.

Use one of:

scripts/uapi-disintegrate/disintegrate-to-git-by-dir.pl scripts/uapi-disintegrate/disintegrate-to-stg-by-dir.pl

to achieve the disintegration.

---

 scripts/uapi-disintegration/disintegrate-1-stg.sh  |   53 +
 .../uapi-disintegration/disintegrate-many-stg.sh   |   63 +
 scripts/uapi-disintegration/disintegrate-one.pl    | 1036 ++++++++++++++++++++
 .../disintegrate-to-git-by-dir.pl                  |   69 +
 scripts/uapi-disintegration/disintegrate-to-git.pl |   70 +
 .../disintegrate-to-stg-by-dir.pl                  |   85 ++
 scripts/uapi-disintegration/genlist.pl             |   79 ++
 scripts/uapi-disintegration/sound-headers.pl       |   75 +
 8 files changed, 1530 insertions(+), 0 deletions(-)
 create mode 100755 scripts/uapi-disintegration/disintegrate-1-stg.sh
 create mode 100755 scripts/uapi-disintegration/disintegrate-many-stg.sh
 create mode 100755 scripts/uapi-disintegration/disintegrate-one.pl
 create mode 100755 scripts/uapi-disintegration/disintegrate-to-git-by-dir.pl
 create mode 100755 scripts/uapi-disintegration/disintegrate-to-git.pl
 create mode 100755 scripts/uapi-disintegration/disintegrate-to-stg-by-dir.pl
 create mode 100755 scripts/uapi-disintegration/genlist.pl
 create mode 100755 scripts/uapi-disintegration/sound-headers.pl
scripts/uapi-disintegration/disintegrate-1-stg.sh new file +53 -0
new file mode 100755
index 0000000..4cb17ad
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+UAPI=uapi
+export UAPI
+
+###############################################################################
+#
+#
+#
+###############################################################################
+stg ref
+if stg id begin-marker >&/dev/null
+then
+    stg del begin-marker.. || exit $?
+fi
+
+stg new begin-marker -m "Begin userspace API extraction" || exit $?
+
+stg new uapi-all-headers.diff -m "UAPI: Disintegrate $f
+
+Signed-off-by: David Howells <[email protected]>" || exit $?
+
+{
+    ./disintegrate/uapi/genlist.pl
+    #./disintegrate/uapi/genlist.pl | grep include/linux/ 
+    #echo include/linux/patchkey.h
+    #echo include/linux/sched.h
+} |
+while read f
+do
+    if [ ! -f $f ]
+    then
+	continue
+    fi
+
+    echo $f
+    n=$f #${f#include/}
+    a=`echo $f | sed -e s@include/include/@$UAPI/@`
+
+    pn=`echo $n | sed -e s@/@__@g`
+
+    ./disintegrate/disintegrate/uapi.pl $f $a || exit $?
+    if [ -r $a ]
+    then
+	stg add $a || exit $?
+    fi
+    if [ ! -r $f ]
+    then
+	stg rm $f || exit $?
+    fi
+done
+
+stg ref || exit $?
scripts/uapi-disintegration/disintegrate-many-stg.sh new file +63 -0

63 lines not on this page · raw message

scripts/uapi-disintegration/disintegrate-one.pl new file +1036 -0

1,036 lines not on this page · raw message

scripts/uapi-disintegration/disintegrate-to-git-by-dir.pl new file +69 -0

69 lines not on this page · raw message

scripts/uapi-disintegration/disintegrate-to-git.pl new file +70 -0

70 lines not on this page · raw message

scripts/uapi-disintegration/disintegrate-to-stg-by-dir.pl new file +85 -0

85 lines not on this page · raw message

scripts/uapi-disintegration/genlist.pl new file +79 -0

79 lines not on this page · raw message

scripts/uapi-disintegration/sound-headers.pl new file +75 -0

75 lines not on this page · raw message

Acked-by on v1 1/1
#31 lore raw

Re: [PATCH [ver #2] 31/39] UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines

In reply to David Howells
Quoted 2 lines · David Howells

Fix arch/mips/include/asm/Kbuild to have a separate header-y line for each header to make them easier to delete individually.

Makes sense to have a consistent style with other architectures, even without the rest of this series.

Ralf

#40 lore raw
In reply to David Howells
Quoted 2 lines · On Fri, 08 Jul 2011 15:22:45 +0100 David Howells wrote:

Here's my first installment of patches to clean up the kernel header files and

or second

Quoted 1 line

sort out the recursion problems. The planned steps are:

Could you give a small bit of background on the "recursion problems," please?

[snip]

Quoted 2 lines

(7) Provide a script to go through and rejig the #includes of each source file to have just the ones that are actually required.

How is "actually required" defined?
We traditionally want to see #include <hdrfile> for any interfaces that are used, even if other header files suck in some other needed header files.

Quoted 2 lines

(8) Provide a make target that tests all the KAPI and UAPI headers by simply passing them one at a time to the compiler and attempting to compile them.

Interesting.

[snip]

Quoted 2 lines

(3) To eliminate the need for __KERNEL__. After the split, __KERNEL__ can certainly by unifdef'd from the residual kernel headers - but this isn't

be ?

Quoted 1 line

quite true of the UAPI headers.

[snip]

Quoted 4 lines

The uapi/ directories are also added with -I to the CPP flags after the include/ directories so that if the KAPI file does not exist, the UAPI file will be used directly. This is not as elegant as using #include_next might be, but it does work.

Is this v2 patchset meant to avoid the use of #include_next? I don't see that used, but patch 22 description refers to #include_next.

I'm still reviewing...

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#41 lore raw
Quoted 1 line · Randy Dunlap

Could you give a small bit of background on the "recursion problems," please?

Well, I occasionally run into a problem where I can't write an inline function in a header file because I need to access something from another headerfile that includes this one. Due to this, I end up writing it as a #define instead.

The problems are mainly due to inline functions. If we split some headers (linux/sched.h being the biggest culprit) to separate the inline functions from the data structs (e.g. task_struct) then we could reduce the problems.

Quite often it's a case of an inline function in header A wanting a struct[*] from header B, but header B already has an inline function that wants a struct from header A.

[*] or constant or whatever.

Recently someone tried to add a kernel-offsets file (an analogue to asm-offsets) to deal with the problems of dealing with both linux/rcupdate.h and linux/sched.h.

Quoted 6 lines
Quoted 2 lines

(7) Provide a script to go through and rejig the #includes of each source file to have just the ones that are actually required.

How is "actually required" defined?
We traditionally want to see #include <hdrfile> for any interfaces that are used, even if other header files suck in some other needed header files.

Yes, but with the amount of copy'n'paste going on, there are quite a lot of unnecessary #includes in the codebase. Furthermore, headers sometimes get rearranged and new #includes added - and sometimes obsolete ones don't get removed.

Whilst these aren't strictly a part of the recursion problem, what they do do is slow down recompilation by causing recompilation of things that didn't actually need it.

Quoted 5 lines
Quoted 3 lines

(8) Provide a make target that tests all the KAPI and UAPI headers by simply passing them one at a time to the compiler and attempting to compile them.

Interesting.

If gcc can have its sources piped in, then this should be fairly straightforward. Admittedly, there may be some headers that can't go through this process as they're meant to be #included after #defining some parameters, but those can be flagged in some way.

Quoted 7 lines
Quoted 4 lines

The uapi/ directories are also added with -I to the CPP flags after the include/ directories so that if the KAPI file does not exist, the UAPI file will be used directly. This is not as elegant as using #include_next might be, but it does work.

Is this v2 patchset meant to avoid the use of #include_next? I don't see that used, but patch 22 description refers to #include_next.

Yeah... I need to vet the patch descriptions.

Btw, what's your reason for disliking #include_next? Note that the kernel already uses it in places.

David

#42 lore raw
In reply to David Howells
Quoted 28 lines · David Howells

Here's my first installment of patches to clean up the kernel header files and sort out the recursion problems. The planned steps are:

(1) Split the Userspace API (UAPI) out of the kernel headers into its own header directories.

(2) Move stuff out of the Kernel API (KAPI) headers that can be contained in individual directories as it is referenced by a single file or directory of files.

(3) Make coherent what can be found in commmon arch headers and disintegrate asm/system.h.

(4) Split some headers into definitions containers and inline function containers to clean up recursion problems. The main culprit is very likely to be linux/sched.h, I think.

(5) I'd like to split some headers (e.g. linux/security.h) to reduce the conditional recompilation burden. linux/security.h could have, for instance, struct security_operations split out into a header file private to the stuff in the security/ directory as the wrappers of its function pointers are now out of lined in security/security.c.

(6) Replace the traditional anti-reinclusion guards on header files with three-state anti-recursion guards that abort compilation if recursive inclusion is encountered.

Quoted 5 lines

(7) Provide a script to go through and rejig the #includes of each source file to have just the ones that are actually required.

(8) Provide a make target that tests all the KAPI and UAPI headers by simply passing them one at a time to the compiler and attempting to compile them.

By the way, I haven't commented on this in detail, but I like the concept.

-hpa