All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/40] UAPI header file split [ver #3]
@ 2011-07-28 15:49 David Howells
  2011-07-28 15:49 ` [PATCH 01/40] UAPI: Add script to convert #include "..." to #include <path/...> in sys headers " David Howells
                   ` (39 more replies)
  0 siblings, 40 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:49 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild


Here's my first installment of patches to clean up the kernel header files and
sort out the inclusion recursion problems.

Note that these patches will need regenerating if the header files they alter
change before they're applied.  However, disintegration is scripted, so that
just takes a few minutes.


===================================
BACKGROUND ON THE RECURSION PROBLEM
===================================

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 header 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.  Other
splits and rearrangements could help also.

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 - each header needed to be included before the other.


=================
PLANNED PROCEDURE
=================

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 (a lot of cut'n'pasting
     goes on, and there are quite a few unnecessary #includes out there).

 (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.


===================
IMPLEMENTING STEP 1
===================

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 four 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: Add a script to create a commit to set up new UAPI dirs
	UAPI: Scripts to disintegrate header files

which are the first, third, eighth from last 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 be 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 similarity.


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


======
ISSUES
======

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.

 (*) I'd also prefer to use #include_next and move the uapi/ directories out of
     the include/ directories:

	include/uapi/ -> uapi/
	arch/foo/include/uapi/ -> arch/foo/uapi/

     as it seems cleaner, especially as there's then no need to #include
     <uapi/...> anywhere - but various people object to the use of
     #include_next, though the kernel does already use it.

David
---
David Howells (40):
      UAPI: Scripts to disintegrate header files
      UAPI: Fix the x86 test_get_len tool
      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                 |    3 
 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                   |    3 
 arch/avr32/include/uapi/asm/Kbuild                 |    3 
 arch/blackfin/include/uapi/asm/Kbuild              |    3 
 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        |    1 
 arch/cris/include/uapi/arch-v32/arch/Kbuild        |    1 
 arch/cris/include/uapi/asm/Kbuild                  |    5 
 arch/frv/include/uapi/asm/Kbuild                   |    3 
 arch/h8300/include/uapi/asm/Kbuild                 |    3 
 arch/ia64/include/asm/intrinsics.h                 |   21 
 arch/ia64/include/uapi/asm/Kbuild                  |    3 
 arch/m32r/include/uapi/asm/Kbuild                  |    3 
 arch/m68k/include/asm/cacheflush.h                 |    4 
 arch/m68k/include/asm/entry.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/uaccess.h                    |    4 
 arch/m68k/include/uapi/asm/Kbuild                  |    3 
 arch/microblaze/include/asm/mmu_context.h          |    2 
 arch/microblaze/include/uapi/asm/Kbuild            |    3 
 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                  |    3 
 arch/mn10300/include/uapi/asm/Kbuild               |    3 
 arch/openrisc/include/uapi/asm/Kbuild              |    3 
 arch/parisc/include/uapi/asm/Kbuild                |    3 
 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               |    3 
 arch/s390/include/asm/mman.h                       |    4 
 arch/s390/include/uapi/asm/Kbuild                  |    3 
 arch/score/include/uapi/asm/Kbuild                 |    3 
 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                    |    3 
 arch/sparc/include/uapi/asm/Kbuild                 |    5 
 arch/tile/include/asm/signal.h                     |    4 
 arch/tile/include/uapi/asm/Kbuild                  |    3 
 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             |    3 
 arch/x86/boot/Makefile                             |    4 
 arch/x86/boot/mkcpustr.c                           |    2 
 arch/x86/include/asm/atomic.h                      |    4 
 arch/x86/include/asm/calling.h                     |    2 
 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                   |    3 
 arch/x86/kernel/asm-offsets_64.c                   |    1 
 arch/x86/kernel/cpu/mkcapflags.pl                  |    5 
 arch/x86/kernel/syscall_64.c                       |    2 
 arch/x86/tools/Makefile                            |    2 
 arch/xtensa/include/uapi/asm/Kbuild                |    3 
 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                  |    6 
 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                                |   14 
 include/uapi/asm-generic/Kbuild                    |    1 
 include/uapi/asm-generic/Kbuild.asm                |   44 +
 include/uapi/drm/Kbuild                            |    1 
 include/uapi/linux/Kbuild                          |   18 
 include/uapi/linux/byteorder/Kbuild                |    1 
 include/uapi/linux/caif/Kbuild                     |    1 
 include/uapi/linux/can/Kbuild                      |    1 
 include/uapi/linux/dvb/Kbuild                      |    1 
 include/uapi/linux/hdlc/Kbuild                     |    1 
 include/uapi/linux/isdn/Kbuild                     |    1 
 include/uapi/linux/mmc/Kbuild                      |    1 
 include/uapi/linux/netfilter/Kbuild                |    2 
 include/uapi/linux/netfilter/ipset/Kbuild          |    1 
 include/uapi/linux/netfilter_arp/Kbuild            |    1 
 include/uapi/linux/netfilter_bridge/Kbuild         |    1 
 include/uapi/linux/netfilter_ipv4/Kbuild           |    1 
 include/uapi/linux/netfilter_ipv6/Kbuild           |    1 
 include/uapi/linux/nfsd/Kbuild                     |    1 
 include/uapi/linux/raid/Kbuild                     |    1 
 include/uapi/linux/spi/Kbuild                      |    1 
 include/uapi/linux/sunrpc/Kbuild                   |    1 
 include/uapi/linux/tc_act/Kbuild                   |    1 
 include/uapi/linux/tc_ematch/Kbuild                |    1 
 include/uapi/linux/usb/Kbuild                      |    1 
 include/uapi/linux/wimax/Kbuild                    |    1 
 include/uapi/mtd/Kbuild                            |    1 
 include/uapi/rdma/Kbuild                           |    1 
 include/uapi/scsi/Kbuild                           |    2 
 include/uapi/scsi/fc/Kbuild                        |    1 
 include/uapi/sound/Kbuild                          |    1 
 include/uapi/video/Kbuild                          |    1 
 include/uapi/xen/Kbuild                            |    1 
 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         |  103 ++
 scripts/uapi-disintegration/genlist.pl             |   79 ++
 scripts/uapi-disintegration/set-up-Kbuild.pl       |  107 ++
 scripts/uapi-disintegration/sound-headers.pl       |   75 +
 scripts/uapi-disintegration/system-headers.pl      |  165 +++
 sound/sound_core.c                                 |    1 
 548 files changed, 3252 insertions(+), 1077 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/openrisc/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


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

* [PATCH 01/40] UAPI: Add script to convert #include "..." to #include <path/...> in sys headers [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
@ 2011-07-28 15:49 ` David Howells
  2011-07-28 15:49 ` [PATCH 02/40] UAPI: Convert #include "..." to #include <path/...> in kernel system " David Howells
                   ` (38 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:49 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 scripts/uapi-disintegration/system-headers.pl |  165 +++++++++++++++++++++++++
 1 files changed, 165 insertions(+), 0 deletions(-)
 create mode 100755 scripts/uapi-disintegration/system-headers.pl

diff --git a/scripts/uapi-disintegration/system-headers.pl b/scripts/uapi-disintegration/system-headers.pl
new file mode 100755
index 0000000..c905568
--- /dev/null
+++ b/scripts/uapi-disintegration/system-headers.pl
@@ -0,0 +1,165 @@
+#!/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" .
+       "' --sign 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;


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

* [PATCH 02/40] UAPI: Convert #include "..." to #include <path/...> in kernel system headers [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
  2011-07-28 15:49 ` [PATCH 01/40] UAPI: Add script to convert #include "..." to #include <path/...> in sys headers " David Howells
@ 2011-07-28 15:49 ` David Howells
  2011-07-28 15:49 ` [PATCH 03/40] UAPI: Add script to audit drivers/gpu/ for #including system headers with "..." " David Howells
                   ` (37 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:49 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 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/cacheflush.h               |    4 +-
 arch/m68k/include/asm/entry.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/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/calling.h                   |    2 +
 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 +
 159 files changed, 329 insertions(+), 329 deletions(-)

diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index 080d74f..8c67ead 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -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()
 
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index ac75d08..f9629a7 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -19,7 +19,7 @@
 
 #ifndef CONFIG_MMU
 
-#include "page-nommu.h"
+#include <asm/page-nommu.h>
 
 #else
 
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 5750704..0f64e0c 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -16,7 +16,7 @@
 
 #ifndef CONFIG_MMU
 
-#include "pgtable-nommu.h"
+#include <asm/pgtable-nommu.h>
 
 #else
 
diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
index 3d5fc41..a7aadbd 100644
--- a/arch/arm/include/asm/vfpmacros.h
+++ b/arch/arm/include/asm/vfpmacros.h
@@ -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
diff --git a/arch/cris/include/arch-v10/arch/sv_addr_ag.h b/arch/cris/include/arch-v10/arch/sv_addr_ag.h
index e4a6b68..5517f04 100644
--- a/arch/cris/include/arch-v10/arch/sv_addr_ag.h
+++ b/arch/cris/include/arch-v10/arch/sv_addr_ag.h
@@ -114,7 +114,7 @@
 
 /*------------------------------------------------------------*/
 
-#include "sv_addr.agh"
+#include <arch/sv_addr.agh>
 
 #if __test_sv_addr__
 /* IO_MASK( R_BUS_CONFIG , CE ) */
diff --git a/arch/cris/include/arch-v10/arch/svinto.h b/arch/cris/include/arch-v10/arch/svinto.h
index 0881a1a..da5c152 100644
--- a/arch/cris/include/arch-v10/arch/svinto.h
+++ b/arch/cris/include/arch-v10/arch/svinto.h
@@ -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 */
 
diff --git a/arch/cris/include/arch-v32/arch/dma.h b/arch/cris/include/arch-v32/arch/dma.h
index 6190615..6f92f4f 100644
--- a/arch/cris/include/arch-v32/arch/dma.h
+++ b/arch/cris/include/arch-v32/arch/dma.h
@@ -1 +1 @@
-#include "mach/dma.h"
+#include <mach/dma.h>
diff --git a/arch/cris/include/arch-v32/arch/hwregs/dma.h b/arch/cris/include/arch-v32/arch/hwregs/dma.h
index 3ce322b..52bf679 100644
--- a/arch/cris/include/arch-v32/arch/hwregs/dma.h
+++ b/arch/cris/include/arch-v32/arch/hwregs/dma.h
@@ -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 */
diff --git a/arch/m68k/include/asm/cacheflush.h b/arch/m68k/include/asm/cacheflush.h
index a70d731..4fc7382 100644
--- a/arch/m68k/include/asm/cacheflush.h
+++ b/arch/m68k/include/asm/cacheflush.h
@@ -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
diff --git a/arch/m68k/include/asm/entry.h b/arch/m68k/include/asm/entry.h
index 876eec6..7308daf 100644
--- a/arch/m68k/include/asm/entry.h
+++ b/arch/m68k/include/asm/entry.h
@@ -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
diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h
index c7210ba..c70cc91 100644
--- a/arch/m68k/include/asm/io.h
+++ b/arch/m68k/include/asm/io.h
@@ -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
diff --git a/arch/m68k/include/asm/m68360.h b/arch/m68k/include/asm/m68360.h
index eb7d39e..4664180 100644
--- a/arch/m68k/include/asm/m68360.h
+++ b/arch/m68k/include/asm/m68360.h
@@ -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
 
diff --git a/arch/m68k/include/asm/m68360_enet.h b/arch/m68k/include/asm/m68360_enet.h
index c36f4d0..4d04037 100644
--- a/arch/m68k/include/asm/m68360_enet.h
+++ b/arch/m68k/include/asm/m68360_enet.h
@@ -10,7 +10,7 @@
 #ifndef __ETHER_H
 #define __ETHER_H
 
-#include "quicc_simple.h"
+#include <asm/quicc_simple.h>
 
 /*
  * transmit BD's
diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h
index dfebb7c..095d829 100644
--- a/arch/m68k/include/asm/page.h
+++ b/arch/m68k/include/asm/page.h
@@ -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>
diff --git a/arch/m68k/include/asm/pgtable.h b/arch/m68k/include/asm/pgtable.h
index ee6759e..a3d733b 100644
--- a/arch/m68k/include/asm/pgtable.h
+++ b/arch/m68k/include/asm/pgtable.h
@@ -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
diff --git a/arch/m68k/include/asm/q40_master.h b/arch/m68k/include/asm/q40_master.h
index 3907a09..fc5b362 100644
--- a/arch/m68k/include/asm/q40_master.h
+++ b/arch/m68k/include/asm/q40_master.h
@@ -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)
diff --git a/arch/m68k/include/asm/uaccess.h b/arch/m68k/include/asm/uaccess.h
index 38f92db..639c731 100644
--- a/arch/m68k/include/asm/uaccess.h
+++ b/arch/m68k/include/asm/uaccess.h
@@ -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
diff --git a/arch/microblaze/include/asm/mmu_context.h b/arch/microblaze/include/asm/mmu_context.h
index 24eab16..0ccd8c4 100644
--- a/arch/microblaze/include/asm/mmu_context.h
+++ b/arch/microblaze/include/asm/mmu_context.h
@@ -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
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
index 91180fa..1e08044 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
@@ -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.
diff --git a/arch/mips/include/asm/mach-pnx833x/gpio.h b/arch/mips/include/asm/mach-pnx833x/gpio.h
index ed3a88d..f192acf 100644
--- a/arch/mips/include/asm/mach-pnx833x/gpio.h
+++ b/arch/mips/include/asm/mach-pnx833x/gpio.h
@@ -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)
diff --git a/arch/mips/include/asm/octeon/cvmx-asm.h b/arch/mips/include/asm/octeon/cvmx-asm.h
index 5de5de9..31eacc2 100644
--- a/arch/mips/include/asm/octeon/cvmx-asm.h
+++ b/arch/mips/include/asm/octeon/cvmx-asm.h
@@ -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")
diff --git a/arch/mips/include/asm/octeon/cvmx-spinlock.h b/arch/mips/include/asm/octeon/cvmx-spinlock.h
index 2fbf087..a672abb 100644
--- a/arch/mips/include/asm/octeon/cvmx-spinlock.h
+++ b/arch/mips/include/asm/octeon/cvmx-spinlock.h
@@ -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 */
 
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h
index 7e12867..3a143a6 100644
--- a/arch/mips/include/asm/octeon/cvmx.h
+++ b/arch/mips/include/asm/octeon/cvmx.h
@@ -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
diff --git a/arch/mips/include/asm/octeon/octeon-model.h b/arch/mips/include/asm/octeon/octeon-model.h
index 700f88e..40b81ce 100644
--- a/arch/mips/include/asm/octeon/octeon-model.h
+++ b/arch/mips/include/asm/octeon/octeon-model.h
@@ -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__ */
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h
index f72f768..e314b35 100644
--- a/arch/mips/include/asm/octeon/octeon.h
+++ b/arch/mips/include/asm/octeon/octeon.h
@@ -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,
diff --git a/arch/mips/include/asm/sibyte/bcm1480_int.h b/arch/mips/include/asm/sibyte/bcm1480_int.h
index 6109557..fffb224 100644
--- a/arch/mips/include/asm/sibyte/bcm1480_int.h
+++ b/arch/mips/include/asm/sibyte/bcm1480_int.h
@@ -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
diff --git a/arch/mips/include/asm/sibyte/bcm1480_l2c.h b/arch/mips/include/asm/sibyte/bcm1480_l2c.h
index fd75817..725d38c 100644
--- a/arch/mips/include/asm/sibyte/bcm1480_l2c.h
+++ b/arch/mips/include/asm/sibyte/bcm1480_l2c.h
@@ -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)
diff --git a/arch/mips/include/asm/sibyte/bcm1480_mc.h b/arch/mips/include/asm/sibyte/bcm1480_mc.h
index f26a41a..4307a75 100644
--- a/arch/mips/include/asm/sibyte/bcm1480_mc.h
+++ b/arch/mips/include/asm/sibyte/bcm1480_mc.h
@@ -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)
diff --git a/arch/mips/include/asm/sibyte/bcm1480_regs.h b/arch/mips/include/asm/sibyte/bcm1480_regs.h
index b4077bb..84d168d 100644
--- a/arch/mips/include/asm/sibyte/bcm1480_regs.h
+++ b/arch/mips/include/asm/sibyte/bcm1480_regs.h
@@ -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>
 
 
 /*  *********************************************************************
diff --git a/arch/mips/include/asm/sibyte/bcm1480_scd.h b/arch/mips/include/asm/sibyte/bcm1480_scd.h
index 25ef24c..2af3706 100644
--- a/arch/mips/include/asm/sibyte/bcm1480_scd.h
+++ b/arch/mips/include/asm/sibyte/bcm1480_scd.h
@@ -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:
diff --git a/arch/mips/include/asm/sibyte/sb1250_dma.h b/arch/mips/include/asm/sibyte/sb1250_dma.h
index bad5617..6c44dfb 100644
--- a/arch/mips/include/asm/sibyte/sb1250_dma.h
+++ b/arch/mips/include/asm/sibyte/sb1250_dma.h
@@ -36,7 +36,7 @@
 #define _SB1250_DMA_H
 
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /*  *********************************************************************
     *  DMA Registers
diff --git a/arch/mips/include/asm/sibyte/sb1250_genbus.h b/arch/mips/include/asm/sibyte/sb1250_genbus.h
index 94e9c7c..a96ded1 100644
--- a/arch/mips/include/asm/sibyte/sb1250_genbus.h
+++ b/arch/mips/include/asm/sibyte/sb1250_genbus.h
@@ -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)
diff --git a/arch/mips/include/asm/sibyte/sb1250_int.h b/arch/mips/include/asm/sibyte/sb1250_int.h
index f2850b4..dbea73d 100644
--- a/arch/mips/include/asm/sibyte/sb1250_int.h
+++ b/arch/mips/include/asm/sibyte/sb1250_int.h
@@ -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
diff --git a/arch/mips/include/asm/sibyte/sb1250_l2c.h b/arch/mips/include/asm/sibyte/sb1250_l2c.h
index 6554dcf..b61a749 100644
--- a/arch/mips/include/asm/sibyte/sb1250_l2c.h
+++ b/arch/mips/include/asm/sibyte/sb1250_l2c.h
@@ -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)
diff --git a/arch/mips/include/asm/sibyte/sb1250_ldt.h b/arch/mips/include/asm/sibyte/sb1250_ldt.h
index 1e76cf1..bf7f320 100644
--- a/arch/mips/include/asm/sibyte/sb1250_ldt.h
+++ b/arch/mips/include/asm/sibyte/sb1250_ldt.h
@@ -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
diff --git a/arch/mips/include/asm/sibyte/sb1250_mac.h b/arch/mips/include/asm/sibyte/sb1250_mac.h
index 77f7872..cfc4d78 100644
--- a/arch/mips/include/asm/sibyte/sb1250_mac.h
+++ b/arch/mips/include/asm/sibyte/sb1250_mac.h
@@ -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
diff --git a/arch/mips/include/asm/sibyte/sb1250_mc.h b/arch/mips/include/asm/sibyte/sb1250_mc.h
index 1eb1b5a..15048dc 100644
--- a/arch/mips/include/asm/sibyte/sb1250_mc.h
+++ b/arch/mips/include/asm/sibyte/sb1250_mc.h
@@ -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)
diff --git a/arch/mips/include/asm/sibyte/sb1250_regs.h b/arch/mips/include/asm/sibyte/sb1250_regs.h
index 8f53ec8..29b9f0b 100644
--- a/arch/mips/include/asm/sibyte/sb1250_regs.h
+++ b/arch/mips/include/asm/sibyte/sb1250_regs.h
@@ -33,7 +33,7 @@
 #ifndef _SB1250_REGS_H
 #define _SB1250_REGS_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 
 /*  *********************************************************************
diff --git a/arch/mips/include/asm/sibyte/sb1250_scd.h b/arch/mips/include/asm/sibyte/sb1250_scd.h
index e49c3e8..615e165 100644
--- a/arch/mips/include/asm/sibyte/sb1250_scd.h
+++ b/arch/mips/include/asm/sibyte/sb1250_scd.h
@@ -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
diff --git a/arch/mips/include/asm/sibyte/sb1250_smbus.h b/arch/mips/include/asm/sibyte/sb1250_smbus.h
index 0476992..128d6b7 100644
--- a/arch/mips/include/asm/sibyte/sb1250_smbus.h
+++ b/arch/mips/include/asm/sibyte/sb1250_smbus.h
@@ -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)
diff --git a/arch/mips/include/asm/sibyte/sb1250_syncser.h b/arch/mips/include/asm/sibyte/sb1250_syncser.h
index d4b8558..274e917 100644
--- a/arch/mips/include/asm/sibyte/sb1250_syncser.h
+++ b/arch/mips/include/asm/sibyte/sb1250_syncser.h
@@ -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
diff --git a/arch/mips/include/asm/sibyte/sb1250_uart.h b/arch/mips/include/asm/sibyte/sb1250_uart.h
index d835bf2..bb99eca 100644
--- a/arch/mips/include/asm/sibyte/sb1250_uart.h
+++ b/arch/mips/include/asm/sibyte/sb1250_uart.h
@@ -33,7 +33,7 @@
 #ifndef _SB1250_UART_H
 #define _SB1250_UART_H
 
-#include "sb1250_defs.h"
+#include <asm/sibyte/sb1250_defs.h>
 
 /* **********************************************************************
    * DUART Registers
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index 7f065e1..0e15db4 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -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;
diff --git a/arch/powerpc/include/asm/ucc_fast.h b/arch/powerpc/include/asm/ucc_fast.h
index 839aab8..4644c84 100644
--- a/arch/powerpc/include/asm/ucc_fast.h
+++ b/arch/powerpc/include/asm/ucc_fast.h
@@ -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 */
diff --git a/arch/powerpc/include/asm/ucc_slow.h b/arch/powerpc/include/asm/ucc_slow.h
index 0980e6a..cf131ff 100644
--- a/arch/powerpc/include/asm/ucc_slow.h
+++ b/arch/powerpc/include/asm/ucc_slow.h
@@ -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 */
diff --git a/arch/sh/include/asm/checksum.h b/arch/sh/include/asm/checksum.h
index fc26d1f..34ae262 100644
--- a/arch/sh/include/asm/checksum.h
+++ b/arch/sh/include/asm/checksum.h
@@ -1,5 +1,5 @@
 #ifdef CONFIG_SUPERH32
-# include "checksum_32.h"
+# include <asm/checksum_32.h>
 #else
 # include <asm-generic/checksum.h>
 #endif
diff --git a/arch/sh/include/asm/mmu_context.h b/arch/sh/include/asm/mmu_context.h
index 384c747..21c5088 100644
--- a/arch/sh/include/asm/mmu_context.h
+++ b/arch/sh/include/asm/mmu_context.h
@@ -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
 
 /*
diff --git a/arch/sh/include/asm/posix_types.h b/arch/sh/include/asm/posix_types.h
index 4eeb723..f08449b 100644
--- a/arch/sh/include/asm/posix_types.h
+++ b/arch/sh/include/asm/posix_types.h
@@ -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__ */
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 9c7bdfc..9dc9475 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -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 */
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h
index b97baf8..78a1cd6 100644
--- a/arch/sh/include/asm/ptrace.h
+++ b/arch/sh/include/asm/ptrace.h
@@ -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__
diff --git a/arch/sh/include/asm/string.h b/arch/sh/include/asm/string.h
index 8c1ea21d..114011f 100644
--- a/arch/sh/include/asm/string.h
+++ b/arch/sh/include/asm/string.h
@@ -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
diff --git a/arch/sh/include/asm/syscall.h b/arch/sh/include/asm/syscall.h
index aa7777b..847128d 100644
--- a/arch/sh/include/asm/syscall.h
+++ b/arch/sh/include/asm/syscall.h
@@ -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 */
diff --git a/arch/sh/include/asm/syscalls.h b/arch/sh/include/asm/syscalls.h
index 507725a..3dbfef0 100644
--- a/arch/sh/include/asm/syscalls.h
+++ b/arch/sh/include/asm/syscalls.h
@@ -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__ */
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
index 10c8b18..507d082 100644
--- a/arch/sh/include/asm/system.h
+++ b/arch/sh/include/asm/system.h
@@ -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
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h
index ec88bfc..e61d43d 100644
--- a/arch/sh/include/asm/tlb.h
+++ b/arch/sh/include/asm/tlb.h
@@ -2,7 +2,7 @@
 #define __ASM_SH_TLB_H
 
 #ifdef CONFIG_SUPERH64
-# include "tlb_64.h"
+# include <asm/tlb_64.h>
 #endif
 
 #ifndef __ASSEMBLY__
diff --git a/arch/sh/include/asm/uaccess.h b/arch/sh/include/asm/uaccess.h
index 075848f..ee4cf16 100644
--- a/arch/sh/include/asm/uaccess.h
+++ b/arch/sh/include/asm/uaccess.h
@@ -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.  */
diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h
index 65be656..5e845e8 100644
--- a/arch/sh/include/asm/unistd.h
+++ b/arch/sh/include/asm/unistd.h
@@ -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
diff --git a/arch/sh/include/mach-ecovec24/mach/romimage.h b/arch/sh/include/mach-ecovec24/mach/romimage.h
index d63ef51..60f3e8a 100644
--- a/arch/sh/include/mach-ecovec24/mach/romimage.h
+++ b/arch/sh/include/mach-ecovec24/mach/romimage.h
@@ -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
diff --git a/arch/sh/include/mach-kfr2r09/mach/romimage.h b/arch/sh/include/mach-kfr2r09/mach/romimage.h
index 7a88316..1afae21 100644
--- a/arch/sh/include/mach-kfr2r09/mach/romimage.h
+++ b/arch/sh/include/mach-kfr2r09/mach/romimage.h
@@ -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
diff --git a/arch/unicore32/include/mach/PKUnity.h b/arch/unicore32/include/mach/PKUnity.h
index 8040d57..46705af 100644
--- a/arch/unicore32/include/mach/PKUnity.h
+++ b/arch/unicore32/include/mach/PKUnity.h
@@ -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>
 
diff --git a/arch/unicore32/include/mach/hardware.h b/arch/unicore32/include/mach/hardware.h
index 930bea6..9e20b5d 100644
--- a/arch/unicore32/include/mach/hardware.h
+++ b/arch/unicore32/include/mach/hardware.h
@@ -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)
diff --git a/arch/unicore32/include/mach/uncompress.h b/arch/unicore32/include/mach/uncompress.h
index 142d3e7..9be67c9 100644
--- a/arch/unicore32/include/mach/uncompress.h
+++ b/arch/unicore32/include/mach/uncompress.h
@@ -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[];
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h
index 10572e3..365f653 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/arch/x86/include/asm/atomic.h
@@ -313,9 +313,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
 
 #endif /* _ASM_X86_ATOMIC_H */
diff --git a/arch/x86/include/asm/calling.h b/arch/x86/include/asm/calling.h
index a9e3a74..3742210 100644
--- a/arch/x86/include/asm/calling.h
+++ b/arch/x86/include/asm/calling.h
@@ -46,7 +46,7 @@ For 32-bit we have the following conventions - kernel is built with
 
 */
 
-#include "dwarf2.h"
+#include <asm/dwarf2.h>
 
 /*
  * 64-bit system call stack frame layout defines and helpers, for
diff --git a/arch/x86/include/asm/checksum.h b/arch/x86/include/asm/checksum.h
index 848850f..5f5bb0f 100644
--- a/arch/x86/include/asm/checksum.h
+++ b/arch/x86/include/asm/checksum.h
@@ -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
diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index a460fa0..ed14064 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -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
diff --git a/arch/x86/include/asm/mmzone.h b/arch/x86/include/asm/mmzone.h
index 64217ea..d497bc4 100644
--- a/arch/x86/include/asm/mmzone.h
+++ b/arch/x86/include/asm/mmzone.h
@@ -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
diff --git a/arch/x86/include/asm/mutex.h b/arch/x86/include/asm/mutex.h
index a731b9c..7d3a482 100644
--- a/arch/x86/include/asm/mutex.h
+++ b/arch/x86/include/asm/mutex.h
@@ -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
diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h
index bfacd2c..49119fc 100644
--- a/arch/x86/include/asm/numa.h
+++ b/arch/x86/include/asm/numa.h
@@ -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
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index d498943..65de77d 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -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 */
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 18601c8..fe8576b 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -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__
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 013286a..4f57b27 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -174,9 +174,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__
diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h
index bb7133d..8ddf6f5 100644
--- a/arch/x86/include/asm/posix_types.h
+++ b/arch/x86/include/asm/posix_types.h
@@ -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
diff --git a/arch/x86/include/asm/seccomp.h b/arch/x86/include/asm/seccomp.h
index c62e58a..0f3d7f0 100644
--- a/arch/x86/include/asm/seccomp.h
+++ b/arch/x86/include/asm/seccomp.h
@@ -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
diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
index 6dfd6d9..09224d7 100644
--- a/arch/x86/include/asm/string.h
+++ b/arch/x86/include/asm/string.h
@@ -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
diff --git a/arch/x86/include/asm/suspend.h b/arch/x86/include/asm/suspend.h
index 9bd521f..2fab6c2 100644
--- a/arch/x86/include/asm/suspend.h
+++ b/arch/x86/include/asm/suspend.h
@@ -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
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 36361bf..3011cc5 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -570,9 +570,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 */
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h
index 2a58ed3..762be46 100644
--- a/arch/x86/include/asm/unistd.h
+++ b/arch/x86/include/asm/unistd.h
@@ -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
diff --git a/arch/x86/include/asm/user.h b/arch/x86/include/asm/user.h
index 24532c7..ccab4af 100644
--- a/arch/x86/include/asm/user.h
+++ b/arch/x86/include/asm/user.h
@@ -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>
diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h
index 5d4922a..b85afb6 100644
--- a/arch/x86/include/asm/xen/interface.h
+++ b/arch/x86/include/asm/xen/interface.h
@@ -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__
diff --git a/arch/x86/include/asm/xor.h b/arch/x86/include/asm/xor.h
index 7fcf6f3..f8fde90 100644
--- a/arch/x86/include/asm/xor.h
+++ b/arch/x86/include/asm/xor.h
@@ -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
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index de39915..b187b49 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -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__ */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 4543b6f..cb68ea3 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -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 */
 
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 2ed0a84..dae6451 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -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;
 
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 5af3ed5..f6cb696 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -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"
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index f72403c..9d7ad3f 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -108,7 +108,7 @@
 
 /* Linux uses GCC */
 
-#include "acgcc.h"
+#include <acpi/platform/acgcc.h>
 
 
 #ifdef __KERNEL__
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 4be33b4..cc23e0f 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -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)
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 9b7c2bb..6fd0f16 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -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 {
@@ -1260,7 +1260,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);
@@ -1548,7 +1548,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)
@@ -1654,7 +1654,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,
diff --git a/include/drm/drm_buffer.h b/include/drm/drm_buffer.h
index 322dbff..c80d3a3 100644
--- a/include/drm/drm_buffer.h
+++ b/include/drm/drm_buffer.h
@@ -35,7 +35,7 @@
 #ifndef _DRM_BUFFER_H_
 #define _DRM_BUFFER_H_
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 struct drm_buffer {
 	int iterator;
diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h
index 2f65633..a8d8053 100644
--- a/include/drm/drm_encoder_slave.h
+++ b/include/drm/drm_encoder_slave.h
@@ -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
diff --git a/include/drm/drm_memory.h b/include/drm/drm_memory.h
index 15af9b3..4baf57a 100644
--- a/include/drm/drm_memory.h
+++ b/include/drm/drm_memory.h
@@ -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
diff --git a/include/drm/drm_sarea.h b/include/drm/drm_sarea.h
index ee5389d..d3aedc9 100644
--- a/include/drm/drm_sarea.h
+++ b/include/drm/drm_sarea.h
@@ -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__)
diff --git a/include/drm/drm_sman.h b/include/drm/drm_sman.h
index 08ecf83..d333112 100644
--- a/include/drm/drm_sman.h
+++ b/include/drm/drm_sman.h
@@ -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.
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index c4d6dbf..e458c1f 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -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.
diff --git a/include/drm/mga_drm.h b/include/drm/mga_drm.h
index fca8170..2375bfd 100644
--- a/include/drm/mga_drm.h
+++ b/include/drm/mga_drm.h
@@ -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)
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
index b65be60..1e182d0 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -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)
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 42e3469..6018c08 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -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>
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 94eb143..fa435d9 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -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;
 
diff --git a/include/drm/ttm/ttm_execbuf_util.h b/include/drm/ttm/ttm_execbuf_util.h
index 26cc7f9..1926cae 100644
--- a/include/drm/ttm/ttm_execbuf_util.h
+++ b/include/drm/ttm/ttm_execbuf_util.h
@@ -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>
 
 /**
diff --git a/include/drm/ttm/ttm_lock.h b/include/drm/ttm/ttm_lock.h
index 2e7f0c9..2902beb 100644
--- a/include/drm/ttm/ttm_lock.h
+++ b/include/drm/ttm/ttm_lock.h
@@ -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 <linux/atomic.h>
 
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h
index e46054e..b01c563 100644
--- a/include/drm/ttm/ttm_object.h
+++ b/include/drm/ttm/ttm_object.h
@@ -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>
 
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h
index 129de12..4963407 100644
--- a/include/drm/ttm/ttm_page_alloc.h
+++ b/include/drm/ttm/ttm_page_alloc.h
@@ -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.
diff --git a/include/drm/via_drm.h b/include/drm/via_drm.h
index fd11a5b..45bc80c 100644
--- a/include/drm/via_drm.h
+++ b/include/drm/via_drm.h
@@ -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.
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 8c96654..ca0f130 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -8,7 +8,7 @@
 #include <linux/bcma/bcma_driver_pci.h>
 #include <linux/ssb/ssb.h> /* SPROM sharing */
 
-#include "bcma_regs.h"
+#include <linux/bcma/bcma_regs.h>
 
 struct bcma_device;
 struct bcma_bus;
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index b8c6069..b8d618a 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -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
diff --git a/include/linux/ceph/debugfs.h b/include/linux/ceph/debugfs.h
index 2a79702..1df086d 100644
--- a/include/linux/ceph/debugfs.h
+++ b/include/linux/ceph/debugfs.h
@@ -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)		\
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h
index c5b6939..930441d 100644
--- a/include/linux/ceph/decode.h
+++ b/include/linux/ceph/decode.h
@@ -4,7 +4,7 @@
 #include <asm/unaligned.h>
 #include <linux/time.h>
 
-#include "types.h"
+#include <linux/ceph/types.h>
 
 /*
  * in all cases,
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 5637551..fcf3370 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -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
diff --git a/include/linux/ceph/mdsmap.h b/include/linux/ceph/mdsmap.h
index 4c5cb08..3abff9e 100644
--- a/include/linux/ceph/mdsmap.h
+++ b/include/linux/ceph/mdsmap.h
@@ -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.
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index d7adf15..9474077 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -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;
diff --git a/include/linux/ceph/mon_client.h b/include/linux/ceph/mon_client.h
index 545f859..6b80e63 100644
--- a/include/linux/ceph/mon_client.h
+++ b/include/linux/ceph/mon_client.h
@@ -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;
diff --git a/include/linux/ceph/msgpool.h b/include/linux/ceph/msgpool.h
index a362605..0d92733 100644
--- a/include/linux/ceph/msgpool.h
+++ b/include/linux/ceph/msgpool.h
@@ -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
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index f88eacb..caaf03a 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -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;
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index ba4c205..4ae6e27 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -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>
 
 /*
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index 0a99099..de91fbd 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -6,7 +6,7 @@
  * (Reliable Autonomic Distributed Object Store).
  */
 
-#include "msgr.h"
+#include <linux/ceph/msgr.h>
 
 /*
  * osdmap encoding versions
diff --git a/include/linux/ceph/types.h b/include/linux/ceph/types.h
index 28b35a0..d3ff1cf 100644
--- a/include/linux/ceph/types.h
+++ b/include/linux/ceph/types.h
@@ -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).
diff --git a/include/linux/crush/mapper.h b/include/linux/crush/mapper.h
index c46b99c..bfe81a5 100644
--- a/include/linux/crush/mapper.h
+++ b/include/linux/crush/mapper.h
@@ -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,
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h
index 0695431..82de1f9 100644
--- a/include/linux/drbd_tag_magic.h
+++ b/include/linux/drbd_tag_magic.h
@@ -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
diff --git a/include/linux/netfilter/nf_conntrack_h323_asn1.h b/include/linux/netfilter/nf_conntrack_h323_asn1.h
index 8dab596..3176a27 100644
--- a/include/linux/netfilter/nf_conntrack_h323_asn1.h
+++ b/include/linux/netfilter/nf_conntrack_h323_asn1.h
@@ -40,7 +40,7 @@
 /*****************************************************************************
  * H.323 Types
  ****************************************************************************/
-#include "nf_conntrack_h323_types.h"
+#include <linux/netfilter/nf_conntrack_h323_types.h>
 
 typedef struct {
 	enum {
diff --git a/include/scsi/osd_attributes.h b/include/scsi/osd_attributes.h
index 56e920a..303ba11 100644
--- a/include/scsi/osd_attributes.h
+++ b/include/scsi/osd_attributes.h
@@ -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
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h
index 572fb54..b2e85fd 100644
--- a/include/scsi/osd_initiator.h
+++ b/include/scsi/osd_initiator.h
@@ -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>
diff --git a/include/scsi/osd_sec.h b/include/scsi/osd_sec.h
index 4c09fee..f96151c 100644
--- a/include/scsi/osd_sec.h
+++ b/include/scsi/osd_sec.h
@@ -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
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 02cbb50..fdeb8dc 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -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
diff --git a/include/sound/ad1816a.h b/include/sound/ad1816a.h
index d010858..a7d8dc7 100644
--- a/include/sound/ad1816a.h
+++ b/include/sound/ad1816a.h
@@ -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)
 
diff --git a/include/sound/ak4531_codec.h b/include/sound/ak4531_codec.h
index 575296c..85ea86e 100644
--- a/include/sound/ak4531_codec.h
+++ b/include/sound/ak4531_codec.h
@@ -25,8 +25,8 @@
  *
  */
 
-#include "info.h"
-#include "control.h"
+#include <sound/info.h>
+#include <sound/control.h>
 
 /*
  *  ASAHI KASEI - AK4531 codec
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index e3005a6..bc246a1 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -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
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h
index 8008c59..b4ed2b4 100644
--- a/include/sound/cs46xx_dsp_spos.h
+++ b/include/sound/cs46xx_dsp_spos.h
@@ -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
diff --git a/include/sound/cs46xx_dsp_task_types.h b/include/sound/cs46xx_dsp_task_types.h
index 5cf920b..27df60e 100644
--- a/include/sound/cs46xx_dsp_task_types.h
+++ b/include/sound/cs46xx_dsp_task_types.h
@@ -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
diff --git a/include/sound/emu10k1_synth.h b/include/sound/emu10k1_synth.h
index 6ef61c4..9f211e9 100644
--- a/include/sound/emu10k1_synth.h
+++ b/include/sound/emu10k1_synth.h
@@ -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"
diff --git a/include/sound/emu8000.h b/include/sound/emu8000.h
index c8f66bd..c321302 100644
--- a/include/sound/emu8000.h
+++ b/include/sound/emu8000.h
@@ -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.
diff --git a/include/sound/emux_legacy.h b/include/sound/emux_legacy.h
index 6fe3da2..baf43fc 100644
--- a/include/sound/emux_legacy.h
+++ b/include/sound/emux_legacy.h
@@ -22,7 +22,7 @@
  *
  */
 
-#include "seq_oss_legacy.h"
+#include <sound/seq_oss_legacy.h>
 
 /*
  * awe hardware controls
diff --git a/include/sound/emux_synth.h b/include/sound/emux_synth.h
index d8cb51b..fb81f37 100644
--- a/include/sound/emux_synth.h
+++ b/include/sound/emux_synth.h
@@ -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
diff --git a/include/sound/es1688.h b/include/sound/es1688.h
index 3ec7ecb..7bd4243 100644
--- a/include/sound/es1688.h
+++ b/include/sound/es1688.h
@@ -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
diff --git a/include/sound/gus.h b/include/sound/gus.h
index 841bb8d..42905d8 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -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 */
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h
index 1f1d53f..a85ce16 100644
--- a/include/sound/mpu401.h
+++ b/include/sound/mpu401.h
@@ -22,7 +22,7 @@
  *
  */
 
-#include "rawmidi.h"
+#include <sound/rawmidi.h>
 #include <linux/interrupt.h>
 
 #define MPU401_HW_MPU401		1	/* native MPU401 */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 57e71fa..3d96d3d 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -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
 
 /*
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 6b14359..adf0885 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -30,7 +30,7 @@
 #include <linux/workqueue.h>
 
 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
-#include "seq_device.h"
+#include <sound/seq_device.h>
 #endif
 
 /*
diff --git a/include/sound/sb.h b/include/sound/sb.h
index 9535354..ba39603 100644
--- a/include/sound/sb.h
+++ b/include/sound/sb.h
@@ -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>
 
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index af1b49e..7e95056 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -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;
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
index 3d9afb6..34fb34c 100644
--- a/include/sound/seq_kernel.h
+++ b/include/sound/seq_kernel.h
@@ -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;
diff --git a/include/sound/seq_midi_emul.h b/include/sound/seq_midi_emul.h
index d6c4615..8139d8c 100644
--- a/include/sound/seq_midi_emul.h
+++ b/include/sound/seq_midi_emul.h
@@ -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
diff --git a/include/sound/seq_midi_event.h b/include/sound/seq_midi_event.h
index 5efab8b..e40f43e 100644
--- a/include/sound/seq_midi_event.h
+++ b/include/sound/seq_midi_event.h
@@ -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
 
diff --git a/include/sound/seq_oss.h b/include/sound/seq_oss.h
index 9b060bb..d0b27ec 100644
--- a/include/sound/seq_oss.h
+++ b/include/sound/seq_oss.h
@@ -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
diff --git a/include/sound/seq_virmidi.h b/include/sound/seq_virmidi.h
index d888433..a03acd0 100644
--- a/include/sound/seq_virmidi.h
+++ b/include/sound/seq_virmidi.h
@@ -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:
diff --git a/include/sound/snd_wavefront.h b/include/sound/snd_wavefront.h
index fa149ca..35e94b3 100644
--- a/include/sound/snd_wavefront.h
+++ b/include/sound/snd_wavefront.h
@@ -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 */
 
diff --git a/include/sound/soundfont.h b/include/sound/soundfont.h
index 679df05..7c93efd 100644
--- a/include/sound/soundfont.h
+++ b/include/sound/soundfont.h
@@ -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 */
diff --git a/include/sound/tea6330t.h b/include/sound/tea6330t.h
index 51b282b..e6beec2 100644
--- a/include/sound/tea6330t.h
+++ b/include/sound/tea6330t.h
@@ -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,
diff --git a/include/sound/trident.h b/include/sound/trident.h
index 9f191a0..9b3b03e 100644
--- a/include/sound/trident.h
+++ b/include/sound/trident.h
@@ -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)
diff --git a/include/sound/wss.h b/include/sound/wss.h
index fd01f22..0c7f034 100644
--- a/include/sound/wss.h
+++ b/include/sound/wss.h
@@ -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 */
 
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index 444cd6b..5db53b6 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -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>
 
 /*
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
index 388bcdd..fde1b3e 100644
--- a/include/trace/events/compaction.h
+++ b/include/trace/events/compaction.h
@@ -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,
 
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index a9c87ad..f0e1523 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -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,
 
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 36851f7..026a298 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -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
diff --git a/include/xen/interface/callback.h b/include/xen/interface/callback.h
index 2ae3cd2..8c5fa0e 100644
--- a/include/xen/interface/callback.h
+++ b/include/xen/interface/callback.h
@@ -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:
diff --git a/include/xen/interface/hvm/params.h b/include/xen/interface/hvm/params.h
index 1888d8c..f5bc22b 100644
--- a/include/xen/interface/hvm/params.h
+++ b/include/xen/interface/hvm/params.h
@@ -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.
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index 3d5d6db..2165651 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -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
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h
index cb94668..9dfc120 100644
--- a/include/xen/interface/io/netif.h
+++ b/include/xen/interface/io/netif.h
@@ -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
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h
index dd55dac..9ce0839 100644
--- a/include/xen/interface/sched.h
+++ b/include/xen/interface/sched.h
@@ -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:
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
index e8b6519..ff372a5 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -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


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

* [PATCH 03/40] UAPI: Add script to audit drivers/gpu/ for #including system headers with "..." [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
  2011-07-28 15:49 ` [PATCH 01/40] UAPI: Add script to convert #include "..." to #include <path/...> in sys headers " David Howells
  2011-07-28 15:49 ` [PATCH 02/40] UAPI: Convert #include "..." to #include <path/...> in kernel system " David Howells
@ 2011-07-28 15:49 ` David Howells
  2011-07-28 15:49 ` [PATCH 04/40] UAPI: Convert #include "..." to #include <path/...> in kernel system headers " David Howells
                   ` (36 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:49 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 scripts/uapi-disintegration/drm-headers.pl |  103 ++++++++++++++++++++++++++++
 1 files changed, 103 insertions(+), 0 deletions(-)
 create mode 100755 scripts/uapi-disintegration/drm-headers.pl

diff --git a/scripts/uapi-disintegration/drm-headers.pl b/scripts/uapi-disintegration/drm-headers.pl
new file mode 100755
index 0000000..eab3eab
--- /dev/null
+++ b/scripts/uapi-disintegration/drm-headers.pl
@@ -0,0 +1,103 @@
+#!/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" .
+       "' --sign 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;


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

* [PATCH 04/40] UAPI: Convert #include "..." to #include <path/...> in kernel system headers [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (2 preceding siblings ...)
  2011-07-28 15:49 ` [PATCH 03/40] UAPI: Add script to audit drivers/gpu/ for #including system headers with "..." " David Howells
@ 2011-07-28 15:49 ` David Howells
  2011-07-28 15:50 ` [PATCH 05/40] UAPI: Add include/uapi/ directories to build " David Howells
                   ` (35 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:49 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 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               |    6 +++---
 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 +-
 279 files changed, 648 insertions(+), 648 deletions(-)

diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c
index 1c36492..d2c6b78 100644
--- a/drivers/gpu/drm/ati_pcigart.c
+++ b/drivers/gpu/drm/ati_pcigart.c
@@ -31,7 +31,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 # define ATI_PCIGART_PAGE_SIZE		4096	/**< PCI GART page size */
 
diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index 0cb2ba5..3d8fed1 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -31,7 +31,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 
diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
index 3f46772..7e83cc4 100644
--- a/drivers/gpu/drm/drm_auth.c
+++ b/drivers/gpu/drm/drm_auth.c
@@ -33,7 +33,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /**
  * Find the file with the given magic number.
diff --git a/drivers/gpu/drm/drm_buffer.c b/drivers/gpu/drm/drm_buffer.c
index 529a0db..bc5def7 100644
--- a/drivers/gpu/drm/drm_buffer.c
+++ b/drivers/gpu/drm/drm_buffer.c
@@ -32,7 +32,7 @@
  * Pauli Nieminen <suokkos-at-gmail-dot-com>
  */
 
-#include "drm_buffer.h"
+#include <drm/drm_buffer.h>
 
 /**
  * Allocate the drm buffer object.
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 61e1ef9..a69786c 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -37,7 +37,7 @@
 #include <linux/slab.h>
 #include <linux/log2.h>
 #include <asm/shmparam.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
 						  struct drm_local_map *map)
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
index 0e3bd5b..74c711a 100644
--- a/drivers/gpu/drm/drm_cache.c
+++ b/drivers/gpu/drm/drm_cache.c
@@ -28,7 +28,7 @@
  * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #if defined(CONFIG_X86)
 static void
diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c
index 6d440fb..8c2474c 100644
--- a/drivers/gpu/drm/drm_context.c
+++ b/drivers/gpu/drm/drm_context.c
@@ -40,7 +40,7 @@
  *		needed by SiS driver's memory management.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /******************************************************************/
 /** \name Context bitmap support */
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 82db185..a9b78a7 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -31,10 +31,10 @@
  */
 #include <linux/list.h>
 #include <linux/slab.h>
-#include "drm.h"
-#include "drmP.h"
-#include "drm_crtc.h"
-#include "drm_edid.h"
+#include <drm/drm.h>
+#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_edid.h>
 
 struct drm_prop_enum_list {
 	int type;
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index f88a9b2..006e606 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -29,10 +29,10 @@
  *      Jesse Barnes <jesse.barnes@intel.com>
  */
 
-#include "drmP.h"
-#include "drm_crtc.h"
-#include "drm_crtc_helper.h"
-#include "drm_fb_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 
 static bool drm_kms_helper_poll = true;
 module_param_named(poll, drm_kms_helper_poll, bool, 0600);
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 9d8c892..f736178 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -33,7 +33,7 @@
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #if defined(CONFIG_DEBUG_FS)
 
diff --git a/drivers/gpu/drm/drm_dma.c b/drivers/gpu/drm/drm_dma.c
index 252cbd7..9764b07 100644
--- a/drivers/gpu/drm/drm_dma.c
+++ b/drivers/gpu/drm/drm_dma.c
@@ -33,7 +33,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /**
  * Initialize the DMA data.
diff --git a/drivers/gpu/drm/drm_dp_i2c_helper.c b/drivers/gpu/drm/drm_dp_i2c_helper.c
index f7eba0a..7f246f2 100644
--- a/drivers/gpu/drm/drm_dp_i2c_helper.c
+++ b/drivers/gpu/drm/drm_dp_i2c_helper.c
@@ -27,8 +27,8 @@
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/i2c.h>
-#include "drm_dp_helper.h"
-#include "drmP.h"
+#include <drm/drm_dp_helper.h>
+#include <drm/drmP.h>
 
 /* Run a single AUX_CH I2C transaction, writing/reading data as necessary */
 static int
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 93a112d..4df5805 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -48,8 +48,8 @@
 
 #include <linux/debugfs.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm_core.h"
+#include <drm/drmP.h>
+#include <drm/drm_core.h>
 
 
 static int drm_version(struct drm_device *dev, void *data,
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 756af4d..8e0f3a0 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -30,8 +30,8 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
-#include "drmP.h"
-#include "drm_edid.h"
+#include <drm/drmP.h>
+#include <drm/drm_edid.h>
 #include "drm_edid_modes.h"
 
 #define version_greater(edid, maj, min) \
diff --git a/drivers/gpu/drm/drm_edid_modes.h b/drivers/gpu/drm/drm_edid_modes.h
index 5f20644..f84acdc 100644
--- a/drivers/gpu/drm/drm_edid_modes.h
+++ b/drivers/gpu/drm/drm_edid_modes.h
@@ -24,8 +24,8 @@
  */
 
 #include <linux/kernel.h>
-#include "drmP.h"
-#include "drm_edid.h"
+#include <drm/drmP.h>
+#include <drm/drm_edid.h>
 
 /*
  * Autogenerated from the DMT spec.
diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c
index d62c064..2fc7bbb 100644
--- a/drivers/gpu/drm/drm_encoder_slave.c
+++ b/drivers/gpu/drm/drm_encoder_slave.c
@@ -24,7 +24,7 @@
  *
  */
 
-#include "drm_encoder_slave.h"
+#include <drm/drm_encoder_slave.h>
 
 /**
  * drm_i2c_encoder_init - Initialize an I2C slave encoder
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 802b61a..bcfba54 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -31,10 +31,10 @@
 #include <linux/sysrq.h>
 #include <linux/slab.h>
 #include <linux/fb.h>
-#include "drmP.h"
-#include "drm_crtc.h"
-#include "drm_fb_helper.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_fb_helper.h>
+#include <drm/drm_crtc_helper.h>
 
 MODULE_AUTHOR("David Airlie, Jesse Barnes");
 MODULE_DESCRIPTION("DRM KMS helper");
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 2ec7d48..c419aa1 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -34,7 +34,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include <linux/poll.h>
 #include <linux/slab.h>
 
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 186d62e..dc4ac02 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -35,7 +35,7 @@
 #include <linux/mman.h>
 #include <linux/pagemap.h>
 #include <linux/shmem_fs.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /** @file drm_gem.c
  *
diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c
index c87dc96..f731116 100644
--- a/drivers/gpu/drm/drm_global.c
+++ b/drivers/gpu/drm/drm_global.c
@@ -31,7 +31,7 @@
 #include <linux/mutex.h>
 #include <linux/slab.h>
 #include <linux/module.h>
-#include "drm_global.h"
+#include <drm/drm_global.h>
 
 struct drm_global_item {
 	struct mutex mutex;
diff --git a/drivers/gpu/drm/drm_hashtab.c b/drivers/gpu/drm/drm_hashtab.c
index e3a7568..9d4cfa1 100644
--- a/drivers/gpu/drm/drm_hashtab.c
+++ b/drivers/gpu/drm/drm_hashtab.c
@@ -32,8 +32,8 @@
  * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
  */
 
-#include "drmP.h"
-#include "drm_hashtab.h"
+#include <drm/drmP.h>
+#include <drm/drm_hashtab.h>
 #include <linux/hash.h>
 #include <linux/slab.h>
 
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
index ab1162d..50afc9e 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -34,7 +34,7 @@
  */
 
 #include <linux/seq_file.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /**
  * Called when "/proc/dri/.../name" is read.
diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index 4a058c7..f32ebdf 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -30,8 +30,8 @@
 #include <linux/compat.h>
 #include <linux/ratelimit.h>
 
-#include "drmP.h"
-#include "drm_core.h"
+#include <drm/drmP.h>
+#include <drm/drm_core.h>
 
 #define DRM_IOCTL_VERSION32		DRM_IOWR(0x00, drm_version32_t)
 #define DRM_IOCTL_GET_UNIQUE32		DRM_IOWR(0x01, drm_unique32_t)
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 904d7e9..2c0dde6 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -33,10 +33,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm_core.h"
+#include <drm/drmP.h>
+#include <drm/drm_core.h>
 
-#include "linux/pci.h"
+#include <linux/pci.h>
 
 /**
  * Get the bus id.
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 2022a5c..c9481db 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -33,7 +33,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "drm_trace.h"
 
 #include <linux/interrupt.h>	/* For task queue support */
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
index 632ae24..9886a9a 100644
--- a/drivers/gpu/drm/drm_lock.c
+++ b/drivers/gpu/drm/drm_lock.c
@@ -33,7 +33,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 static int drm_notifier(void *priv);
 
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index c9b8050..8571466 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -34,7 +34,7 @@
  */
 
 #include <linux/highmem.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /**
  * Called when "/proc/dri/%dev%/mem" is read.
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 959186c..e220cd9 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -41,8 +41,8 @@
  * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
  */
 
-#include "drmP.h"
-#include "drm_mm.h"
+#include <drm/drmP.h>
+#include <drm/drm_mm.h>
 #include <linux/slab.h>
 #include <linux/seq_file.h>
 
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index ad74fb4..10fb0e9 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -32,9 +32,9 @@
 
 #include <linux/list.h>
 #include <linux/list_sort.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
 
 /**
  * drm_mode_debug_printmodeline - debug print a mode
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index b6a19cb..ce6708d 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -39,7 +39,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/dma-mapping.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /**********************************************************************/
 /** \name PCI memory */
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
index 2a8b626..b79dcf4 100644
--- a/drivers/gpu/drm/drm_platform.c
+++ b/drivers/gpu/drm/drm_platform.c
@@ -25,7 +25,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /**
  * Register.
diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c
index 9e5b07e..39191f9 100644
--- a/drivers/gpu/drm/drm_proc.c
+++ b/drivers/gpu/drm/drm_proc.c
@@ -39,7 +39,7 @@
 
 #include <linux/seq_file.h>
 #include <linux/slab.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 /***************************************************
  * Initialization, etc.
diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c
index 7525e03..d87f60b 100644
--- a/drivers/gpu/drm/drm_scatter.c
+++ b/drivers/gpu/drm/drm_scatter.c
@@ -33,7 +33,7 @@
 
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #define DEBUG_SCATTER 0
 
diff --git a/drivers/gpu/drm/drm_sman.c b/drivers/gpu/drm/drm_sman.c
index 3466458..84905da 100644
--- a/drivers/gpu/drm/drm_sman.c
+++ b/drivers/gpu/drm/drm_sman.c
@@ -36,7 +36,7 @@
  * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
  */
 
-#include "drm_sman.h"
+#include <drm/drm_sman.h>
 
 struct drm_owner_item {
 	struct drm_hash_item owner_hash;
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 6d7b083..df1587b 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -34,8 +34,8 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm_core.h"
+#include <drm/drmP.h>
+#include <drm/drm_core.h>
 
 unsigned int drm_debug = 0;	/* 1 to enable debug output */
 EXPORT_SYMBOL(drm_debug);
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 2eee8e0..395a0af 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -17,9 +17,9 @@
 #include <linux/gfp.h>
 #include <linux/err.h>
 
-#include "drm_sysfs.h"
-#include "drm_core.h"
-#include "drmP.h"
+#include <drm/drm_sysfs.h>
+#include <drm/drm_core.h>
+#include <drm/drmP.h>
 
 #define to_drm_minor(d) container_of(d, struct drm_minor, kdev)
 #define to_drm_connector(d) container_of(d, struct drm_connector, kdev)
diff --git a/drivers/gpu/drm/drm_trace_points.c b/drivers/gpu/drm/drm_trace_points.c
index 0d0eb90..3bbc4de 100644
--- a/drivers/gpu/drm/drm_trace_points.c
+++ b/drivers/gpu/drm/drm_trace_points.c
@@ -1,4 +1,4 @@
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #define CREATE_TRACE_POINTS
 #include "drm_trace.h"
diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c
index 206d230..4d270ea 100644
--- a/drivers/gpu/drm/drm_usb.c
+++ b/drivers/gpu/drm/drm_usb.c
@@ -1,4 +1,4 @@
-#include "drmP.h"
+#include <drm/drmP.h>
 #include <linux/usb.h>
 
 #ifdef CONFIG_USB
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 5db96d45..ad58cd7 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -33,7 +33,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #if defined(__ia64__)
 #include <linux/efi.h>
 #include <linux/slab.h>
diff --git a/drivers/gpu/drm/i2c/ch7006_priv.h b/drivers/gpu/drm/i2c/ch7006_priv.h
index 17667b7..6738041 100644
--- a/drivers/gpu/drm/i2c/ch7006_priv.h
+++ b/drivers/gpu/drm/i2c/ch7006_priv.h
@@ -27,10 +27,10 @@
 #ifndef __DRM_I2C_CH7006_PRIV_H__
 #define __DRM_I2C_CH7006_PRIV_H__
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
-#include "drm_encoder_slave.h"
-#include "i2c/ch7006.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_encoder_slave.h>
+#include <drm/i2c/ch7006.h>
 
 typedef int64_t fixed;
 #define fixed1 (1LL << 32)
diff --git a/drivers/gpu/drm/i2c/sil164_drv.c b/drivers/gpu/drm/i2c/sil164_drv.c
index 0b67732..6e2e6b1 100644
--- a/drivers/gpu/drm/i2c/sil164_drv.c
+++ b/drivers/gpu/drm/i2c/sil164_drv.c
@@ -24,10 +24,10 @@
  *
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
-#include "drm_encoder_slave.h"
-#include "i2c/sil164.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_encoder_slave.h>
+#include <drm/i2c/sil164.h>
 
 struct sil164_priv {
 	struct sil164_encoder_params config;
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
index 8f371e8..fae014f 100644
--- a/drivers/gpu/drm/i810/i810_dma.c
+++ b/drivers/gpu/drm/i810/i810_dma.c
@@ -30,9 +30,9 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "i810_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i810_drm.h>
 #include "i810_drv.h"
 #include <linux/interrupt.h>	/* For task queue support */
 #include <linux/delay.h>
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
index 6f98d05..f7e7d97 100644
--- a/drivers/gpu/drm/i810/i810_drv.c
+++ b/drivers/gpu/drm/i810/i810_drv.c
@@ -30,12 +30,12 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "i810_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i810_drm.h>
 #include "i810_drv.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 
 static struct pci_device_id pciidlist[] = {
 	i810_PCI_IDS
diff --git a/drivers/gpu/drm/i915/dvo.h b/drivers/gpu/drm/i915/dvo.h
index 8c2ad01..a6607c3 100644
--- a/drivers/gpu/drm/i915/dvo.h
+++ b/drivers/gpu/drm/i915/dvo.h
@@ -24,9 +24,9 @@
 #define _INTEL_DVO_H
 
 #include <linux/i2c.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
 #include "intel_drv.h"
 
 struct intel_dvo_device {
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index e2662497..6a78cd5 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -29,11 +29,11 @@
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "intel_drv.h"
 #include "intel_ringbuffer.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 #define DRM_I915_RING_DEBUG 1
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 1271282..c771353 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -26,12 +26,12 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc_helper.h"
-#include "drm_fb_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "i915_trace.h"
 #include "../../../platform/x86/intel_ips.h"
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ce045a8..2e2ead0 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -28,14 +28,14 @@
  */
 
 #include <linux/device.h>
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "intel_drv.h"
 
 #include <linux/console.h>
-#include "drm_crtc_helper.h"
+#include <drm/drm_crtc_helper.h>
 
 static int i915_modeset __read_mostly = -1;
 module_param_named(modeset, i915_modeset, int, 0400);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d1cd8b8..49293e2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -25,9 +25,9 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "i915_trace.h"
 #include "intel_drv.h"
diff --git a/drivers/gpu/drm/i915/i915_gem_debug.c b/drivers/gpu/drm/i915/i915_gem_debug.c
index 8da1899..f7785ea 100644
--- a/drivers/gpu/drm/i915/i915_gem_debug.c
+++ b/drivers/gpu/drm/i915/i915_gem_debug.c
@@ -25,9 +25,9 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 #if WATCH_LISTS
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index da05a26..cfa4be7 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -26,10 +26,10 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "i915_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_trace.h"
 
 static bool
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 4934cf8..9130b6d 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -26,9 +26,9 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "i915_trace.h"
 #include "intel_drv.h"
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 7a709cd..03c61b8 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -22,9 +22,9 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "i915_trace.h"
 #include "intel_drv.h"
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index 99c4faa..8ea9315 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -25,11 +25,11 @@
  *
  */
 
-#include "linux/string.h"
-#include "linux/bitops.h"
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <linux/string.h>
+#include <linux/bitops.h>
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 /** @file i915_gem_tiling.c
diff --git a/drivers/gpu/drm/i915/i915_ioc32.c b/drivers/gpu/drm/i915/i915_ioc32.c
index 13b0289..b1a442b 100644
--- a/drivers/gpu/drm/i915/i915_ioc32.c
+++ b/drivers/gpu/drm/i915/i915_ioc32.c
@@ -31,9 +31,9 @@
  */
 #include <linux/compat.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 
 typedef struct _drm_i915_batchbuffer32 {
 	int start;		/* agp offset */
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 23d1ae6..4fcbc5a 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -28,9 +28,9 @@
 
 #include <linux/sysrq.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "i915_trace.h"
 #include "intel_drv.h"
diff --git a/drivers/gpu/drm/i915/i915_mem.c b/drivers/gpu/drm/i915/i915_mem.c
index 83b7b81..9bea60b 100644
--- a/drivers/gpu/drm/i915/i915_mem.c
+++ b/drivers/gpu/drm/i915/i915_mem.c
@@ -26,9 +26,9 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 /* This memory manager is integrated into the global/local lru
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 2857586..ffbbad3 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -24,9 +24,9 @@
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "intel_drv.h"
 
 static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c
index 2cb8e0b..eda3420 100644
--- a/drivers/gpu/drm/i915/intel_acpi.c
+++ b/drivers/gpu/drm/i915/intel_acpi.c
@@ -8,7 +8,7 @@
 #include <linux/vga_switcheroo.h>
 #include <acpi/acpi_drivers.h>
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #define INTEL_DSM_REVISION_ID 1 /* For Calpella anyway... */
 
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 61abef8..8290e63 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -25,9 +25,9 @@
  *
  */
 #include <drm/drm_dp_helper.h>
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "intel_bios.h"
 
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
index 5f8e4ed..725e447 100644
--- a/drivers/gpu/drm/i915/intel_bios.h
+++ b/drivers/gpu/drm/i915/intel_bios.h
@@ -28,7 +28,7 @@
 #ifndef _I830_BIOS_H_
 #define _I830_BIOS_H_
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 struct vbt_header {
 	u8 signature[20];		/**< Always starts with 'VBT$' */
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 0979d88..69a4ac7 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -26,13 +26,13 @@
 
 #include <linux/i2c.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_crtc_helper.h"
-#include "drm_edid.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_edid.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 /* Here's the desired hotplug mode */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 393a399..657f260 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -31,14 +31,14 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/vgaarb.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "i915_trace.h"
-#include "drm_dp_helper.h"
+#include <drm/drm_dp_helper.h>
 
-#include "drm_crtc_helper.h"
+#include <drm/drm_crtc_helper.h>
 
 #define HAS_eDP (intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))
 
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f797fb5..48c289a 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -27,14 +27,14 @@
 
 #include <linux/i2c.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_crtc_helper.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
-#include "drm_dp_helper.h"
+#include <drm/drm_dp_helper.h>
 
 
 #define DP_LINK_STATUS_SIZE	6
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 6e990f9..88367a3 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -27,9 +27,9 @@
 
 #include <linux/i2c.h>
 #include "i915_drv.h"
-#include "drm_crtc.h"
-#include "drm_crtc_helper.h"
-#include "drm_fb_helper.h"
+#include <drm/drm_crtc.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 
 #define _wait_for(COND, MS, W) ({ \
 	unsigned long timeout__ = jiffies + msecs_to_jiffies(MS);	\
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index 6eda1b5..1d95b7a 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -26,11 +26,11 @@
  */
 #include <linux/i2c.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "dvo.h"
 
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index ec49bae..0cc5fcf 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -36,12 +36,12 @@
 #include <linux/init.h>
 #include <linux/vga_switcheroo.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_fb_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_fb_helper.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 static struct fb_ops intelfb_ops = {
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 1ed8e69..2977cc2 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -29,12 +29,12 @@
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_edid.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_edid.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 struct intel_hdmi {
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index d98cee6..45b948f 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -28,10 +28,10 @@
  */
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 /* Intel GPIO access functions */
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index b28f7bd..12ecb19 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -31,12 +31,12 @@
 #include <linux/dmi.h>
 #include <linux/i2c.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_edid.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_edid.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include <linux/acpi.h>
 
diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
index 3b26a3b..216db30 100644
--- a/drivers/gpu/drm/i915/intel_modes.c
+++ b/drivers/gpu/drm/i915/intel_modes.c
@@ -26,7 +26,7 @@
 #include <linux/slab.h>
 #include <linux/i2c.h>
 #include <linux/fb.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "intel_drv.h"
 #include "i915_drv.h"
 
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index b7c5ddb..a794861 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -29,8 +29,8 @@
 #include <linux/acpi_io.h>
 #include <acpi/video.h>
 
-#include "drmP.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "intel_drv.h"
 
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index d360380..27042b4 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -27,9 +27,9 @@
  */
 
 #include <linux/seq_file.h>
-#include "drmP.h"
-#include "drm.h"
-#include "i915_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_drv.h"
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index e961568..2af000c 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -27,10 +27,10 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "i915_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_trace.h"
 #include "intel_drv.h"
 
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 30fe554..77fd5d1 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -28,12 +28,12 @@
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_edid.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_edid.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "intel_sdvo_regs.h"
 
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 210d570..ed2611c 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -30,12 +30,12 @@
  * Integrated TV-out support for the 915GM and 945GM.
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_edid.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_edid.h>
 #include "intel_drv.h"
-#include "i915_drm.h"
+#include <drm/i915_drm.h>
 #include "i915_drv.h"
 
 enum tv_margin {
diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c
index 5ccb65d..2bbda7e 100644
--- a/drivers/gpu/drm/mga/mga_dma.c
+++ b/drivers/gpu/drm/mga/mga_dma.c
@@ -35,10 +35,10 @@
  * \author Gareth Hughes <gareth@valinux.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_sarea.h"
-#include "mga_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_sarea.h>
+#include <drm/mga_drm.h>
 #include "mga_drv.h"
 
 #define MGA_DEFAULT_USEC_TIMEOUT	10000
diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
index 42d3187..5f92d5f 100644
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -29,12 +29,12 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "mga_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/mga_drm.h>
 #include "mga_drv.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 
 static int mga_driver_device_is_agp(struct drm_device *dev);
 
diff --git a/drivers/gpu/drm/mga/mga_ioc32.c b/drivers/gpu/drm/mga/mga_ioc32.c
index c1f877b..8909ec1 100644
--- a/drivers/gpu/drm/mga/mga_ioc32.c
+++ b/drivers/gpu/drm/mga/mga_ioc32.c
@@ -32,9 +32,9 @@
  */
 #include <linux/compat.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "mga_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/mga_drm.h>
 
 typedef struct drm32_mga_init {
 	int func;
diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c
index 2581202..f81bbff 100644
--- a/drivers/gpu/drm/mga/mga_irq.c
+++ b/drivers/gpu/drm/mga/mga_irq.c
@@ -31,9 +31,9 @@
  *    Eric Anholt <anholt@FreeBSD.org>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "mga_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/mga_drm.h>
 #include "mga_drv.h"
 
 u32 mga_get_vblank_counter(struct drm_device *dev, int crtc)
diff --git a/drivers/gpu/drm/mga/mga_state.c b/drivers/gpu/drm/mga/mga_state.c
index 9ce2827f..975e067 100644
--- a/drivers/gpu/drm/mga/mga_state.c
+++ b/drivers/gpu/drm/mga/mga_state.c
@@ -32,9 +32,9 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "mga_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/mga_drm.h>
 #include "mga_drv.h"
 
 /* ================================================================
diff --git a/drivers/gpu/drm/mga/mga_warp.c b/drivers/gpu/drm/mga/mga_warp.c
index f172bd5..2244890 100644
--- a/drivers/gpu/drm/mga/mga_warp.c
+++ b/drivers/gpu/drm/mga/mga_warp.c
@@ -31,9 +31,9 @@
 #include <linux/ihex.h>
 #include <linux/platform_device.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "mga_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/mga_drm.h>
 #include "mga_drv.h"
 
 #define FIRMWARE_G200 "matrox/g200_warp.fw"
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index 525744d..1141cb7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -7,12 +7,12 @@
 #include <acpi/acpi.h>
 #include <linux/mxm-wmi.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_sarea.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_sarea.h>
+#include <drm/drm_crtc_helper.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nv50_display.h"
 #include "nouveau_connector.h"
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 00a55df..33c12cb 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -33,9 +33,9 @@
 #include <linux/backlight.h>
 #include <linux/acpi.h>
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_reg.h"
 
 static int nv40_get_intensity(struct backlight_device *bd)
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index b311fab..b5c1e5f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -22,7 +22,7 @@
  * SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #define NV_DEBUG_NOTRACE
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 890d50e..e0bcfe9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -27,9 +27,9 @@
  *	    Jeremy Kolb  <jkolb@brandeis.edu>
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
 #include "nouveau_mm.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_calc.c b/drivers/gpu/drm/nouveau/nouveau_calc.c
index dad96cc..2c5eb5d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_calc.c
+++ b/drivers/gpu/drm/nouveau/nouveau_calc.c
@@ -21,7 +21,7 @@
  * SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c
index b0d753f..bb56ecd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_channel.c
+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
@@ -22,10 +22,10 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_dma.h"
 #include "nouveau_ramht.h"
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 939d4df..8213458 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -26,9 +26,9 @@
 
 #include <acpi/button.h>
 
-#include "drmP.h"
-#include "drm_edid.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_edid.h>
+#include <drm/drm_crtc_helper.h>
 
 #include "nouveau_reg.h"
 #include "nouveau_drv.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h
index 711b1e9..6dd3048 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.h
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.h
@@ -27,7 +27,7 @@
 #ifndef __NOUVEAU_CONNECTOR_H__
 #define __NOUVEAU_CONNECTOR_H__
 
-#include "drm_edid.h"
+#include <drm/drm_edid.h>
 #include "nouveau_i2c.h"
 
 struct nouveau_connector {
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 8e15923..e1dda1c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -30,7 +30,7 @@
 
 #include <linux/debugfs.h>
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 
 #include <ttm/ttm_page_alloc.h>
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index eb514ea..7ee5741 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 #include "nouveau_drv.h"
 #include "nouveau_fb.h"
 #include "nouveau_fbcon.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.c b/drivers/gpu/drm/nouveau/nouveau_dma.c
index 00bc6ea..8c7c438 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dma.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
 #include "nouveau_ramht.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c
index 7beb82a..40af3fb 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dp.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dp.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_i2c.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index b30ddd8..2c783ab 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -24,9 +24,9 @@
 
 #include <linux/console.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc_helper.h>
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
 #include "nouveau_fb.h"
@@ -34,7 +34,7 @@
 #include "nouveau_pm.h"
 #include "nv50_display.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 
 MODULE_PARM_DESC(agpmode, "AGP mode (0 to disable AGP)");
 int nouveau_agpmode = -1;
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index d7d51de..c24f139 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -39,11 +39,11 @@
 #define NOUVEAU_FAMILY   0x0000FFFF
 #define NOUVEAU_FLAGS    0xFFFF0000
 
-#include "ttm/ttm_bo_api.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_placement.h"
-#include "ttm/ttm_memory.h"
-#include "ttm/ttm_module.h"
+#include <drm/ttm/ttm_bo_api.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
+#include <drm/ttm/ttm_memory.h>
+#include <drm/ttm/ttm_module.h>
 
 struct nouveau_fpriv {
 	spinlock_t lock;
@@ -59,7 +59,7 @@ nouveau_fpriv(struct drm_file *file_priv)
 
 #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
 
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_reg.h"
 #include "nouveau_bios.h"
 #include "nouveau_util.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/nouveau/nouveau_encoder.h
index ae69b61..ddf3339 100644
--- a/drivers/gpu/drm/nouveau/nouveau_encoder.h
+++ b/drivers/gpu/drm/nouveau/nouveau_encoder.h
@@ -27,7 +27,7 @@
 #ifndef __NOUVEAU_ENCODER_H__
 #define __NOUVEAU_ENCODER_H__
 
-#include "drm_encoder_slave.h"
+#include <drm/drm_encoder_slave.h>
 #include "nouveau_drv.h"
 
 #define NV_DPMS_CLEARED 0x80
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 14a8627..302ef19 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -37,13 +37,13 @@
 #include <linux/screen_info.h>
 #include <linux/vga_switcheroo.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_crtc_helper.h"
-#include "drm_fb_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_crtc.h"
 #include "nouveau_fb.h"
 #include "nouveau_fbcon.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.h b/drivers/gpu/drm/nouveau/nouveau_fbcon.h
index b73c29f8..1f2d278 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.h
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.h
@@ -27,7 +27,7 @@
 #ifndef __NOUVEAU_FBCON_H__
 #define __NOUVEAU_FBCON_H__
 
-#include "drm_fb_helper.h"
+#include <drm/drm_fb_helper.h>
 
 #include "nouveau_fb.h"
 struct nouveau_fbdev {
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 8d02d87..1cbfac6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 
 #include <linux/ktime.h>
 #include <linux/hrtimer.h>
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 5f0bc57..8d24653 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -23,11 +23,11 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  *
  */
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_dma.h"
 
 #define nouveau_gem_pushbuf_sync(chan) 0
diff --git a/drivers/gpu/drm/nouveau/nouveau_hw.c b/drivers/gpu/drm/nouveau/nouveau_hw.c
index ba896e5..bf30076 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hw.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hw.c
@@ -22,7 +22,7 @@
  * SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_hw.h b/drivers/gpu/drm/nouveau/nouveau_hw.h
index 2989090..06a66bc 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hw.h
+++ b/drivers/gpu/drm/nouveau/nouveau_hw.h
@@ -23,7 +23,7 @@
 #ifndef __NOUVEAU_HW_H__
 #define __NOUVEAU_HW_H__
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 
 #define MASK(field) ( \
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c
index cb389d0..01bc254 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.c
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_i2c.h"
 #include "nouveau_hw.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.h b/drivers/gpu/drm/nouveau/nouveau_i2c.h
index 422b62f..79ffd59 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.h
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.h
@@ -25,7 +25,7 @@
 
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
-#include "drm_dp_helper.h"
+#include <drm/drm_dp_helper.h>
 
 struct dcb_i2c_entry;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c b/drivers/gpu/drm/nouveau/nouveau_ioc32.c
index 475ba81..c26afa7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ioc32.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c
@@ -33,8 +33,8 @@
 
 #include <linux/compat.h>
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 
 #include "nouveau_drv.h"
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_irq.c b/drivers/gpu/drm/nouveau/nouveau_irq.c
index 868c7fd..99faed1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_irq.c
+++ b/drivers/gpu/drm/nouveau/nouveau_irq.c
@@ -30,9 +30,9 @@
  *   Ben Skeggs <darktama@iinet.net.au>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "nouveau_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/nouveau_drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_reg.h"
 #include "nouveau_ramht.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index f9ae2fc..26b60fd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -30,9 +30,9 @@
  */
 
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_sarea.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_sarea.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_mm.c b/drivers/gpu/drm/nouveau/nouveau_mm.c
index 1640dec..0fabc02 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mm.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_mm.h"
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c
index 6abdbe6..59a0cd6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_notifier.c
+++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c
@@ -25,8 +25,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
index 159b7c4..8bc5faf 100644
--- a/drivers/gpu/drm/nouveau/nouveau_object.c
+++ b/drivers/gpu/drm/nouveau/nouveau_object.c
@@ -30,10 +30,10 @@
  *   Ben Skeggs <darktama@iinet.net.au>
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_ramht.h"
 #include "nouveau_vm.h"
 #include "nv50_display.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c
index ef9dec0..0b4c60c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_perf.c
+++ b/drivers/gpu/drm/nouveau/nouveau_perf.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index da8d994..10c2a38 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.c b/drivers/gpu/drm/nouveau/nouveau_ramht.c
index a24a81f..0ebb62f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ramht.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ramht.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index c444cad..89e3025 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -1,4 +1,4 @@
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include <linux/pagemap.h>
 #include <linux/slab.h>
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index 10656e4..e4cdddc 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -25,15 +25,15 @@
 
 #include <linux/swab.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
-#include "drm_sarea.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_sarea.h>
+#include <drm/drm_crtc_helper.h>
 #include <linux/vgaarb.h>
 #include <linux/vga_switcheroo.h>
 
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_fbcon.h"
 #include "nouveau_ramht.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_temp.c b/drivers/gpu/drm/nouveau/nouveau_temp.c
index 081ca7b..27bc08e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_temp.c
+++ b/drivers/gpu/drm/nouveau/nouveau_temp.c
@@ -22,7 +22,7 @@
  * Authors: Martin Peres
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index bd35f93..48de8dd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -24,7 +24,7 @@
  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_vm.c b/drivers/gpu/drm/nouveau/nouveau_vm.c
index 244fd38..6860ca8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vm.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_mm.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_vm.h b/drivers/gpu/drm/nouveau/nouveau_vm.h
index 579ca8c..b31d4a6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vm.h
+++ b/drivers/gpu/drm/nouveau/nouveau_vm.h
@@ -25,7 +25,7 @@
 #ifndef __NOUVEAU_VM_H__
 #define __NOUVEAU_VM_H__
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_mm.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_volt.c b/drivers/gpu/drm/nouveau/nouveau_volt.c
index 75e87274..85c1287 100644
--- a/drivers/gpu/drm/nouveau/nouveau_volt.c
+++ b/drivers/gpu/drm/nouveau/nouveau_volt.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_crtc.c b/drivers/gpu/drm/nouveau/nv04_crtc.c
index 118261d..92b789a 100644
--- a/drivers/gpu/drm/nouveau/nv04_crtc.c
+++ b/drivers/gpu/drm/nouveau/nv04_crtc.c
@@ -23,8 +23,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_encoder.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_cursor.c b/drivers/gpu/drm/nouveau/nv04_cursor.c
index aaf3de3..adadd2e 100644
--- a/drivers/gpu/drm/nouveau/nv04_cursor.c
+++ b/drivers/gpu/drm/nouveau/nv04_cursor.c
@@ -1,5 +1,5 @@
-#include "drmP.h"
-#include "drm_mode.h"
+#include <drm/drmP.h>
+#include <drm/drm_mode.h>
 #include "nouveau_reg.h"
 #include "nouveau_drv.h"
 #include "nouveau_crtc.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_dac.c b/drivers/gpu/drm/nouveau/nv04_dac.c
index e000455..f8be357 100644
--- a/drivers/gpu/drm/nouveau/nv04_dac.c
+++ b/drivers/gpu/drm/nouveau/nv04_dac.c
@@ -24,8 +24,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_encoder.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c
index 12098bf..d657994 100644
--- a/drivers/gpu/drm/nouveau/nv04_dfp.c
+++ b/drivers/gpu/drm/nouveau/nv04_dfp.c
@@ -24,8 +24,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_encoder.h"
@@ -34,7 +34,7 @@
 #include "nouveau_hw.h"
 #include "nvreg.h"
 
-#include "i2c/sil164.h"
+#include <drm/i2c/sil164.h>
 
 #define FP_TG_CONTROL_ON  (NV_PRAMDAC_FP_TG_CONTROL_DISPEN_POS |	\
 			   NV_PRAMDAC_FP_TG_CONTROL_HSYNC_POS |		\
diff --git a/drivers/gpu/drm/nouveau/nv04_display.c b/drivers/gpu/drm/nouveau/nv04_display.c
index 1715e14..cdaf221 100644
--- a/drivers/gpu/drm/nouveau/nv04_display.c
+++ b/drivers/gpu/drm/nouveau/nv04_display.c
@@ -22,9 +22,9 @@
  * Author: Ben Skeggs
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc_helper.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_fb.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_fb.c b/drivers/gpu/drm/nouveau/nv04_fb.c
index 638cf60..7ab03bd 100644
--- a/drivers/gpu/drm/nouveau/nv04_fb.c
+++ b/drivers/gpu/drm/nouveau/nv04_fb.c
@@ -1,7 +1,7 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 int
 nv04_fb_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/nouveau/nv04_fbcon.c b/drivers/gpu/drm/nouveau/nv04_fbcon.c
index 7a11893..8edd9f8 100644
--- a/drivers/gpu/drm/nouveau/nv04_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nv04_fbcon.c
@@ -22,7 +22,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
 #include "nouveau_ramht.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_fifo.c b/drivers/gpu/drm/nouveau/nv04_fifo.c
index db465a3..74e7036 100644
--- a/drivers/gpu/drm/nouveau/nv04_fifo.c
+++ b/drivers/gpu/drm/nouveau/nv04_fifo.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 #include "nouveau_util.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_graph.c b/drivers/gpu/drm/nouveau/nv04_graph.c
index dbdea8e..b9c7711 100644
--- a/drivers/gpu/drm/nouveau/nv04_graph.c
+++ b/drivers/gpu/drm/nouveau/nv04_graph.c
@@ -22,9 +22,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "nouveau_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/nouveau_drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
 #include "nouveau_util.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_instmem.c b/drivers/gpu/drm/nouveau/nv04_instmem.c
index c1248e0..19c0c8f 100644
--- a/drivers/gpu/drm/nouveau/nv04_instmem.c
+++ b/drivers/gpu/drm/nouveau/nv04_instmem.c
@@ -1,5 +1,5 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv04_mc.c b/drivers/gpu/drm/nouveau/nv04_mc.c
index 2af43a1..2a86392 100644
--- a/drivers/gpu/drm/nouveau/nv04_mc.c
+++ b/drivers/gpu/drm/nouveau/nv04_mc.c
@@ -1,7 +1,7 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 int
 nv04_mc_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/nouveau/nv04_pm.c b/drivers/gpu/drm/nouveau/nv04_pm.c
index eb1c70d..fdced80 100644
--- a/drivers/gpu/drm/nouveau/nv04_pm.c
+++ b/drivers/gpu/drm/nouveau/nv04_pm.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nv04_timer.c b/drivers/gpu/drm/nouveau/nv04_timer.c
index 1d09ddd..accd70c 100644
--- a/drivers/gpu/drm/nouveau/nv04_timer.c
+++ b/drivers/gpu/drm/nouveau/nv04_timer.c
@@ -1,7 +1,7 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 int
 nv04_timer_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/nouveau/nv04_tv.c b/drivers/gpu/drm/nouveau/nv04_tv.c
index 3eb605d..7157d40 100644
--- a/drivers/gpu/drm/nouveau/nv04_tv.c
+++ b/drivers/gpu/drm/nouveau/nv04_tv.c
@@ -24,15 +24,15 @@
  *
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_encoder.h"
 #include "nouveau_connector.h"
 #include "nouveau_crtc.h"
 #include "nouveau_hw.h"
-#include "drm_crtc_helper.h"
+#include <drm/drm_crtc_helper.h>
 
-#include "i2c/ch7006.h"
+#include <drm/i2c/ch7006.h>
 
 static struct i2c_board_info nv04_tv_encoder_info[] = {
 	{
diff --git a/drivers/gpu/drm/nouveau/nv10_fb.c b/drivers/gpu/drm/nouveau/nv10_fb.c
index f78181a..7bea13d 100644
--- a/drivers/gpu/drm/nouveau/nv10_fb.c
+++ b/drivers/gpu/drm/nouveau/nv10_fb.c
@@ -1,7 +1,7 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 static struct drm_mm_node *
 nv20_fb_alloc_tag(struct drm_device *dev, uint32_t size)
diff --git a/drivers/gpu/drm/nouveau/nv10_fifo.c b/drivers/gpu/drm/nouveau/nv10_fifo.c
index d2ecbff..1d8daf0d 100644
--- a/drivers/gpu/drm/nouveau/nv10_fifo.c
+++ b/drivers/gpu/drm/nouveau/nv10_fifo.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv10_gpio.c b/drivers/gpu/drm/nouveau/nv10_gpio.c
index 007fc29..783cc8d 100644
--- a/drivers/gpu/drm/nouveau/nv10_gpio.c
+++ b/drivers/gpu/drm/nouveau/nv10_gpio.c
@@ -24,7 +24,7 @@
  *
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv10_graph.c b/drivers/gpu/drm/nouveau/nv10_graph.c
index 7255e4a..b0afa5c 100644
--- a/drivers/gpu/drm/nouveau/nv10_graph.c
+++ b/drivers/gpu/drm/nouveau/nv10_graph.c
@@ -22,9 +22,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "nouveau_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/nouveau_drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_util.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c b/drivers/gpu/drm/nouveau/nv17_tv.c
index 3900ceb..1de088d 100644
--- a/drivers/gpu/drm/nouveau/nv17_tv.c
+++ b/drivers/gpu/drm/nouveau/nv17_tv.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 #include "nouveau_drv.h"
 #include "nouveau_encoder.h"
 #include "nouveau_connector.h"
diff --git a/drivers/gpu/drm/nouveau/nv17_tv_modes.c b/drivers/gpu/drm/nouveau/nv17_tv_modes.c
index 4d1d29f..96e4286 100644
--- a/drivers/gpu/drm/nouveau/nv17_tv_modes.c
+++ b/drivers/gpu/drm/nouveau/nv17_tv_modes.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 #include "nouveau_drv.h"
 #include "nouveau_encoder.h"
 #include "nouveau_crtc.h"
diff --git a/drivers/gpu/drm/nouveau/nv20_graph.c b/drivers/gpu/drm/nouveau/nv20_graph.c
index 183e375..80c9a0f 100644
--- a/drivers/gpu/drm/nouveau/nv20_graph.c
+++ b/drivers/gpu/drm/nouveau/nv20_graph.c
@@ -1,7 +1,7 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 /*
  * NV20
diff --git a/drivers/gpu/drm/nouveau/nv30_fb.c b/drivers/gpu/drm/nouveau/nv30_fb.c
index e0135f0..46a5105 100644
--- a/drivers/gpu/drm/nouveau/nv30_fb.c
+++ b/drivers/gpu/drm/nouveau/nv30_fb.c
@@ -24,10 +24,10 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 void
 nv30_fb_init_tile_region(struct drm_device *dev, int i, uint32_t addr,
diff --git a/drivers/gpu/drm/nouveau/nv40_fb.c b/drivers/gpu/drm/nouveau/nv40_fb.c
index f0ac2a7..70780b0 100644
--- a/drivers/gpu/drm/nouveau/nv40_fb.c
+++ b/drivers/gpu/drm/nouveau/nv40_fb.c
@@ -1,7 +1,7 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 void
 nv40_fb_set_tile_region(struct drm_device *dev, int i)
diff --git a/drivers/gpu/drm/nouveau/nv40_fifo.c b/drivers/gpu/drm/nouveau/nv40_fifo.c
index 68cb2d9..391a34e 100644
--- a/drivers/gpu/drm/nouveau/nv40_fifo.c
+++ b/drivers/gpu/drm/nouveau/nv40_fifo.c
@@ -24,9 +24,9 @@
  *
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 #include "nouveau_ramht.h"
 
 #define NV40_RAMFC(c) (dev_priv->ramfc->pinst + ((c) * NV40_RAMFC__SIZE))
diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c b/drivers/gpu/drm/nouveau/nv40_graph.c
index ba14a93..ce6b850 100644
--- a/drivers/gpu/drm/nouveau/nv40_graph.c
+++ b/drivers/gpu/drm/nouveau/nv40_graph.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_grctx.h"
 #include "nouveau_ramht.h"
diff --git a/drivers/gpu/drm/nouveau/nv40_grctx.c b/drivers/gpu/drm/nouveau/nv40_grctx.c
index f70447d..d696a81 100644
--- a/drivers/gpu/drm/nouveau/nv40_grctx.c
+++ b/drivers/gpu/drm/nouveau/nv40_grctx.c
@@ -109,7 +109,7 @@
 #define CP_LOAD_MAGIC_NV44TCL    0x00800029 /* per-vs state (0x4497) */
 #define CP_LOAD_MAGIC_NV40TCL    0x00800041 /* per-vs state (0x4097) */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_grctx.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv40_mc.c b/drivers/gpu/drm/nouveau/nv40_mc.c
index 03c0d4c..7af9185 100644
--- a/drivers/gpu/drm/nouveau/nv40_mc.c
+++ b/drivers/gpu/drm/nouveau/nv40_mc.c
@@ -1,7 +1,7 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 int
 nv40_mc_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/nouveau/nv40_mpeg.c b/drivers/gpu/drm/nouveau/nv40_mpeg.c
index ad03a0e..5de3a39 100644
--- a/drivers/gpu/drm/nouveau/nv40_mpeg.c
+++ b/drivers/gpu/drm/nouveau/nv40_mpeg.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv50_calc.c b/drivers/gpu/drm/nouveau/nv50_calc.c
index 8cf63a8..4d019eb 100644
--- a/drivers/gpu/drm/nouveau/nv50_calc.c
+++ b/drivers/gpu/drm/nouveau/nv50_calc.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c
index 46ad59e..23a97a9 100644
--- a/drivers/gpu/drm/nouveau/nv50_crtc.c
+++ b/drivers/gpu/drm/nouveau/nv50_crtc.c
@@ -24,9 +24,9 @@
  *
  */
 
-#include "drmP.h"
-#include "drm_mode.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_mode.h>
+#include <drm/drm_crtc_helper.h>
 
 #define NOUVEAU_DMA_DEBUG (nouveau_reg_debug & NOUVEAU_REG_DEBUG_EVO)
 #include "nouveau_reg.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_cursor.c b/drivers/gpu/drm/nouveau/nv50_cursor.c
index 9752c35..f23f9ef 100644
--- a/drivers/gpu/drm/nouveau/nv50_cursor.c
+++ b/drivers/gpu/drm/nouveau/nv50_cursor.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm_mode.h"
+#include <drm/drmP.h>
+#include <drm/drm_mode.h>
 
 #define NOUVEAU_DMA_DEBUG (nouveau_reg_debug & NOUVEAU_REG_DEBUG_EVO)
 #include "nouveau_reg.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_dac.c b/drivers/gpu/drm/nouveau/nv50_dac.c
index 808f3ec..d2bc3f8 100644
--- a/drivers/gpu/drm/nouveau/nv50_dac.c
+++ b/drivers/gpu/drm/nouveau/nv50_dac.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 
 #define NOUVEAU_DMA_DEBUG (nouveau_reg_debug & NOUVEAU_REG_DEBUG_EVO)
 #include "nouveau_reg.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index db1a5f4..ffdc35a 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -32,7 +32,7 @@
 #include "nouveau_fb.h"
 #include "nouveau_fbcon.h"
 #include "nouveau_ramht.h"
-#include "drm_crtc_helper.h"
+#include <drm/drm_crtc_helper.h>
 
 static void nv50_display_isr(struct drm_device *);
 static void nv50_display_bh(unsigned long);
diff --git a/drivers/gpu/drm/nouveau/nv50_display.h b/drivers/gpu/drm/nouveau/nv50_display.h
index c2da503..cfaa1c5 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.h
+++ b/drivers/gpu/drm/nouveau/nv50_display.h
@@ -27,8 +27,8 @@
 #ifndef __NV50_DISPLAY_H__
 #define __NV50_DISPLAY_H__
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
 #include "nouveau_reg.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_evo.c b/drivers/gpu/drm/nouveau/nv50_evo.c
index c99d975..ce0ac9f 100644
--- a/drivers/gpu/drm/nouveau/nv50_evo.c
+++ b/drivers/gpu/drm/nouveau/nv50_evo.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_fb.c b/drivers/gpu/drm/nouveau/nv50_fb.c
index bdd2afe..e49c3d7 100644
--- a/drivers/gpu/drm/nouveau/nv50_fb.c
+++ b/drivers/gpu/drm/nouveau/nv50_fb.c
@@ -1,7 +1,7 @@
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 struct nv50_fb_priv {
 	struct page *r100c08_page;
diff --git a/drivers/gpu/drm/nouveau/nv50_fbcon.c b/drivers/gpu/drm/nouveau/nv50_fbcon.c
index dc75a72..5ad1cf7 100644
--- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
 #include "nouveau_ramht.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_fifo.c b/drivers/gpu/drm/nouveau/nv50_fifo.c
index c34a074..e4f9426 100644
--- a/drivers/gpu/drm/nouveau/nv50_fifo.c
+++ b/drivers/gpu/drm/nouveau/nv50_fifo.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_gpio.c b/drivers/gpu/drm/nouveau/nv50_gpio.c
index d4f4206..c91ec9c 100644
--- a/drivers/gpu/drm/nouveau/nv50_gpio.c
+++ b/drivers/gpu/drm/nouveau/nv50_gpio.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c
index d43c46c..e248097 100644
--- a/drivers/gpu/drm/nouveau/nv50_graph.c
+++ b/drivers/gpu/drm/nouveau/nv50_graph.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 #include "nouveau_grctx.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_grctx.c b/drivers/gpu/drm/nouveau/nv50_grctx.c
index de9abff..4e6c010 100644
--- a/drivers/gpu/drm/nouveau/nv50_grctx.c
+++ b/drivers/gpu/drm/nouveau/nv50_grctx.c
@@ -99,7 +99,7 @@
 #define CP_SEEK_1      0x00c000ff
 #define CP_SEEK_2      0x00c800ff
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_grctx.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c
index a7c12c9..5236163 100644
--- a/drivers/gpu/drm/nouveau/nv50_instmem.c
+++ b/drivers/gpu/drm/nouveau/nv50_instmem.c
@@ -25,8 +25,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_mc.c b/drivers/gpu/drm/nouveau/nv50_mc.c
index e0a9c3f..b3d0af9 100644
--- a/drivers/gpu/drm/nouveau/nv50_mc.c
+++ b/drivers/gpu/drm/nouveau/nv50_mc.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
 
 int
diff --git a/drivers/gpu/drm/nouveau/nv50_mpeg.c b/drivers/gpu/drm/nouveau/nv50_mpeg.c
index b57a2d1..aecccd3 100644
--- a/drivers/gpu/drm/nouveau/nv50_mpeg.c
+++ b/drivers/gpu/drm/nouveau/nv50_mpeg.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv50_pm.c b/drivers/gpu/drm/nouveau/nv50_pm.c
index 8a28100..5e5af77 100644
--- a/drivers/gpu/drm/nouveau/nv50_pm.c
+++ b/drivers/gpu/drm/nouveau/nv50_pm.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_bios.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_sor.c b/drivers/gpu/drm/nouveau/nv50_sor.c
index ffe8b48..95da9e9 100644
--- a/drivers/gpu/drm/nouveau/nv50_sor.c
+++ b/drivers/gpu/drm/nouveau/nv50_sor.c
@@ -24,8 +24,8 @@
  *
  */
 
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 
 #define NOUVEAU_DMA_DEBUG (nouveau_reg_debug & NOUVEAU_REG_DEBUG_EVO)
 #include "nouveau_reg.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_vm.c b/drivers/gpu/drm/nouveau/nv50_vm.c
index 40b84f2..43ddaf3 100644
--- a/drivers/gpu/drm/nouveau/nv50_vm.c
+++ b/drivers/gpu/drm/nouveau/nv50_vm.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nv50_vram.c b/drivers/gpu/drm/nouveau/nv50_vram.c
index af32dae..0d48780 100644
--- a/drivers/gpu/drm/nouveau/nv50_vram.c
+++ b/drivers/gpu/drm/nouveau/nv50_vram.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_mm.h"
 
diff --git a/drivers/gpu/drm/nouveau/nv84_crypt.c b/drivers/gpu/drm/nouveau/nv84_crypt.c
index edece9c..c986439 100644
--- a/drivers/gpu/drm/nouveau/nv84_crypt.c
+++ b/drivers/gpu/drm/nouveau/nv84_crypt.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_util.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nva3_copy.c b/drivers/gpu/drm/nouveau/nva3_copy.c
index 8f356d5..638f79f 100644
--- a/drivers/gpu/drm/nouveau/nva3_copy.c
+++ b/drivers/gpu/drm/nouveau/nva3_copy.c
@@ -23,7 +23,7 @@
  */
 
 #include <linux/firmware.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_util.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nva3_pm.c b/drivers/gpu/drm/nouveau/nva3_pm.c
index e4b2b9e..8f69f91 100644
--- a/drivers/gpu/drm/nouveau/nva3_pm.c
+++ b/drivers/gpu/drm/nouveau/nva3_pm.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_bios.h"
 #include "nouveau_pm.h"
diff --git a/drivers/gpu/drm/nouveau/nvc0_copy.c b/drivers/gpu/drm/nouveau/nvc0_copy.c
index dddf006..88a922d 100644
--- a/drivers/gpu/drm/nouveau/nvc0_copy.c
+++ b/drivers/gpu/drm/nouveau/nvc0_copy.c
@@ -23,7 +23,7 @@
  */
 
 #include <linux/firmware.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_util.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nvc0_fb.c b/drivers/gpu/drm/nouveau/nvc0_fb.c
index 08e6b11..34b65ed 100644
--- a/drivers/gpu/drm/nouveau/nvc0_fb.c
+++ b/drivers/gpu/drm/nouveau/nvc0_fb.c
@@ -22,10 +22,10 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <drm/nouveau_drm.h>
 
 struct nvc0_fb_priv {
 	struct page *r100c10_page;
diff --git a/drivers/gpu/drm/nouveau/nvc0_fbcon.c b/drivers/gpu/drm/nouveau/nvc0_fbcon.c
index a495e48..979d136 100644
--- a/drivers/gpu/drm/nouveau/nvc0_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nvc0_fbcon.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
 #include "nouveau_ramht.h"
diff --git a/drivers/gpu/drm/nouveau/nvc0_fifo.c b/drivers/gpu/drm/nouveau/nvc0_fifo.c
index 6f9f341..03f7691 100644
--- a/drivers/gpu/drm/nouveau/nvc0_fifo.c
+++ b/drivers/gpu/drm/nouveau/nvc0_fifo.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_mm.h"
diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.c b/drivers/gpu/drm/nouveau/nvc0_graph.c
index 5b2f6f4..a546d4f 100644
--- a/drivers/gpu/drm/nouveau/nvc0_graph.c
+++ b/drivers/gpu/drm/nouveau/nvc0_graph.c
@@ -24,7 +24,7 @@
 
 #include <linux/firmware.h>
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_mm.h"
diff --git a/drivers/gpu/drm/nouveau/nvc0_grctx.c b/drivers/gpu/drm/nouveau/nvc0_grctx.c
index 31018ea..78ea165 100644
--- a/drivers/gpu/drm/nouveau/nvc0_grctx.c
+++ b/drivers/gpu/drm/nouveau/nvc0_grctx.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_mm.h"
 #include "nvc0_graph.h"
diff --git a/drivers/gpu/drm/nouveau/nvc0_instmem.c b/drivers/gpu/drm/nouveau/nvc0_instmem.c
index b701c43..f5fac7c 100644
--- a/drivers/gpu/drm/nouveau/nvc0_instmem.c
+++ b/drivers/gpu/drm/nouveau/nvc0_instmem.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nvc0_vm.c b/drivers/gpu/drm/nouveau/nvc0_vm.c
index 9e35294..3ba6109 100644
--- a/drivers/gpu/drm/nouveau/nvc0_vm.c
+++ b/drivers/gpu/drm/nouveau/nvc0_vm.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_vm.h"
diff --git a/drivers/gpu/drm/nouveau/nvc0_vram.c b/drivers/gpu/drm/nouveau/nvc0_vram.c
index e45a24d..da1a49f 100644
--- a/drivers/gpu/drm/nouveau/nvc0_vram.c
+++ b/drivers/gpu/drm/nouveau/nvc0_vram.c
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drv.h"
 #include "nouveau_mm.h"
 
diff --git a/drivers/gpu/drm/r128/r128_cce.c b/drivers/gpu/drm/r128/r128_cce.c
index 570e190..dfd67f2 100644
--- a/drivers/gpu/drm/r128/r128_cce.c
+++ b/drivers/gpu/drm/r128/r128_cce.c
@@ -33,9 +33,9 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "r128_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/r128_drm.h>
 #include "r128_drv.h"
 
 #define R128_FIFO_DEBUG		0
diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c
index b9e8efd..af68cad 100644
--- a/drivers/gpu/drm/r128/r128_drv.c
+++ b/drivers/gpu/drm/r128/r128_drv.c
@@ -29,12 +29,12 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "r128_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/r128_drm.h>
 #include "r128_drv.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 
 static struct pci_device_id pciidlist[] = {
 	r128_PCI_IDS
diff --git a/drivers/gpu/drm/r128/r128_ioc32.c b/drivers/gpu/drm/r128/r128_ioc32.c
index 51c99fc..d70d4f6 100644
--- a/drivers/gpu/drm/r128/r128_ioc32.c
+++ b/drivers/gpu/drm/r128/r128_ioc32.c
@@ -31,9 +31,9 @@
  */
 #include <linux/compat.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "r128_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/r128_drm.h>
 
 typedef struct drm_r128_init32 {
 	int func;
diff --git a/drivers/gpu/drm/r128/r128_irq.c b/drivers/gpu/drm/r128/r128_irq.c
index 429d5a0..7d285b3 100644
--- a/drivers/gpu/drm/r128/r128_irq.c
+++ b/drivers/gpu/drm/r128/r128_irq.c
@@ -30,9 +30,9 @@
  *    Eric Anholt <anholt@FreeBSD.org>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "r128_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/r128_drm.h>
 #include "r128_drv.h"
 
 u32 r128_get_vblank_counter(struct drm_device *dev, int crtc)
diff --git a/drivers/gpu/drm/r128/r128_state.c b/drivers/gpu/drm/r128/r128_state.c
index a9e33ce..bf91739 100644
--- a/drivers/gpu/drm/r128/r128_state.c
+++ b/drivers/gpu/drm/r128/r128_state.c
@@ -28,9 +28,9 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "r128_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/r128_drm.h>
 #include "r128_drv.h"
 
 /* ================================================================
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
index a589a55..8da1659 100644
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -26,7 +26,7 @@
 #define ATOM_H
 
 #include <linux/types.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 
 #define ATOM_BIOS_MAGIC		0xAA55
 #define ATOM_ATI_MAGIC_PTR	0x30
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
index 645b84b..83da0af 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -23,13 +23,13 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
 #include "atom.h"
 #include "atom-bits.h"
-#include "drm_dp_helper.h"
+#include <drm/drm_dp_helper.h>
 
 /* move these to drm_dp_helper.c/h */
 #define DP_LINK_CONFIGURATION_SIZE 9
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 14dce9f..512a19f 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -24,10 +24,10 @@
 #include <linux/firmware.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "radeon_asic.h"
-#include "radeon_drm.h"
+#include <drm/radeon_drm.h>
 #include "evergreend.h"
 #include "atom.h"
 #include "avivod.h"
diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c
index 2eb2518..8d326a6 100644
--- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c
+++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c
@@ -24,9 +24,9 @@
  *     Alex Deucher <alexander.deucher@amd.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
 #include "evergreend.h"
diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c
index 189e865..b20e96a 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -25,7 +25,7 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "evergreend.h"
 #include "evergreen_reg_safe.h"
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 44c4750..83121d5 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -24,10 +24,10 @@
 #include <linux/firmware.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "radeon_asic.h"
-#include "radeon_drm.h"
+#include <drm/radeon_drm.h>
 #include "nid.h"
 #include "atom.h"
 #include "ni_reg.h"
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index f2204cb..6abfd2f 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -27,9 +27,9 @@
  */
 #include <linux/seq_file.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "radeon_asic.h"
diff --git a/drivers/gpu/drm/radeon/r200.c b/drivers/gpu/drm/radeon/r200.c
index f240583..4699472 100644
--- a/drivers/gpu/drm/radeon/r200.c
+++ b/drivers/gpu/drm/radeon/r200.c
@@ -25,9 +25,9 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "radeon_asic.h"
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 55a7f19..642e1a1 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -33,7 +33,7 @@
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "radeon_asic.h"
-#include "radeon_drm.h"
+#include <drm/radeon_drm.h>
 #include "r100_track.h"
 #include "r300d.h"
 #include "rv350d.h"
diff --git a/drivers/gpu/drm/radeon/r300_cmdbuf.c b/drivers/gpu/drm/radeon/r300_cmdbuf.c
index c5c2742..89b8d83 100644
--- a/drivers/gpu/drm/radeon/r300_cmdbuf.c
+++ b/drivers/gpu/drm/radeon/r300_cmdbuf.c
@@ -31,10 +31,10 @@
  *    Nicolai Haehnle <prefect_@gmx.net>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_buffer.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_buffer.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 #include "r300_reg.h"
 
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 417fab8..d199e89 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -27,7 +27,7 @@
  */
 #include <linux/seq_file.h>
 #include <linux/slab.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "radeon_asic.h"
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index 3081d07..3b45e7d 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -25,7 +25,7 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index aa5571b..7c9888a 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -29,8 +29,8 @@
 #include <linux/seq_file.h>
 #include <linux/firmware.h>
 #include <linux/platform_device.h>
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "radeon_mode.h"
diff --git a/drivers/gpu/drm/radeon/r600_audio.c b/drivers/gpu/drm/radeon/r600_audio.c
index 846fae5..9d0f715 100644
--- a/drivers/gpu/drm/radeon/r600_audio.c
+++ b/drivers/gpu/drm/radeon/r600_audio.c
@@ -23,7 +23,7 @@
  *
  * Authors: Christian König
  */
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "radeon_reg.h"
 #include "radeon_asic.h"
diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c
index 7f10434..0d927c7 100644
--- a/drivers/gpu/drm/radeon/r600_blit.c
+++ b/drivers/gpu/drm/radeon/r600_blit.c
@@ -23,9 +23,9 @@
  * Authors:
  *     Alex Deucher <alexander.deucher@amd.com>
  */
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 
 #include "r600_blit_shaders.h"
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c
index 9aa74c3..41c6945 100644
--- a/drivers/gpu/drm/radeon/r600_blit_kms.c
+++ b/drivers/gpu/drm/radeon/r600_blit_kms.c
@@ -23,9 +23,9 @@
  *
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
 #include "r600d.h"
diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c
index 45fd592..27f7ec4 100644
--- a/drivers/gpu/drm/radeon/r600_cp.c
+++ b/drivers/gpu/drm/radeon/r600_cp.c
@@ -26,9 +26,9 @@
  *     Alex Deucher <alexander.deucher@amd.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 
 #define PFP_UCODE_SIZE 576
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index db8ef19..8d78ae9 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -26,7 +26,7 @@
  *          Jerome Glisse
  */
 #include <linux/kernel.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "r600d.h"
 #include "r600_reg_safe.h"
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c
index f5ac7e7..e22e5c7 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -23,8 +23,8 @@
  *
  * Authors: Christian König
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c
index 3f6636b..b20bb9a 100644
--- a/drivers/gpu/drm/radeon/radeon_acpi.c
+++ b/drivers/gpu/drm/radeon/radeon_acpi.c
@@ -4,10 +4,10 @@
 #include <acpi/acpi_drivers.h>
 #include <acpi/acpi_bus.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_sarea.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_sarea.h>
+#include <drm/drm_crtc_helper.h>
 #include "radeon.h"
 
 #include <linux/vga_switcheroo.h>
diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c
index bd2f33e..6a96811 100644
--- a/drivers/gpu/drm/radeon/radeon_agp.c
+++ b/drivers/gpu/drm/radeon/radeon_agp.c
@@ -24,10 +24,10 @@
  *    Dave Airlie
  *    Jerome Glisse <glisse@freedesktop.org>
  */
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "radeon.h"
-#include "radeon_drm.h"
+#include <drm/radeon_drm.h>
 
 #if __OS_HAS_AGP
 
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index bf2b615..02b7221 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -23,8 +23,8 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index 229a20f..3c50ebb 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -25,7 +25,7 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c b/drivers/gpu/drm/radeon/radeon_clocks.c
index dcd0863e..3972dc1 100644
--- a/drivers/gpu/drm/radeon/radeon_clocks.c
+++ b/drivers/gpu/drm/radeon/radeon_clocks.c
@@ -25,8 +25,8 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index a74217c..a70a3a7 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -24,8 +24,8 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "atom.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 9792d4f..3ac2861 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -23,11 +23,11 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "drm_edid.h"
-#include "drm_crtc_helper.h"
-#include "drm_fb_helper.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm_edid.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "atom.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c
index 045ec59..d01a7bc 100644
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/drivers/gpu/drm/radeon/radeon_cp.c
@@ -29,10 +29,10 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_sarea.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_sarea.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 #include "r300_reg.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index fae00c0..865733f 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -24,8 +24,8 @@
  * Authors:
  *    Jerome Glisse <glisse@freedesktop.org>
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
index 3189a7e..8bd58ce 100644
--- a/drivers/gpu/drm/radeon/radeon_cursor.c
+++ b/drivers/gpu/drm/radeon/radeon_cursor.c
@@ -23,8 +23,8 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
 #define CURSOR_WIDTH 64
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 28f4655..018e138 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -23,15 +23,15 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
 #include "atom.h"
 #include <asm/div64.h>
 
-#include "drm_crtc_helper.h"
-#include "drm_edid.h"
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_edid.h>
 
 static int radeon_ddc_dump(struct drm_connector *connector);
 
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 85f033f..a4ea8d2 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -29,12 +29,12 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 #include <linux/console.h>
 
 
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index b293487..f0c979d 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -23,9 +23,9 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "drm_crtc_helper.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "atom.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 0b7b486..8b643ee 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -27,14 +27,14 @@
 #include <linux/slab.h>
 #include <linux/fb.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_crtc.h"
-#include "drm_crtc_helper.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
-#include "drm_fb_helper.h"
+#include <drm/drm_fb_helper.h>
 
 #include <linux/vga_switcheroo.h>
 
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 7fd4e3e..9ea8451 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -34,8 +34,8 @@
 #include <linux/list.h>
 #include <linux/kref.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "radeon_trace.h"
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index a533f52..edab0cb 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -25,8 +25,8 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "radeon_reg.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index aa1ca2d..cb755c9 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -25,9 +25,9 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
 int radeon_gem_object_init(struct drm_gem_object *obj)
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c
index 781196d..1e9c1a7 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -23,8 +23,8 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "atom.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_ioc32.c b/drivers/gpu/drm/radeon/radeon_ioc32.c
index 48b7cea..b1f0917 100644
--- a/drivers/gpu/drm/radeon/radeon_ioc32.c
+++ b/drivers/gpu/drm/radeon/radeon_ioc32.c
@@ -29,9 +29,9 @@
  */
 #include <linux/compat.h>
 
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 
 typedef struct drm_radeon_init32 {
diff --git a/drivers/gpu/drm/radeon/radeon_irq.c b/drivers/gpu/drm/radeon/radeon_irq.c
index 465746b..07cafc2 100644
--- a/drivers/gpu/drm/radeon/radeon_irq.c
+++ b/drivers/gpu/drm/radeon/radeon_irq.c
@@ -30,9 +30,9 @@
  *    Michel D�zer <michel@daenzer.net>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 
 void radeon_irq_set_state(struct drm_device *dev, u32 mask, int state)
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 9ec830c..ef4d1f1 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -25,9 +25,9 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
-#include "drm_crtc_helper.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/radeon_drm.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index be2c122..84e0a15 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -25,10 +25,10 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
-#include "drm_sarea.h"
+#include <drm/drmP.h>
+#include <drm/drm_sarea.h>
 #include "radeon.h"
-#include "radeon_drm.h"
+#include <drm/radeon_drm.h>
 
 #include <linux/vga_switcheroo.h>
 #include <linux/slab.h>
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 2f46e0c..5db15a0 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -23,9 +23,9 @@
  * Authors: Dave Airlie
  *          Alex Deucher
  */
-#include "drmP.h"
-#include "drm_crtc_helper.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "atom.h"
 #include <linux/backlight.h>
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
index c7b6cb4..3b05927 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
@@ -1,5 +1,5 @@
-#include "drmP.h"
-#include "drm_crtc_helper.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
 #include "radeon.h"
 
 /*
diff --git a/drivers/gpu/drm/radeon/radeon_mem.c b/drivers/gpu/drm/radeon/radeon_mem.c
index 988548e..91168a0 100644
--- a/drivers/gpu/drm/radeon/radeon_mem.c
+++ b/drivers/gpu/drm/radeon/radeon_mem.c
@@ -29,9 +29,9 @@
  *    Keith Whitwell <keith@tungstengraphics.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 
 /* Very simple allocator for GART memory, working on a static range
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index 976c3b1..f33ed78 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -32,7 +32,7 @@
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <drm/drmP.h>
-#include "radeon_drm.h"
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 #include "radeon_trace.h"
 
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 6fabe89..c5751f3 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -20,7 +20,7 @@
  * Authors: Rafał Miłecki <zajec5@gmail.com>
  *          Alex Deucher <alexdeucher@gmail.com>
  */
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "avivod.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 08c0233..600767d 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -27,8 +27,8 @@
  */
 #include <linux/seq_file.h>
 #include <linux/slab.h>
-#include "drmP.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/radeon_drm.h>
 #include "radeon_reg.h"
 #include "radeon.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c
index 92e7ea7..51955aa 100644
--- a/drivers/gpu/drm/radeon/radeon_state.c
+++ b/drivers/gpu/drm/radeon/radeon_state.c
@@ -27,11 +27,11 @@
  *    Kevin E. Martin <martin@valinux.com>
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "drm_buffer.h"
-#include "drm_sarea.h"
-#include "radeon_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/drm_buffer.h>
+#include <drm/drm_sarea.h>
+#include <drm/radeon_drm.h>
 #include "radeon_drv.h"
 
 /* ================================================================
diff --git a/drivers/gpu/drm/radeon/radeon_trace_points.c b/drivers/gpu/drm/radeon/radeon_trace_points.c
index 8175993..e51d357 100644
--- a/drivers/gpu/drm/radeon/radeon_trace_points.c
+++ b/drivers/gpu/drm/radeon/radeon_trace_points.c
@@ -2,7 +2,7 @@
  * Author : Dave Airlie <airlied@redhat.com>
  */
 #include <drm/drmP.h>
-#include "radeon_drm.h"
+#include <drm/radeon_drm.h>
 #include "radeon.h"
 
 #define CREATE_TRACE_POINTS
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 4b5d0e6..a85cc23 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -35,7 +35,7 @@
  * close to the one of the R600 family (R600 likely being an evolution
  * of the RS600 GART block).
  */
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index a9049ed..1e6c745 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -25,7 +25,7 @@
  *          Alex Deucher
  *          Jerome Glisse
  */
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "radeon_asic.h"
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 6613ee9..00b9aac 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -27,7 +27,7 @@
  */
 #include <linux/seq_file.h>
 #include <linux/slab.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "rv515d.h"
 #include "radeon.h"
 #include "radeon_asic.h"
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 4720d00..eee7c80 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -28,10 +28,10 @@
 #include <linux/firmware.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "radeon.h"
 #include "radeon_asic.h"
-#include "radeon_drm.h"
+#include <drm/radeon_drm.h>
 #include "rv770d.h"
 #include "atom.h"
 #include "avivod.h"
diff --git a/drivers/gpu/drm/savage/savage_bci.c b/drivers/gpu/drm/savage/savage_bci.c
index cb1ee4e..ca2200b 100644
--- a/drivers/gpu/drm/savage/savage_bci.c
+++ b/drivers/gpu/drm/savage/savage_bci.c
@@ -22,8 +22,8 @@
  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-#include "drmP.h"
-#include "savage_drm.h"
+#include <drm/drmP.h>
+#include <drm/savage_drm.h>
 #include "savage_drv.h"
 
 /* Need a long timeout for shadow status updates can take a while
diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
index 6464490..cfc2096 100644
--- a/drivers/gpu/drm/savage/savage_drv.c
+++ b/drivers/gpu/drm/savage/savage_drv.c
@@ -23,11 +23,11 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "savage_drm.h"
+#include <drm/drmP.h>
+#include <drm/savage_drm.h>
 #include "savage_drv.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 
 static struct pci_device_id pciidlist[] = {
 	savage_PCI_IDS
diff --git a/drivers/gpu/drm/savage/savage_state.c b/drivers/gpu/drm/savage/savage_state.c
index 8a3e315..3a6552a 100644
--- a/drivers/gpu/drm/savage/savage_state.c
+++ b/drivers/gpu/drm/savage/savage_state.c
@@ -22,8 +22,8 @@
  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-#include "drmP.h"
-#include "savage_drm.h"
+#include <drm/drmP.h>
+#include <drm/savage_drm.h>
 #include "savage_drv.h"
 
 void savage_emit_clip_rect_s3d(drm_savage_private_t * dev_priv,
diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c
index 46d5be6..13390e9 100644
--- a/drivers/gpu/drm/sis/sis_drv.c
+++ b/drivers/gpu/drm/sis/sis_drv.c
@@ -25,11 +25,11 @@
  *
  */
 
-#include "drmP.h"
-#include "sis_drm.h"
+#include <drm/drmP.h>
+#include <drm/sis_drm.h>
 #include "sis_drv.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 
 static struct pci_device_id pciidlist[] = {
 	sisdrv_PCI_IDS
diff --git a/drivers/gpu/drm/sis/sis_drv.h b/drivers/gpu/drm/sis/sis_drv.h
index 194303c..0b3ab54 100644
--- a/drivers/gpu/drm/sis/sis_drv.h
+++ b/drivers/gpu/drm/sis/sis_drv.h
@@ -44,7 +44,7 @@ enum sis_family {
 	SIS_CHIP_315 = 1,
 };
 
-#include "drm_sman.h"
+#include <drm/drm_sman.h>
 
 
 #define SIS_BASE (dev_priv->mmio)
diff --git a/drivers/gpu/drm/sis/sis_mm.c b/drivers/gpu/drm/sis/sis_mm.c
index 7fe2b63..304e0a7 100644
--- a/drivers/gpu/drm/sis/sis_mm.c
+++ b/drivers/gpu/drm/sis/sis_mm.c
@@ -31,8 +31,8 @@
  *    Thomas Hellström <thomas-at-tungstengraphics-dot-com>
  */
 
-#include "drmP.h"
-#include "sis_drm.h"
+#include <drm/drmP.h>
+#include <drm/sis_drm.h>
 #include "sis_drv.h"
 
 #include <video/sisfb.h>
diff --git a/drivers/gpu/drm/tdfx/tdfx_drv.c b/drivers/gpu/drm/tdfx/tdfx_drv.c
index 8bf9881..44034c2 100644
--- a/drivers/gpu/drm/tdfx/tdfx_drv.c
+++ b/drivers/gpu/drm/tdfx/tdfx_drv.c
@@ -30,10 +30,10 @@
  *    Gareth Hughes <gareth@valinux.com>
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "tdfx_drv.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 
 static struct pci_device_id pciidlist[] = {
 	tdfx_PCI_IDS
diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
index 1c4a72f..8cf9653 100644
--- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
@@ -29,10 +29,10 @@
  *          Keith Packard.
  */
 
-#include "ttm/ttm_module.h"
-#include "ttm/ttm_bo_driver.h"
+#include <drm/ttm/ttm_module.h>
+#include <drm/ttm/ttm_bo_driver.h>
 #ifdef TTM_HAS_AGP
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_placement.h>
 #include <linux/agp_backend.h>
 #include <linux/module.h>
 #include <linux/slab.h>
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 56619f6..c0dad9e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -28,9 +28,9 @@
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
-#include "ttm/ttm_module.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_module.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
 #include <linux/jiffies.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
index 038e947..9212494 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
@@ -28,10 +28,10 @@
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
-#include "ttm/ttm_module.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_placement.h"
-#include "drm_mm.h"
+#include <drm/ttm/ttm_module.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
+#include <drm/drm_mm.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 77dbf40..446f9d3 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -28,8 +28,8 @@
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
 #include <linux/io.h>
 #include <linux/highmem.h>
 #include <linux/wait.h>
diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
index 3832fe1..1937069 100644
--- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c
+++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
@@ -25,9 +25,9 @@
  *
  **************************************************************************/
 
-#include "ttm/ttm_execbuf_util.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_execbuf_util.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
 #include <linux/wait.h>
 #include <linux/sched.h>
 #include <linux/module.h>
diff --git a/drivers/gpu/drm/ttm/ttm_lock.c b/drivers/gpu/drm/ttm/ttm_lock.c
index 075daf4..3daa9a3 100644
--- a/drivers/gpu/drm/ttm/ttm_lock.c
+++ b/drivers/gpu/drm/ttm/ttm_lock.c
@@ -28,8 +28,8 @@
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
-#include "ttm/ttm_lock.h"
-#include "ttm/ttm_module.h"
+#include <drm/ttm/ttm_lock.h>
+#include <drm/ttm/ttm_module.h>
 #include <linux/atomic.h>
 #include <linux/errno.h>
 #include <linux/wait.h>
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
index e70ddd8..93299d9 100644
--- a/drivers/gpu/drm/ttm/ttm_memory.c
+++ b/drivers/gpu/drm/ttm/ttm_memory.c
@@ -25,9 +25,9 @@
  *
  **************************************************************************/
 
-#include "ttm/ttm_memory.h"
-#include "ttm/ttm_module.h"
-#include "ttm/ttm_page_alloc.h"
+#include <drm/ttm/ttm_memory.h>
+#include <drm/ttm/ttm_module.h>
+#include <drm/ttm/ttm_page_alloc.h>
 #include <linux/spinlock.h>
 #include <linux/sched.h>
 #include <linux/wait.h>
diff --git a/drivers/gpu/drm/ttm/ttm_module.c b/drivers/gpu/drm/ttm/ttm_module.c
index 902d7cf..d7f92fe 100644
--- a/drivers/gpu/drm/ttm/ttm_module.c
+++ b/drivers/gpu/drm/ttm/ttm_module.c
@@ -31,8 +31,8 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/sched.h>
-#include "ttm/ttm_module.h"
-#include "drm_sysfs.h"
+#include <drm/ttm/ttm_module.h>
+#include <drm/drm_sysfs.h>
 
 static DECLARE_WAIT_QUEUE_HEAD(exit_q);
 atomic_t device_released;
diff --git a/drivers/gpu/drm/ttm/ttm_object.c b/drivers/gpu/drm/ttm/ttm_object.c
index 93577f2..bb04087 100644
--- a/drivers/gpu/drm/ttm/ttm_object.c
+++ b/drivers/gpu/drm/ttm/ttm_object.c
@@ -49,8 +49,8 @@
  * for fast lookup of ref objects given a base object.
  */
 
-#include "ttm/ttm_object.h"
-#include "ttm/ttm_module.h"
+#include <drm/ttm/ttm_object.h>
+#include <drm/ttm/ttm_module.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/slab.h>
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index 727e93d..74c19e3 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -42,8 +42,8 @@
 
 #include <linux/atomic.h>
 
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_page_alloc.h"
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_page_alloc.h>
 
 #ifdef TTM_HAS_AGP
 #include <asm/agp.h>
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 58c271e..e271a7e 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -35,12 +35,12 @@
 #include <linux/file.h>
 #include <linux/swap.h>
 #include <linux/slab.h>
-#include "drm_cache.h"
-#include "drm_mem_util.h"
-#include "ttm/ttm_module.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_placement.h"
-#include "ttm/ttm_page_alloc.h"
+#include <drm/drm_cache.h>
+#include <drm/drm_mem_util.h>
+#include <drm/ttm/ttm_module.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
+#include <drm/ttm/ttm_page_alloc.h>
 
 static int ttm_tt_swapin(struct ttm_tt *ttm);
 
diff --git a/drivers/gpu/drm/via/via_dma.c b/drivers/gpu/drm/via/via_dma.c
index cc0ffa9..869dabe 100644
--- a/drivers/gpu/drm/via/via_dma.c
+++ b/drivers/gpu/drm/via/via_dma.c
@@ -34,9 +34,9 @@
  *    Thomas Hellstrom.
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "via_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/via_drm.h>
 #include "via_drv.h"
 #include "via_3d_reg.h"
 
diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c
index 3e038a3..8b0f259 100644
--- a/drivers/gpu/drm/via/via_dmablit.c
+++ b/drivers/gpu/drm/via/via_dmablit.c
@@ -34,8 +34,8 @@
  * the same DMA mappings?
  */
 
-#include "drmP.h"
-#include "via_drm.h"
+#include <drm/drmP.h>
+#include <drm/via_drm.h>
 #include "via_drv.h"
 #include "via_dmablit.h"
 
diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 920a552..acf9c78 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -22,11 +22,11 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "drmP.h"
-#include "via_drm.h"
+#include <drm/drmP.h>
+#include <drm/via_drm.h>
 #include "via_drv.h"
 
-#include "drm_pciids.h"
+#include <drm/drm_pciids.h>
 
 static struct pci_device_id pciidlist[] = {
 	viadrv_PCI_IDS
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 9cf87d9..fcb677e 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -24,7 +24,7 @@
 #ifndef _VIA_DRV_H_
 #define _VIA_DRV_H_
 
-#include "drm_sman.h"
+#include <drm/drm_sman.h>
 #define DRIVER_AUTHOR	"Various"
 
 #define DRIVER_NAME		"via"
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
index d391f48..8da2c6e 100644
--- a/drivers/gpu/drm/via/via_irq.c
+++ b/drivers/gpu/drm/via/via_irq.c
@@ -35,9 +35,9 @@
  * The refresh rate is also calculated for video playback sync purposes.
  */
 
-#include "drmP.h"
-#include "drm.h"
-#include "via_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/via_drm.h>
 #include "via_drv.h"
 
 #define VIA_REG_INTERRUPT       0x200
diff --git a/drivers/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c
index 6cca9a7..6056643 100644
--- a/drivers/gpu/drm/via/via_map.c
+++ b/drivers/gpu/drm/via/via_map.c
@@ -21,8 +21,8 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#include "drmP.h"
-#include "via_drm.h"
+#include <drm/drmP.h>
+#include <drm/via_drm.h>
 #include "via_drv.h"
 
 static int via_do_init_map(struct drm_device *dev, drm_via_init_t *init)
diff --git a/drivers/gpu/drm/via/via_mm.c b/drivers/gpu/drm/via/via_mm.c
index 6cc2dad..4c352a7 100644
--- a/drivers/gpu/drm/via/via_mm.c
+++ b/drivers/gpu/drm/via/via_mm.c
@@ -25,10 +25,10 @@
  * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
  */
 
-#include "drmP.h"
-#include "via_drm.h"
+#include <drm/drmP.h>
+#include <drm/via_drm.h>
 #include "via_drv.h"
-#include "drm_sman.h"
+#include <drm/drm_sman.h>
 
 #define VIA_MM_ALIGN_SHIFT 4
 #define VIA_MM_ALIGN_MASK ((1 << VIA_MM_ALIGN_SHIFT) - 1)
diff --git a/drivers/gpu/drm/via/via_verifier.c b/drivers/gpu/drm/via/via_verifier.c
index 48957b8..951244c 100644
--- a/drivers/gpu/drm/via/via_verifier.c
+++ b/drivers/gpu/drm/via/via_verifier.c
@@ -29,9 +29,9 @@
  */
 
 #include "via_3d_reg.h"
-#include "drmP.h"
-#include "drm.h"
-#include "via_drm.h"
+#include <drm/drmP.h>
+#include <drm/drm.h>
+#include <drm/via_drm.h>
 #include "via_verifier.h"
 #include "via_drv.h"
 
diff --git a/drivers/gpu/drm/via/via_video.c b/drivers/gpu/drm/via/via_video.c
index 675d311..6569efa 100644
--- a/drivers/gpu/drm/via/via_video.c
+++ b/drivers/gpu/drm/via/via_video.c
@@ -25,8 +25,8 @@
  * Video and XvMC related functions.
  */
 
-#include "drmP.h"
-#include "via_drm.h"
+#include <drm/drmP.h>
+#include <drm/via_drm.h>
 #include "via_drv.h"
 
 void via_init_futex(drm_via_private_t *dev_priv)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
index 87e43e0..0ccc022 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
@@ -26,8 +26,8 @@
  **************************************************************************/
 
 #include "vmwgfx_drv.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
 
 static uint32_t vram_placement_flags = TTM_PL_FLAG_VRAM |
 	TTM_PL_FLAG_CACHED;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 96949b9..89908e9 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -25,12 +25,12 @@
  *
  **************************************************************************/
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "vmwgfx_drv.h"
-#include "ttm/ttm_placement.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_object.h"
-#include "ttm/ttm_module.h"
+#include <drm/ttm/ttm_placement.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_object.h>
+#include <drm/ttm/ttm_module.h>
 
 #define VMWGFX_DRIVER_NAME "vmwgfx"
 #define VMWGFX_DRIVER_DESC "Linux drm driver for VMware graphics devices"
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 10fc01f..f528316 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -29,15 +29,15 @@
 #define _VMWGFX_DRV_H_
 
 #include "vmwgfx_reg.h"
-#include "drmP.h"
-#include "vmwgfx_drm.h"
-#include "drm_hashtab.h"
-#include "linux/suspend.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_object.h"
-#include "ttm/ttm_lock.h"
-#include "ttm/ttm_execbuf_util.h"
-#include "ttm/ttm_module.h"
+#include <drm/drmP.h>
+#include <drm/vmwgfx_drm.h>
+#include <drm/drm_hashtab.h>
+#include <linux/suspend.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_object.h>
+#include <drm/ttm/ttm_lock.h>
+#include <drm/ttm/ttm_execbuf_util.h>
+#include <drm/ttm/ttm_module.h>
 
 #define VMWGFX_DRIVER_DATE "20100927"
 #define VMWGFX_DRIVER_MAJOR 1
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
index 41b95ed..93a1ebb 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -27,8 +27,8 @@
 
 #include "vmwgfx_drv.h"
 #include "vmwgfx_reg.h"
-#include "ttm/ttm_bo_api.h"
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_bo_api.h>
+#include <drm/ttm/ttm_placement.h>
 
 static int vmw_cmd_invalid(struct vmw_private *dev_priv,
 			   struct vmw_sw_context *sw_context,
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index bfab60c..68707af 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -26,10 +26,10 @@
  *
  **************************************************************************/
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "vmwgfx_drv.h"
 
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_placement.h>
 
 #define VMW_DIRTY_DELAY (HZ / 30)
 
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
index 635c0ff..b0e7659 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -26,8 +26,8 @@
  **************************************************************************/
 
 #include "vmwgfx_drv.h"
-#include "drmP.h"
-#include "ttm/ttm_placement.h"
+#include <drm/drmP.h>
+#include <drm/ttm/ttm_placement.h>
 
 bool vmw_fifo_have_3d(struct vmw_private *dev_priv)
 {
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
index de0c594..7a6391e 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
@@ -26,8 +26,8 @@
  **************************************************************************/
 
 #include "vmwgfx_drv.h"
-#include "drmP.h"
-#include "ttm/ttm_bo_driver.h"
+#include <drm/drmP.h>
+#include <drm/ttm/ttm_bo_driver.h>
 
 /**
  * FIXME: Adjust to the ttm lowmem / highmem storage to minimize
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
index ac6e0d1..56dc40a 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -29,9 +29,9 @@
  */
 
 #include "vmwgfx_drv.h"
-#include "ttm/ttm_module.h"
-#include "ttm/ttm_bo_driver.h"
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_module.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
 #include <linux/idr.h>
 #include <linux/spinlock.h>
 #include <linux/kernel.h>
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
index 570d577..7dd6213 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
@@ -26,7 +26,7 @@
  **************************************************************************/
 
 #include "vmwgfx_drv.h"
-#include "vmwgfx_drm.h"
+#include <drm/vmwgfx_drm.h>
 
 int vmw_getparam_ioctl(struct drm_device *dev, void *data,
 		       struct drm_file *file_priv)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
index e92298a..cb9a4f6 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
@@ -25,7 +25,7 @@
  *
  **************************************************************************/
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "vmwgfx_drv.h"
 
 #define VMW_FENCE_WRAP (1 << 24)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
index 8a398a0..0bc37a4 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
@@ -28,7 +28,7 @@
 #ifndef VMWGFX_KMS_H_
 #define VMWGFX_KMS_H_
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "vmwgfx_drv.h"
 
 
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
index 07ce02d..921b90c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
@@ -26,10 +26,10 @@
  **************************************************************************/
 
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "vmwgfx_drv.h"
 
-#include "ttm/ttm_placement.h"
+#include <drm/ttm/ttm_placement.h>
 
 #include "svga_overlay.h"
 #include "svga_escape.h"
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
index bfe1bcc..a5b7a1e 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -26,10 +26,10 @@
  **************************************************************************/
 
 #include "vmwgfx_drv.h"
-#include "vmwgfx_drm.h"
-#include "ttm/ttm_object.h"
-#include "ttm/ttm_placement.h"
-#include "drmP.h"
+#include <drm/vmwgfx_drm.h>
+#include <drm/ttm/ttm_object.h>
+#include <drm/ttm/ttm_placement.h>
+#include <drm/drmP.h>
 
 #define VMW_RES_CONTEXT ttm_driver_type0
 #define VMW_RES_SURFACE ttm_driver_type1
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
index 1e8eedd..f48721e 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
@@ -25,7 +25,7 @@
  *
  **************************************************************************/
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "vmwgfx_drv.h"
 
 int vmw_mmap(struct file *filp, struct vm_area_struct *vma)


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

* [PATCH 05/40] UAPI: Add include/uapi/ directories to build [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (3 preceding siblings ...)
  2011-07-28 15:49 ` [PATCH 04/40] UAPI: Convert #include "..." to #include <path/...> in kernel system headers " David Howells
@ 2011-07-28 15:50 ` David Howells
  2011-07-28 15:50 ` [PATCH 06/40] UAPI: Differentiate userspace build and kernelspace build include path sets " David Howells
                   ` (34 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:50 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 Makefile |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index d018956..68834a5 100644
--- a/Makefile
+++ b/Makefile
@@ -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
 


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

* [PATCH 06/40] UAPI: Differentiate userspace build and kernelspace build include path sets [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (4 preceding siblings ...)
  2011-07-28 15:50 ` [PATCH 05/40] UAPI: Add include/uapi/ directories to build " David Howells
@ 2011-07-28 15:50 ` David Howells
  2011-07-28 15:50 ` [PATCH 07/40] UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed " David Howells
                   ` (33 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:50 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 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(-)

diff --git a/Makefile b/Makefile
index 68834a5..91598e4 100644
--- a/Makefile
+++ b/Makefile
@@ -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__
 
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index 95365a8..86a85aa 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -37,7 +37,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
 
@@ -51,7 +51,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 \
diff --git a/arch/x86/boot/mkcpustr.c b/arch/x86/boot/mkcpustr.c
index 919257f..4579eff 100644
--- a/arch/x86/boot/mkcpustr.c
+++ b/arch/x86/boot/mkcpustr.c
@@ -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)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 4258aac..38ba7a6 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -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 */
 
diff --git a/arch/x86/kernel/cpu/mkcapflags.pl b/arch/x86/kernel/cpu/mkcapflags.pl
index dfea390..6c3c4f1 100644
--- a/arch/x86/kernel/cpu/mkcapflags.pl
+++ b/arch/x86/kernel/cpu/mkcapflags.pl
@@ -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>)) {


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

* [PATCH 07/40] UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (5 preceding siblings ...)
  2011-07-28 15:50 ` [PATCH 06/40] UAPI: Differentiate userspace build and kernelspace build include path sets " David Howells
@ 2011-07-28 15:50 ` David Howells
  2011-07-28 15:50 ` [PATCH 08/40] UAPI: ac_etime in linux/acct.h must keep its __KERNEL__ guards " David Howells
                   ` (32 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:50 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/acct.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/acct.h b/include/linux/acct.h
index 3e4737f..d537aa0 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -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


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

* [PATCH 08/40] UAPI: ac_etime in linux/acct.h must keep its __KERNEL__ guards [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (6 preceding siblings ...)
  2011-07-28 15:50 ` [PATCH 07/40] UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed " David Howells
@ 2011-07-28 15:50 ` David Howells
  2011-07-28 15:50 ` [PATCH 09/40] UAPI: Make linux/patchkey.h easier to parse " David Howells
                   ` (31 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:50 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/acct.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/acct.h b/include/linux/acct.h
index d537aa0..55e88b5 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -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 */


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

* [PATCH 09/40] UAPI: Make linux/patchkey.h easier to parse [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (7 preceding siblings ...)
  2011-07-28 15:50 ` [PATCH 08/40] UAPI: ac_etime in linux/acct.h must keep its __KERNEL__ guards " David Howells
@ 2011-07-28 15:50 ` David Howells
  2011-07-28 15:50 ` [PATCH 10/40] UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h " David Howells
                   ` (30 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:50 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/patchkey.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/linux/patchkey.h b/include/linux/patchkey.h
index d974a6e..aefda0e 100644
--- a/include/linux/patchkey.h
+++ b/include/linux/patchkey.h
@@ -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 */


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

* [PATCH 10/40] UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (8 preceding siblings ...)
  2011-07-28 15:50 ` [PATCH 09/40] UAPI: Make linux/patchkey.h easier to parse " David Howells
@ 2011-07-28 15:50 ` David Howells
  2011-07-28 15:51 ` [PATCH 11/40] UAPI: Fix nested __KERNEL__ guards in video/edid.h " David Howells
                   ` (29 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:50 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/soundcard.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h
index fe204fe..dfcf86f 100644
--- a/include/linux/soundcard.h
+++ b/include/linux/soundcard.h
@@ -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
 
 /*


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

* [PATCH 11/40] UAPI: Fix nested __KERNEL__ guards in video/edid.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (9 preceding siblings ...)
  2011-07-28 15:50 ` [PATCH 10/40] UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h " David Howells
@ 2011-07-28 15:51 ` David Howells
  2011-07-28 15:51 ` [PATCH 12/40] UAPI: Split trivial #if defined(__KERNEL__) && X conditionals " David Howells
                   ` (28 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:51 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/video/edid.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/video/edid.h b/include/video/edid.h
index 928c342..c5f1987 100644
--- a/include/video/edid.h
+++ b/include/video/edid.h
@@ -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__ */


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

* [PATCH 12/40] UAPI: Split trivial #if defined(__KERNEL__) && X conditionals [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (10 preceding siblings ...)
  2011-07-28 15:51 ` [PATCH 11/40] UAPI: Fix nested __KERNEL__ guards in video/edid.h " David Howells
@ 2011-07-28 15:51 ` David Howells
  2011-07-28 15:51 ` [PATCH 13/40] UAPI: Remove the inclusion of linux/types.h from x86's asm/page.h " David Howells
                   ` (27 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:51 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 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(-)

diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
index c93a22a..9176261 100644
--- a/arch/arm/include/asm/hwcap.h
+++ b/arch/arm/include/asm/hwcap.h
@@ -25,7 +25,8 @@
 #define HWCAP_IDIVT	(1 << 18)
 #define HWCAP_IDIV	(HWCAP_IDIVA | HWCAP_IDIVT)
 
-#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.
@@ -33,5 +34,6 @@
 #define ELF_HWCAP	(elf_hwcap)
 extern unsigned int elf_hwcap;
 #endif
+#endif
 
 #endif
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
index 9997ad2..e82adf6 100644
--- a/arch/arm/include/asm/swab.h
+++ b/arch/arm/include/asm/swab.h
@@ -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;
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 2c04ed5..59d0f02 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -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__
 
diff --git a/arch/ia64/include/asm/intrinsics.h b/arch/ia64/include/asm/intrinsics.h
index 111ed52..e4076b5 100644
--- a/arch/ia64/include/asm/intrinsics.h
+++ b/arch/ia64/include/asm/intrinsics.h
@@ -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
 
 /************************************************/
diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h
index 533812b..9b96461 100644
--- a/arch/mips/include/asm/types.h
+++ b/arch/mips/include/asm/types.h
@@ -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__
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h
index 4e9c8ae..d49760e 100644
--- a/arch/s390/include/asm/mman.h
+++ b/arch/s390/include/asm/mman.h
@@ -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__ */
diff --git a/arch/tile/include/asm/signal.h b/arch/tile/include/asm/signal.h
index 1e1e616..1e5e49a 100644
--- a/arch/tile/include/asm/signal.h
+++ b/arch/tile/include/asm/signal.h
@@ -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 */
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index a3759cb..6d8c725 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -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)];


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

* [PATCH 13/40] UAPI: Remove the inclusion of linux/types.h from x86's asm/page.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (11 preceding siblings ...)
  2011-07-28 15:51 ` [PATCH 12/40] UAPI: Split trivial #if defined(__KERNEL__) && X conditionals " David Howells
@ 2011-07-28 15:51 ` David Howells
  2011-07-28 15:51 ` [PATCH 14/40] UAPI: Fix definition of HZ in asm-generic/param.h " David Howells
                   ` (26 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:51 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/x86/include/asm/page.h       |    2 --
 arch/x86/include/asm/page_types.h |    3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index 8ca8283..d4ee8d8 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -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>
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
index bce688d..eeff662 100644
--- a/arch/x86/include/asm/page_types.h
+++ b/arch/x86/include/asm/page_types.h
@@ -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


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

* [PATCH 14/40] UAPI: Fix definition of HZ in asm-generic/param.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (12 preceding siblings ...)
  2011-07-28 15:51 ` [PATCH 13/40] UAPI: Remove the inclusion of linux/types.h from x86's asm/page.h " David Howells
@ 2011-07-28 15:51 ` David Howells
  2011-07-28 15:51 ` [PATCH 15/40] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace " David Howells
                   ` (25 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:51 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/asm-generic/param.h |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/asm-generic/param.h b/include/asm-generic/param.h
index cdf8251..835632a 100644
--- a/include/asm-generic/param.h
+++ b/include/asm-generic/param.h
@@ -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 */


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

* [PATCH 15/40] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (13 preceding siblings ...)
  2011-07-28 15:51 ` [PATCH 14/40] UAPI: Fix definition of HZ in asm-generic/param.h " David Howells
@ 2011-07-28 15:51 ` David Howells
  2011-07-28 15:51 ` [PATCH 16/40] UAPI: Fix sigset_t ordering problem " David Howells
                   ` (24 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:51 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/elf.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/linux/elf.h b/include/linux/elf.h
index 110821c..411d7b8 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -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,


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

* [PATCH 16/40] UAPI: Fix sigset_t ordering problem [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (14 preceding siblings ...)
  2011-07-28 15:51 ` [PATCH 15/40] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace " David Howells
@ 2011-07-28 15:51 ` David Howells
  2011-07-28 15:52 ` [PATCH 17/40] UAPI: Fix E820_X_MAX " David Howells
                   ` (23 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:51 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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 UAPI header should be included in the kernel-specific file.  The
marker will be deleted later.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/x86/include/asm/signal.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h
index 598457c..40ef827 100644
--- a/arch/x86/include/asm/signal.h
+++ b/arch/x86/include/asm/signal.h
@@ -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


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

* [PATCH 17/40] UAPI: Fix E820_X_MAX ordering problem [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (15 preceding siblings ...)
  2011-07-28 15:51 ` [PATCH 16/40] UAPI: Fix sigset_t ordering problem " David Howells
@ 2011-07-28 15:52 ` David Howells
  2011-07-28 15:52 ` [PATCH 18/40] UAPI: Fix linux/netfilter.h inclusion order " David Howells
                   ` (22 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:52 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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 UAPI header should be included in the kernel-specific file.  The
marker will be deleted later.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/x86/include/asm/e820.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 908b969..e02512f 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -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


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

* [PATCH 18/40] UAPI: Fix linux/netfilter.h inclusion order [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (16 preceding siblings ...)
  2011-07-28 15:52 ` [PATCH 17/40] UAPI: Fix E820_X_MAX " David Howells
@ 2011-07-28 15:52 ` David Howells
  2011-07-28 15:52 ` [PATCH 19/40] UAPI: Fix linux/input.h " David Howells
                   ` (21 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:52 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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 UAPI header should be included in the kernel-specific file.  The
marker will be deleted later.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/netfilter.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 857f502..4faf53d 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -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


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

* [PATCH 19/40] UAPI: Fix linux/input.h inclusion order [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (17 preceding siblings ...)
  2011-07-28 15:52 ` [PATCH 18/40] UAPI: Fix linux/netfilter.h inclusion order " David Howells
@ 2011-07-28 15:52 ` David Howells
  2011-07-28 15:52 ` [PATCH 20/40] UAPI: Fix up linux/netfilter/xt_policy.h " David Howells
                   ` (20 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:52 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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 UAPI header should be included in the kernel-specific file.  The
marker will be deleted later.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/input.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/input.h b/include/linux/input.h
index 068784e..b785703 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -19,6 +19,8 @@
 #include <linux/types.h>
 #endif
 
+// DISINTEGRATE: INCLUDE UAPI HERE
+
 /*
  * The event structure itself
  */


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

* [PATCH 20/40] UAPI: Fix up linux/netfilter/xt_policy.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (18 preceding siblings ...)
  2011-07-28 15:52 ` [PATCH 19/40] UAPI: Fix linux/input.h " David Howells
@ 2011-07-28 15:52 ` David Howells
  2011-07-28 15:52 ` [PATCH 21/40] UAPI: Fix linux/auto_fs.h inclusion order " David Howells
                   ` (19 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:52 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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?

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/netfilter/xt_policy.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h
index be8ead0..573da52 100644
--- a/include/linux/netfilter/xt_policy.h
+++ b/include/linux/netfilter/xt_policy.h
@@ -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;


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

* [PATCH 21/40] UAPI: Fix linux/auto_fs.h inclusion order [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (19 preceding siblings ...)
  2011-07-28 15:52 ` [PATCH 20/40] UAPI: Fix up linux/netfilter/xt_policy.h " David Howells
@ 2011-07-28 15:52 ` David Howells
  2011-07-28 15:52 ` [PATCH 22/40] UAPI: Fix drmP.h to use #include <...> when referring to system header files " David Howells
                   ` (18 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:52 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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 UAPI header should be included in the kernel-specific file.  The
marker will be deleted later.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/auto_fs.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h
index da64e15..f9ca4e6 100644
--- a/include/linux/auto_fs.h
+++ b/include/linux/auto_fs.h
@@ -23,6 +23,8 @@
 #include <sys/ioctl.h>
 #endif /* __KERNEL__ */
 
+// DISINTEGRATE: INCLUDE UAPI HERE
+
 /* This file describes autofs v3 */
 #define AUTOFS_PROTO_VERSION	3
 


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

* [PATCH 22/40] UAPI: Fix drmP.h to use #include <...> when referring to system header files [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (20 preceding siblings ...)
  2011-07-28 15:52 ` [PATCH 21/40] UAPI: Fix linux/auto_fs.h inclusion order " David Howells
@ 2011-07-28 15:52 ` David Howells
  2011-07-28 15:53 ` [PATCH 23/40] UAPI: sound/sound_core.c should include linux/fs.h " David Howells
                   ` (17 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:52 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

Fix drmP.h to use #include <...> when referring to system header files to make
sure the UAPI header defaulting works correctly.  The -I flag to include/drm/
should be removed at some point.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/drm/drmP.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 6fd0f16..37d0e99 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -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


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

* [PATCH 23/40] UAPI: sound/sound_core.c should include linux/fs.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (21 preceding siblings ...)
  2011-07-28 15:52 ` [PATCH 22/40] UAPI: Fix drmP.h to use #include <...> when referring to system header files " David Howells
@ 2011-07-28 15:53 ` David Howells
  2011-07-28 15:53 ` [PATCH 24/40] UAPI: Fix SNDRV_*_ENDIAN ordering problem " David Howells
                   ` (16 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:53 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 sound/sound_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sound/sound_core.c b/sound/sound_core.c
index 6ce2778..b6bc127 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -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


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

* [PATCH 24/40] UAPI: Fix SNDRV_*_ENDIAN ordering problem [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (22 preceding siblings ...)
  2011-07-28 15:53 ` [PATCH 23/40] UAPI: sound/sound_core.c should include linux/fs.h " David Howells
@ 2011-07-28 15:53 ` David Howells
  2011-07-28 15:53 ` [PATCH 25/40] UAPI: Fix u_quad_t ordering problem in linux/coda.h " David Howells
                   ` (15 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:53 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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 UAPI header should be included in the kernel-specific file.  The
marker will be deleted later.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/sound/asound.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/sound/asound.h b/include/sound/asound.h
index 5d6074f..e4918f6 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -40,6 +40,7 @@
 #endif
 #endif
 
+// DISINTEGRATE: INCLUDE UAPI HERE
 #endif /* __KERNEL__ **/
 
 /*


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

* [PATCH 25/40] UAPI: Fix u_quad_t ordering problem in linux/coda.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (23 preceding siblings ...)
  2011-07-28 15:53 ` [PATCH 24/40] UAPI: Fix SNDRV_*_ENDIAN ordering problem " David Howells
@ 2011-07-28 15:53 ` David Howells
  2011-07-28 15:53 ` [PATCH 26/40] UAPI: Fix " David Howells
                   ` (14 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:53 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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 UAPI header should be included in the kernel-specific file.  The
marker will be deleted later.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/coda.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/coda.h b/include/linux/coda.h
index 96c8769..5a2c1a0 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -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 {


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

* [PATCH 26/40] UAPI: Fix linux/coda.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (24 preceding siblings ...)
  2011-07-28 15:53 ` [PATCH 25/40] UAPI: Fix u_quad_t ordering problem in linux/coda.h " David Howells
@ 2011-07-28 15:53 ` David Howells
  2011-07-28 15:53 ` [PATCH 27/40] UAPI: Guard linux/isdn_divertif.h " David Howells
                   ` (13 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:53 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/coda.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/coda.h b/include/linux/coda.h
index 5a2c1a0..2ae9dcd 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -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
 };


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

* [PATCH 27/40] UAPI: Guard linux/isdn_divertif.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (25 preceding siblings ...)
  2011-07-28 15:53 ` [PATCH 26/40] UAPI: Fix " David Howells
@ 2011-07-28 15:53 ` David Howells
  2011-07-28 15:53 ` [PATCH 28/40] UAPI: Guard linux/sound.h " David Howells
                   ` (12 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:53 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/isdn_divertif.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/isdn_divertif.h b/include/linux/isdn_divertif.h
index 07821ca..a5a50f5 100644
--- a/include/linux/isdn_divertif.h
+++ b/include/linux/isdn_divertif.h
@@ -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 */


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

* [PATCH 28/40] UAPI: Guard linux/sound.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (26 preceding siblings ...)
  2011-07-28 15:53 ` [PATCH 27/40] UAPI: Guard linux/isdn_divertif.h " David Howells
@ 2011-07-28 15:53 ` David Howells
  2011-07-28 15:53 ` [PATCH 29/40] UAPI: Fix linux/ncp.h " David Howells
                   ` (11 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:53 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/sound.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/sound.h b/include/linux/sound.h
index 44dcf05..fae20ba 100644
--- a/include/linux/sound.h
+++ b/include/linux/sound.h
@@ -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 */


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

* [PATCH 29/40] UAPI: Fix linux/ncp.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (27 preceding siblings ...)
  2011-07-28 15:53 ` [PATCH 28/40] UAPI: Guard linux/sound.h " David Howells
@ 2011-07-28 15:53 ` David Howells
  2011-07-28 15:54 ` [PATCH 30/40] UAPI: Fix x86_64 system call count and generation " David Howells
                   ` (10 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:53 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/ncp.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/ncp.h b/include/linux/ncp.h
index 99f0ade..4717262 100644
--- a/include/linux/ncp.h
+++ b/include/linux/ncp.h
@@ -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));


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

* [PATCH 30/40] UAPI: Fix x86_64 system call count and generation [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (28 preceding siblings ...)
  2011-07-28 15:53 ` [PATCH 29/40] UAPI: Fix linux/ncp.h " David Howells
@ 2011-07-28 15:54 ` David Howells
  2011-07-28 15:54 ` [PATCH 31/40] UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines " David Howells
                   ` (9 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:54 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/x86/kernel/asm-offsets_64.c |    1 +
 arch/x86/kernel/syscall_64.c     |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index e72a119..8cad3e3 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -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>
diff --git a/arch/x86/kernel/syscall_64.c b/arch/x86/kernel/syscall_64.c
index de87d60..b659abc 100644
--- a/arch/x86/kernel/syscall_64.c
+++ b/arch/x86/kernel/syscall_64.c
@@ -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);
 


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

* [PATCH 31/40] UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (29 preceding siblings ...)
  2011-07-28 15:54 ` [PATCH 30/40] UAPI: Fix x86_64 system call count and generation " David Howells
@ 2011-07-28 15:54 ` David Howells
  2011-07-28 15:54 ` [PATCH 32/40] UAPI: Add a script to create a commit to set up new UAPI dirs " David Howells
                   ` (8 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:54 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells, Ralf Baechle

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

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
---

 arch/mips/include/asm/Kbuild |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 7897f05..f53f9ca 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -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


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

* [PATCH 32/40] UAPI: Add a script to create a commit to set up new UAPI dirs [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (30 preceding siblings ...)
  2011-07-28 15:54 ` [PATCH 31/40] UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines " David Howells
@ 2011-07-28 15:54 ` David Howells
  2011-07-28 15:54 ` [PATCH 33/40] UAPI: Set up UAPI Kbuild files " David Howells
                   ` (7 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:54 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 scripts/uapi-disintegration/set-up-Kbuild.pl |  107 ++++++++++++++++++++++++++
 1 files changed, 107 insertions(+), 0 deletions(-)
 create mode 100755 scripts/uapi-disintegration/set-up-Kbuild.pl

diff --git a/scripts/uapi-disintegration/set-up-Kbuild.pl b/scripts/uapi-disintegration/set-up-Kbuild.pl
new file mode 100755
index 0000000..6e497fb
--- /dev/null
+++ b/scripts/uapi-disintegration/set-up-Kbuild.pl
@@ -0,0 +1,107 @@
+#!/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" .
+       "' --sign 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 "# UAPI Header export list\n" or die "write $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;


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

* [PATCH 33/40] UAPI: Set up UAPI Kbuild files [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (31 preceding siblings ...)
  2011-07-28 15:54 ` [PATCH 32/40] UAPI: Add a script to create a commit to set up new UAPI dirs " David Howells
@ 2011-07-28 15:54 ` David Howells
  2011-07-28 15:54 ` [PATCH 34/40] UAPI: Plumb the UAPI Kbuilds into the user header handling system " David Howells
                   ` (6 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:54 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/alpha/include/uapi/asm/Kbuild          |    3 +++
 arch/arm/include/uapi/asm/Kbuild            |    3 +++
 arch/avr32/include/uapi/asm/Kbuild          |    3 +++
 arch/blackfin/include/uapi/asm/Kbuild       |    3 +++
 arch/cris/include/uapi/arch-v10/arch/Kbuild |    1 +
 arch/cris/include/uapi/arch-v32/arch/Kbuild |    1 +
 arch/cris/include/uapi/asm/Kbuild           |    5 +++++
 arch/frv/include/uapi/asm/Kbuild            |    3 +++
 arch/h8300/include/uapi/asm/Kbuild          |    3 +++
 arch/ia64/include/uapi/asm/Kbuild           |    3 +++
 arch/m32r/include/uapi/asm/Kbuild           |    3 +++
 arch/m68k/include/uapi/asm/Kbuild           |    3 +++
 arch/microblaze/include/uapi/asm/Kbuild     |    3 +++
 arch/mips/include/uapi/asm/Kbuild           |    3 +++
 arch/mn10300/include/uapi/asm/Kbuild        |    3 +++
 arch/openrisc/include/uapi/asm/Kbuild       |    3 +++
 arch/parisc/include/uapi/asm/Kbuild         |    3 +++
 arch/powerpc/include/uapi/asm/Kbuild        |    3 +++
 arch/s390/include/uapi/asm/Kbuild           |    3 +++
 arch/score/include/uapi/asm/Kbuild          |    3 +++
 arch/sh/include/uapi/asm/Kbuild             |    3 +++
 arch/sparc/include/uapi/asm/Kbuild          |    5 +++++
 arch/tile/include/uapi/asm/Kbuild           |    3 +++
 arch/unicore32/include/uapi/asm/Kbuild      |    3 +++
 arch/x86/include/uapi/asm/Kbuild            |    3 +++
 arch/xtensa/include/uapi/asm/Kbuild         |    3 +++
 include/uapi/Kbuild                         |   14 ++++++++++++++
 include/uapi/asm-generic/Kbuild             |    1 +
 include/uapi/drm/Kbuild                     |    1 +
 include/uapi/linux/Kbuild                   |   15 +++++++++++++++
 include/uapi/linux/byteorder/Kbuild         |    1 +
 include/uapi/linux/caif/Kbuild              |    1 +
 include/uapi/linux/can/Kbuild               |    1 +
 include/uapi/linux/dvb/Kbuild               |    1 +
 include/uapi/linux/hdlc/Kbuild              |    1 +
 include/uapi/linux/isdn/Kbuild              |    1 +
 include/uapi/linux/mmc/Kbuild               |    1 +
 include/uapi/linux/netfilter/Kbuild         |    2 ++
 include/uapi/linux/netfilter/ipset/Kbuild   |    1 +
 include/uapi/linux/netfilter_arp/Kbuild     |    1 +
 include/uapi/linux/netfilter_bridge/Kbuild  |    1 +
 include/uapi/linux/netfilter_ipv4/Kbuild    |    1 +
 include/uapi/linux/netfilter_ipv6/Kbuild    |    1 +
 include/uapi/linux/nfsd/Kbuild              |    1 +
 include/uapi/linux/raid/Kbuild              |    1 +
 include/uapi/linux/spi/Kbuild               |    1 +
 include/uapi/linux/sunrpc/Kbuild            |    1 +
 include/uapi/linux/tc_act/Kbuild            |    1 +
 include/uapi/linux/tc_ematch/Kbuild         |    1 +
 include/uapi/linux/usb/Kbuild               |    1 +
 include/uapi/linux/wimax/Kbuild             |    1 +
 include/uapi/mtd/Kbuild                     |    1 +
 include/uapi/rdma/Kbuild                    |    1 +
 include/uapi/scsi/Kbuild                    |    2 ++
 include/uapi/scsi/fc/Kbuild                 |    1 +
 include/uapi/sound/Kbuild                   |    1 +
 include/uapi/video/Kbuild                   |    1 +
 include/uapi/xen/Kbuild                     |    1 +
 58 files changed, 139 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/openrisc/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

diff --git a/arch/alpha/include/uapi/asm/Kbuild b/arch/alpha/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/alpha/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/arm/include/uapi/asm/Kbuild b/arch/arm/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/arm/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/avr32/include/uapi/asm/Kbuild b/arch/avr32/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/avr32/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/blackfin/include/uapi/asm/Kbuild b/arch/blackfin/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/blackfin/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/cris/include/uapi/arch-v10/arch/Kbuild b/arch/cris/include/uapi/arch-v10/arch/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/arch/cris/include/uapi/arch-v10/arch/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/arch/cris/include/uapi/arch-v32/arch/Kbuild b/arch/cris/include/uapi/arch-v32/arch/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/arch/cris/include/uapi/arch-v32/arch/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/arch/cris/include/uapi/asm/Kbuild b/arch/cris/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..f50236a
--- /dev/null
+++ b/arch/cris/include/uapi/asm/Kbuild
@@ -0,0 +1,5 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
+header-y += arch-v10/
+header-y += arch-v32/
diff --git a/arch/frv/include/uapi/asm/Kbuild b/arch/frv/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/frv/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/h8300/include/uapi/asm/Kbuild b/arch/h8300/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/h8300/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/ia64/include/uapi/asm/Kbuild b/arch/ia64/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/ia64/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/m32r/include/uapi/asm/Kbuild b/arch/m32r/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/m32r/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/m68k/include/uapi/asm/Kbuild b/arch/m68k/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/m68k/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/microblaze/include/uapi/asm/Kbuild b/arch/microblaze/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/microblaze/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/mips/include/uapi/asm/Kbuild b/arch/mips/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/mips/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/mn10300/include/uapi/asm/Kbuild b/arch/mn10300/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/mn10300/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/openrisc/include/uapi/asm/Kbuild b/arch/openrisc/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/openrisc/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/parisc/include/uapi/asm/Kbuild b/arch/parisc/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/parisc/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/powerpc/include/uapi/asm/Kbuild b/arch/powerpc/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/powerpc/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/s390/include/uapi/asm/Kbuild b/arch/s390/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/s390/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/score/include/uapi/asm/Kbuild b/arch/score/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/score/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/sh/include/uapi/asm/Kbuild b/arch/sh/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/sh/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/sparc/include/uapi/asm/Kbuild b/arch/sparc/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..7518ad2
--- /dev/null
+++ b/arch/sparc/include/uapi/asm/Kbuild
@@ -0,0 +1,5 @@
+# UAPI Header export list
+# User exported sparc header files
+
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/tile/include/uapi/asm/Kbuild b/arch/tile/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/tile/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/unicore32/include/uapi/asm/Kbuild b/arch/unicore32/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/x86/include/uapi/asm/Kbuild b/arch/x86/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/x86/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/arch/xtensa/include/uapi/asm/Kbuild b/arch/xtensa/include/uapi/asm/Kbuild
new file mode 100644
index 0000000..baebb3d
--- /dev/null
+++ b/arch/xtensa/include/uapi/asm/Kbuild
@@ -0,0 +1,3 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
diff --git a/include/uapi/Kbuild b/include/uapi/Kbuild
new file mode 100644
index 0000000..81d2106
--- /dev/null
+++ b/include/uapi/Kbuild
@@ -0,0 +1,14 @@
+# UAPI Header export list
+# 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/
diff --git a/include/uapi/asm-generic/Kbuild b/include/uapi/asm-generic/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/asm-generic/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/drm/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
new file mode 100644
index 0000000..83e3600
--- /dev/null
+++ b/include/uapi/linux/Kbuild
@@ -0,0 +1,15 @@
+# UAPI Header export list
+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/
diff --git a/include/uapi/linux/byteorder/Kbuild b/include/uapi/linux/byteorder/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/byteorder/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/caif/Kbuild b/include/uapi/linux/caif/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/caif/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/can/Kbuild b/include/uapi/linux/can/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/can/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/dvb/Kbuild b/include/uapi/linux/dvb/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/dvb/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/hdlc/Kbuild b/include/uapi/linux/hdlc/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/hdlc/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/isdn/Kbuild b/include/uapi/linux/isdn/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/isdn/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/mmc/Kbuild b/include/uapi/linux/mmc/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/mmc/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
new file mode 100644
index 0000000..4afbace
--- /dev/null
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -0,0 +1,2 @@
+# UAPI Header export list
+header-y += ipset/
diff --git a/include/uapi/linux/netfilter/ipset/Kbuild b/include/uapi/linux/netfilter/ipset/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/netfilter/ipset/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/netfilter_arp/Kbuild b/include/uapi/linux/netfilter_arp/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/netfilter_arp/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/netfilter_bridge/Kbuild b/include/uapi/linux/netfilter_bridge/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/netfilter_bridge/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/netfilter_ipv4/Kbuild b/include/uapi/linux/netfilter_ipv4/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/netfilter_ipv4/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/netfilter_ipv6/Kbuild b/include/uapi/linux/netfilter_ipv6/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/netfilter_ipv6/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/nfsd/Kbuild b/include/uapi/linux/nfsd/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/nfsd/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/raid/Kbuild b/include/uapi/linux/raid/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/raid/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/spi/Kbuild b/include/uapi/linux/spi/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/spi/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/sunrpc/Kbuild b/include/uapi/linux/sunrpc/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/sunrpc/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/tc_ematch/Kbuild b/include/uapi/linux/tc_ematch/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/tc_ematch/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/usb/Kbuild b/include/uapi/linux/usb/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/usb/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/linux/wimax/Kbuild b/include/uapi/linux/wimax/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/linux/wimax/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/mtd/Kbuild b/include/uapi/mtd/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/mtd/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/rdma/Kbuild b/include/uapi/rdma/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/rdma/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/scsi/Kbuild b/include/uapi/scsi/Kbuild
new file mode 100644
index 0000000..29a87dd
--- /dev/null
+++ b/include/uapi/scsi/Kbuild
@@ -0,0 +1,2 @@
+# UAPI Header export list
+header-y += fc/
diff --git a/include/uapi/scsi/fc/Kbuild b/include/uapi/scsi/fc/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/scsi/fc/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/sound/Kbuild b/include/uapi/sound/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/sound/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/video/Kbuild b/include/uapi/video/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/video/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list
diff --git a/include/uapi/xen/Kbuild b/include/uapi/xen/Kbuild
new file mode 100644
index 0000000..aafaa5a
--- /dev/null
+++ b/include/uapi/xen/Kbuild
@@ -0,0 +1 @@
+# UAPI Header export list


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

* [PATCH 34/40] UAPI: Plumb the UAPI Kbuilds into the user header handling system [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (32 preceding siblings ...)
  2011-07-28 15:54 ` [PATCH 33/40] UAPI: Set up UAPI Kbuild files " David Howells
@ 2011-07-28 15:54 ` David Howells
  2011-07-28 15:54 ` [PATCH 35/40] UAPI: Set up uapi/asm/Kbuild.asm " David Howells
                   ` (5 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:54 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 Makefile |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 91598e4..2c0bf71 100644
--- a/Makefile
+++ b/Makefile
@@ -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


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

* [PATCH 35/40] UAPI: Set up uapi/asm/Kbuild.asm [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (33 preceding siblings ...)
  2011-07-28 15:54 ` [PATCH 34/40] UAPI: Plumb the UAPI Kbuilds into the user header handling system " David Howells
@ 2011-07-28 15:54 ` David Howells
  2011-07-28 15:55 ` [PATCH 36/40] UAPI: Move linux/version.h " David Howells
                   ` (4 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:54 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 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

diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index c5d2e5d..4923b27 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -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)))
diff --git a/include/uapi/asm-generic/Kbuild.asm b/include/uapi/asm-generic/Kbuild.asm
new file mode 100644
index 0000000..5789ed6
--- /dev/null
+++ b/include/uapi/asm-generic/Kbuild.asm
@@ -0,0 +1,44 @@
+#
+# Headers that are optional in arch/*/uapi/asm/
+#
+opt-header += kvm.h
+opt-header += kvm_para.h
+opt-header += a.out.h
+
+#
+# Headers that are mandatory in arch/*/uapi/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
+
+header-y := $(foreach hdr,$(asm-headers) $(opt-headers), \
+		$(if $(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/$(hdr)), \
+		  $(hdr)))


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

* [PATCH 36/40] UAPI: Move linux/version.h [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (34 preceding siblings ...)
  2011-07-28 15:54 ` [PATCH 35/40] UAPI: Set up uapi/asm/Kbuild.asm " David Howells
@ 2011-07-28 15:55 ` David Howells
  2011-07-28 15:55 ` [PATCH 37/40] UAPI: Make UAPI headers install to usr/include/ " David Howells
                   ` (3 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:55 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 Makefile                  |   10 +++++-----
 include/linux/Kbuild      |    1 -
 include/uapi/linux/Kbuild |    3 +++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 2c0bf71..b307524 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 619b565..fd48c91 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -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 \
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 83e3600..ca80760 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -13,3 +13,6 @@ header-y += sunrpc/
 header-y += netfilter/
 header-y += usb/
 header-y += wimax/
+
+objhdr-y += version.h
+


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

* [PATCH 37/40] UAPI: Make UAPI headers install to usr/include/ [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (35 preceding siblings ...)
  2011-07-28 15:55 ` [PATCH 36/40] UAPI: Move linux/version.h " David Howells
@ 2011-07-28 15:55 ` David Howells
  2011-07-28 15:55 ` [PATCH 38/40] UAPI: Fix the page-types query program in the docs " David Howells
                   ` (2 subsequent siblings)
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:55 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

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

Signed-off-by: David Howells <dhowells@redhat.com>
---

 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index b307524..2afffa9 100644
--- a/Makefile
+++ b/Makefile
@@ -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
 
 # ---------------------------------------------------------------------------


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

* [PATCH 38/40] UAPI: Fix the page-types query program in the docs [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (36 preceding siblings ...)
  2011-07-28 15:55 ` [PATCH 37/40] UAPI: Make UAPI headers install to usr/include/ " David Howells
@ 2011-07-28 15:55 ` David Howells
  2011-07-28 15:55 ` [PATCH 39/40] UAPI: Fix the x86 test_get_len tool " David Howells
  2011-07-28 15:55 ` [PATCH 40/40] UAPI: Scripts to disintegrate header files " David Howells
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:55 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 Documentation/vm/page-types.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
index 7445caa..8d6a54f 100644
--- a/Documentation/vm/page-types.c
+++ b/Documentation/vm/page-types.c
@@ -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


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

* [PATCH 39/40] UAPI: Fix the x86 test_get_len tool [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (37 preceding siblings ...)
  2011-07-28 15:55 ` [PATCH 38/40] UAPI: Fix the page-types query program in the docs " David Howells
@ 2011-07-28 15:55 ` David Howells
  2011-07-28 15:55 ` [PATCH 40/40] UAPI: Scripts to disintegrate header files " David Howells
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:55 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, David Howells

Fix the x86 test_get_len tool to have the right include paths in the right
order (it includes a non-exported kernel header directly), otherwise errors
like the following occur:

/data/fs/linux-2.6-hdr/include/linux/types.h:18:26: error: conflicting types for 'fd_set'
/usr/include/sys/select.h:78:5: note: previous declaration of 'fd_set' was here

and

/data/fs/linux-2.6-hdr/include/linux/string.h:42:12: error: expected identifier or '(' before '__extension__'

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/x86/tools/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile
index f820826..69c3017 100644
--- a/arch/x86/tools/Makefile
+++ b/arch/x86/tools/Makefile
@@ -24,7 +24,7 @@ posttest: $(obj)/test_get_len vmlinux
 hostprogs-y	:= test_get_len
 
 # -I needed for generated C source and C source which in the kernel tree.
-HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/
+HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/uapi/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/uapi/
 
 # Dependencies are also needed.
 $(obj)/test_get_len.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c


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

* [PATCH 40/40] UAPI: Scripts to disintegrate header files [ver #3]
  2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
                   ` (38 preceding siblings ...)
  2011-07-28 15:55 ` [PATCH 39/40] UAPI: Fix the x86 test_get_len tool " David Howells
@ 2011-07-28 15:55 ` David Howells
  39 siblings, 0 replies; 41+ messages in thread
From: David Howells @ 2011-07-28 15:55 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, 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-disintegration/disintegrate-to-git-by-dir.pl
	scripts/uapi-disintegration/disintegrate-to-stg-by-dir.pl

to achieve the disintegration.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 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

diff --git a/scripts/uapi-disintegration/disintegrate-1-stg.sh b/scripts/uapi-disintegration/disintegrate-1-stg.sh
new file mode 100755
index 0000000..4cb17ad
--- /dev/null
+++ b/scripts/uapi-disintegration/disintegrate-1-stg.sh
@@ -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 <dhowells@redhat.com>" || 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 $?
diff --git a/scripts/uapi-disintegration/disintegrate-many-stg.sh b/scripts/uapi-disintegration/disintegrate-many-stg.sh
new file mode 100755
index 0000000..674d7c2
--- /dev/null
+++ b/scripts/uapi-disintegration/disintegrate-many-stg.sh
@@ -0,0 +1,63 @@
+#!/bin/sh -x
+
+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 $?
+
+# function set_up_uapi_dir () {
+#     if [ -d $1 ]
+#     then
+# 	rm -r $1 || exit $?
+#     fi
+#     mkdir -p $1 || exit $?
+# }
+# set_up_uapi_dir $UAPI/linux
+# set_up_uapi_dir arch/mn10300/$UAPI/asm
+
+{
+    ./disintegrate/uapi/genlist.pl
+    #grep -rIl __KERNEL__ include/linux/[ab]*.h
+    #echo include/linux/acct.h
+    #echo include/linux/const.h
+    #echo arch/mn10300/include/asm/ioctl.h
+    #echo include/linux/types.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 $?
+    stg new uapi-$pn.diff -m "UAPI: Disintegrate $f
+
+Signed-off-by: David Howells <dhowells@redhat.com>" || exit $?
+    if [ -r $a ]
+    then
+	stg add $a || exit $?
+    fi
+    if [ ! -r $f ]
+    then
+	stg rm $f || exit $?
+    fi
+    stg ref || exit $?
+done
diff --git a/scripts/uapi-disintegration/disintegrate-one.pl b/scripts/uapi-disintegration/disintegrate-one.pl
new file mode 100755
index 0000000..96f42a3
--- /dev/null
+++ b/scripts/uapi-disintegration/disintegrate-one.pl
@@ -0,0 +1,1036 @@
+#!/usr/bin/perl -w
+#
+# Disintegrate a file to extract out the userspace API bits into their own file
+# in a separate directory.  The original file retains the residue.
+#
+# The original file is given a #include to refer to the UAPI file, and both
+# headers will get guards, unless one of them is simply turned into a
+# #include.
+#
+# Call as: disintegrate-one.pl <orig_header_file> <uapi_header_file>
+#
+
+use File::Path;
+use strict;
+
+sub reduce_file(@);
+
+# Don't put a "don't include this in asm" notice in the following files
+my %asm_includeable_linux_files = (
+    "include/linux/const.h"		=> 1,
+    "include/linux/elf-em.h"		=> 1,
+    "include/linux/errno.h"		=> 1,
+    "include/linux/serial_reg.h"	=> 1,
+    );
+
+die if ($#ARGV != 1);
+my $linuxhdr = $ARGV[0];
+my $uapihdr = $ARGV[1];
+
+#
+# The UAPI header file is called the same as the Linux header file as far as
+# cpp is concerned - the latter just #include's the former, and if the latter
+# doesn't exist, the former is used directly.
+#
+my $inchdr = $linuxhdr;
+$inchdr =~ s@.*include/@@;
+
+#
+# Read the entire Linux header file into an array of lines.
+#
+open(FD, '<', $linuxhdr) or die $linuxhdr, ": $!\n";
+my @lines = <FD> or die $linuxhdr, ": $!\n";
+close(FD) or die $linuxhdr, ": $!\n";
+
+my @kernellines = ();
+my @uapilines = ();
+
+#
+# If the entire file is just a single #include, then don't change it
+#
+# We do want to create the API file _if_ the included file is an API file
+#
+if ($#lines == 0 && $lines[0] =~ /^#\s*include\s+<([^>]+)>/) {
+    @kernellines = "#include <uapi/$1>\n";
+    @uapilines = @lines;
+    goto output;
+}
+
+goto output if ($#lines == -1);
+
+#
+# Attempt to disintegrate the file
+# - The initial banner comment gets duplicated if there is one
+# - The reinclusion guard is duplicated and modified for the API file
+# - non-__KERNEL__ lines get put into the API file
+#
+
+my $nr_blocks = 0;
+sub new_block($$$$)
+{
+    my ($type, $l, $parent, $prev) = @_;
+    my %block = (
+	type		=> $type,	# n = normal block, c = conditional block
+	l		=> $l + 1,
+	next_block	=> undef,
+	prev_block	=> $prev,
+	nr		=> ++$nr_blocks,
+	parent		=> $parent,
+    );
+    $block{lines} = [] if ($type eq "n");
+    $block{kernel_mark} = 0 if ($type ne "n");
+    $prev->{next_block} = \%block if ($prev);
+    return \%block;
+}
+
+#
+# First of all, build a tree of normal blocks and conditionals
+#
+my $first_block = new_block("n", 0, undef, undef);
+my $conditional_tree = $first_block;
+my $cur_body = $first_block;
+my $specified_include_point = 0;
+
+my @conditional_stack = ();
+my @body_stack = ( $first_block );
+
+my $l = 0;
+
+if ($lines[$l] =~ m@^/[*]@) {
+    my @buffer = ();
+    for (; $l <= $#lines; $l++) {
+	if ($lines[$l] =~ "(.*)[*]/(.*)") {
+	    push @buffer, "$1*/\n";
+	    $lines[$l] = $2;
+	    $l++;
+	    goto got_banner_comment;
+	}
+	push @buffer, $lines[$l];
+    }
+  got_banner_comment:
+    $first_block->{lines} = \@buffer;
+    $first_block->{banner} = 1;
+    $first_block->{next_block} = new_block("n", $l, undef, $first_block);
+    $cur_body = $first_block->{next_block};
+    $body_stack[0] = $cur_body;
+}
+
+for (; $l <= $#lines; $l++) {
+    my $line = $lines[$l];
+    my @buffer = ( $line );
+
+    # parse out the actual CPP directive
+    # - this may be split over multiple lines using backslashes and comments
+    #   that have embedded newlines
+    my $cpp = $line;
+  restart:
+    $cpp =~ s@\s+$@@g;
+    $cpp =~ s@\s+@ @g;
+
+    while ($cpp =~ m@(/[*])@) {
+	my $o = index($cpp, "/*");
+	if ($cpp =~ m@([*]/)@) {
+	    my $c = index($cpp, "*/") + 2;
+	    substr($cpp, $o, $c - $o) = "";
+	} else {
+	    $l++;
+	    $cpp .= $lines[$l];
+	    push @buffer, $lines[$l];
+	    goto restart;
+	}
+    }
+
+    if ($cpp =~ /^(.*)[\\]$/) {
+	$l++;
+	$cpp = $1 . $lines[$l];
+	push @buffer, $lines[$l];
+	goto restart;
+    }
+
+    $cpp =~ s@\s+$@@g;
+    $cpp =~ s@\s\s+@ @g;
+
+    if ($cpp eq "// DISINTEGRATE: INCLUDE UAPI HERE") {
+	die if ($specified_include_point);
+
+	my $marker;
+	if ($#{$cur_body->{lines}} == -1) {
+	    $marker = $cur_body;
+	    $marker->{type} = "i";
+	    $marker->{include_point} = undef;
+	    delete $marker->{lines};
+	} else {
+	    my $marker = new_block("i", $l, $cur_body->{parent}, $cur_body);
+	    $cur_body = $marker;
+	    $body_stack[$#body_stack] = $marker;
+	}
+	die if ($marker->{lines});
+
+	my $body_block = new_block("n", $l + 1, $cur_body->{parent}, $cur_body);
+	$body_stack[$#body_stack] = $body_block;
+	$cur_body = $body_block;
+	$specified_include_point = 1;
+	next;
+    }
+
+    my $retain_next = 0;
+    if ($line =~ "(.*) // DISINTEGRATE: RETAIN\n") {
+	$line = "$1\n";
+	$retain_next = 1;
+    }
+
+    if ($line =~ /^#/) {
+	#print "r:\e[36m", $cpp, "\e[m@@@ $l\n";
+
+	# handle conditional macros
+	if ($cpp =~ /^#\s*if/) {
+	    #print "#if ", $#conditional_stack + 1, ": ", $#body_stack + 1, "\n";
+	    my $cond_block = new_block("c", $l, $cur_body->{parent}, $cur_body);
+	    $cond_block->{clauses} = [];	# #if..#elif..#elif..#else..#endif
+	    $cond_block->{retain} = 1 if ($retain_next == 1);
+	    push @conditional_stack, $cond_block;
+
+	    my $clause = new_block("if", $l, $cond_block, undef);
+	    $clause->{cpp} = $cpp;
+	    push @{$clause->{lines}}, @buffer;
+	    push @{$cond_block->{clauses}}, $clause;
+
+	    my $body_block = new_block("n", $l + 1, $clause, undef);
+	    $clause->{body} = $body_block;
+
+	    $cur_body->{next_block} = $cond_block;
+	    $body_stack[$#body_stack] = $cond_block;
+	    push @body_stack, $body_block;
+
+	    $cur_body = $body_block;
+
+	    die ("Unexpected body types '",
+		 join("", map {$_->{type};} @body_stack),
+		 "' after #if\n")
+		if ($body_stack[$#body_stack]->{type} ne "n" ||
+		    $body_stack[$#body_stack - 1]->{type} ne "c");
+
+	    if ($#conditional_stack == 0 &&
+		$cpp =~ /^#\s*ifndef\s+([_A-Za-z0-9]+)/) {
+		# keep an eye open for a guard's #define or an include-order check's #error
+		my $macro = $1;
+		$cur_body->{check_first_line} = $macro
+		    if ($macro ne "__KERNEL__" && $macro !~ /^CONFIG_/);
+	    }
+	    next;
+	}
+
+	my $cond_block = $conditional_stack[$#conditional_stack];
+	my $cur_clause = $cond_block->{clauses}->[$#{$cond_block->{clauses}}];
+
+	if ($cpp =~ /^#\s*elif/) {
+	    die if ($#conditional_stack < 0);
+	    die if (exists $cond_block->{has_else});
+
+	    my $clause = new_block("elif", $l, $cond_block, $cur_clause);
+	    $clause->{cpp} = $cpp;
+	    push @{$clause->{lines}}, @buffer;
+	    push @{$cond_block->{clauses}}, $clause;
+
+	    my $body_block = new_block("n", $l + 1, $clause, undef);
+	    $clause->{body} = $body_block;
+
+	    $body_stack[$#body_stack] = $body_block;
+	    $cur_body = $body_block;
+	    next;
+	}
+
+	if ($cpp =~ /^#\s*else/) {
+	    #print "#else ", $#conditional_stack + 1, ": ", $#body_stack + 1, "\n";
+	    die if ($#conditional_stack < 0);
+	    die if (exists $cond_block->{has_else});
+	    $cond_block->{has_else} = 1;
+
+	    my $clause = new_block("else", $l, $cond_block, $cur_clause);
+	    push @{$clause->{lines}}, @buffer;
+	    push @{$cond_block->{clauses}}, $clause;
+
+	    my $body_block = new_block("n", $l + 1, $clause, undef);
+	    $clause->{body} = $body_block;
+
+	    $body_stack[$#body_stack] = $body_block;
+	    $cur_body = $body_block;
+	    next;
+	}
+
+	if ($cpp =~ /^#\s*endif/) {
+	    #print "#endif ", $#conditional_stack + 1, ": ", $#body_stack + 1, "\n";
+	    die if ($#conditional_stack < 0);
+
+	    my $clause = new_block("endif", $l, $cond_block, $cur_clause);
+	    push @{$clause->{lines}}, @buffer;
+	    push @{$cond_block->{clauses}}, $clause;
+
+	    pop @conditional_stack;
+	    pop @body_stack;
+	    $cur_body = $body_stack[$#body_stack];
+
+	    my $body_block = new_block("n", $l + 1, $cur_body->{parent}, $cur_body);
+
+	    die "Unexpected body type '", $cur_body->{type}, "' at #endif\n"
+		if ($cur_body->{type} ne "c");
+
+	    $body_stack[$#body_stack] = $body_block;
+	    $cur_body = $body_block;
+	    next;
+	}
+
+	if (($cpp =~ /^#\s*define\s+([_A-Za-z0-9]+)$/ ||
+	     $cpp =~ /^#\s*define\s+([_A-Za-z0-9]+)\s+1$/) &&
+	    exists $cur_body->{check_first_line}
+	    ) {
+	    my $macro = $1;
+	    #print "GUARD $macro\n";
+	    if ($macro eq $cur_body->{check_first_line}) {
+		$cond_block->{guard_label} = $cur_body->{check_first_line};
+		$cur_clause->{guard} = \@buffer;
+		delete $cur_body->{check_first_line};
+		next;
+	    }
+	}
+
+	if ($cpp =~ /^#\s*error/ &&
+	    exists $cur_body->{check_first_line}
+	    ) {
+	    delete $cur_body->{check_first_line};
+	    $cur_clause->{order_check} = \@buffer;
+	    next;
+	}
+    }
+
+    delete $cur_body->{check_first_line} if (exists $cur_body->{check_first_line});
+    push @{$cur_body->{lines}}, @buffer;
+}
+
+die "Conditional level mismatch (", $#conditional_stack, ")\n"
+    if ($#conditional_stack != -1);
+die "Body level mismatch (", $#body_stack, ")\n"
+    if ($#body_stack != 0);
+
+###############################################################################
+#
+# Dump the parse tree
+#
+###############################################################################
+sub dump_tree(@);
+sub dump_tree(@)
+{
+    my $root = $#_ >= 0 ? $_[0] : $first_block;
+    my $level = $#_ >= 1 ? $_[1] : 0;
+
+    for (my $block = $root; $block; $block = $block->{next_block}) {
+	my $l = $block->{l};
+	my $nr = $block->{nr};
+	my $lines = $block->{lines};
+	print " " x $level;
+	if ($block->{type} eq "n") {
+	    if ($#{$lines} < 0) {
+		print '- Empty (line ', $l, " nr ", $nr, ")\n";
+	    } elsif ($#{$lines} == 0) {
+		print '- Body (line ', $l, " nr ", $nr, ")\n";
+	    } else {
+		print '- Body (lines ', $l, "-", $l + $#{$lines} + 1, " nr ", $nr, ")";
+		print " BANNER" if (exists $block->{banner});
+		print "\n";
+	    }
+	    #print map {"\t\t\t>" . $_; } @{$block->{lines}} if (exists $block->{lines});
+	} elsif ($block->{type} eq "i") {
+		print '- UAPI Inclusion (line ', $l, " nr ", $nr, ")\n";
+	} elsif ($block->{type} eq "c") {
+	    my $clauses = $block->{clauses};
+	    die "Must be at least 2 clauses\n" if ($#{$clauses} < 1);
+	    print '@ Cond (line ', $l, " nr ", $nr, ") ", $#{$clauses}, " clauses";
+	    if (exists $block->{kernel_mark}) {
+		print " KO" if ($block->{kernel_mark} & 1);
+		print " UO" if ($block->{kernel_mark} & 2);
+		print " IK" if ($block->{kernel_mark} & 4);
+		print " IU" if ($block->{kernel_mark} & 8);
+		print " GUARD" if (exists $block->{guard});
+		print " ORDER_CHECK" if (exists $block->{order_check});
+		print " RETAIN" if (exists $block->{retain});
+	    }
+	    print "\n";
+	    foreach my $clause (@{$clauses}) {
+		my $nr = $clause->{nr};
+		print " " x ($level + 1);
+		print "#", $clause->{type}, " nr ", $nr;
+		if (exists $clause->{kernel_mark}) {
+		    print " KO" if ($clause->{kernel_mark} & 1);
+		    print " UO" if ($clause->{kernel_mark} & 2);
+		    print " IK" if ($clause->{kernel_mark} & 4);
+		    print " IU" if ($clause->{kernel_mark} & 8);
+		}
+		print "\n";
+		#print map {"\t\t\t>" . $_; } @{$clause->{lines}} if (exists $clause->{lines});
+		dump_tree($clause->{body}, $level + 2);
+	    }
+	} else {
+	    die;
+	}
+    }
+}
+
+###############################################################################
+#
+# Validate the parse tree structure
+#
+###############################################################################
+sub validate_tree(@);
+sub validate_tree(@)
+{
+    my ($parent, $body) = @_;
+
+    if ($#_ == -1) {
+	$parent = undef;
+	$body = $first_block;
+    }
+
+    my $previous = undef;
+
+    #print "-->validate_tree(", $parent ? $parent->{nr} : "-", ",", $body->{nr}, ")\n";
+
+    for (my $block = $body; $block; $previous = $block, $block = $block->{next_block}) {
+	my $nr = $block->{nr};
+
+	die $nr, ": Unset parent\n" unless (exists $block->{parent});
+	if (!$parent) {
+	    die $nr, ": Unexpected parent\n" if ($block->{parent});
+	} else {
+	    die $nr, ": Missing parent\n" if (!$block->{parent});
+	    die $nr, ": Incorrect parent", $block->{parent}->{nr}, "!=", $parent->{nr}, "\n"
+		unless ($block->{parent} == $parent);
+	}
+
+	if ($previous) {
+	    die($nr, ": Incorrect prev_block ",  $block->{prev_block}->{nr},
+		" not ", $previous->{nr}, "\n")
+		unless ($block->{prev_block} == $previous);
+	} else {
+	    die $nr, ": Unexpected prev_block ", $block->{prev_block}->{nr}, "\n"
+		if ($block->{prev_block});
+	}
+
+
+	if ($block->{type} eq "n") {
+	    die $nr, ": Missing line array\n" unless (exists $block->{lines});
+	    die $nr, ": Unexpected __KERNEL__ mark\n" if (exists $block->{kernel_mark});
+	    die $nr, ": Unexpected guard\n" if (exists $block->{guard});
+	    die $nr, ": Unexpected order check\n" if (exists $block->{order_check});
+
+	} elsif ($block->{type} eq "i") {
+	    die $nr, ": Unexpected line array\n" if (exists $block->{lines});
+	    die $nr, ": Unexpected guard\n" if (exists $block->{guard});
+	    die $nr, ": Unexpected order check\n" if (exists $block->{order_check});
+
+	} elsif ($block->{type} eq "c") {
+	    die $nr, ": Unexpected line array\n" if (exists $block->{lines});
+	    die $nr, ": Missing clause array\n" unless (exists $block->{clauses});
+
+	    my $clauses = $block->{clauses};
+	    my $nc = $#{$clauses};
+	    die $nr, ": Must be at least 2 clauses\n" if ($nc < 1);
+
+	    die $nr, ": Missing #if clause\n" if ($clauses->[0]->{type} ne "if");
+	    die $nr, ": Missing #endif clause\n" if ($clauses->[$nc]->{type} ne "endif");
+	    if ($nc >= 2) {
+		for (my $i = 1; $i < $nc - 1; $i++) {
+		    my $j = $clauses->[$i]->{nr};
+		    die $nr, ": Missing #elif clause [$j]\n"
+			if ($clauses->[$i]->{type} ne "elif");
+		}
+
+		my $j = $clauses->[$nc - 1]->{nr};
+		die $nr, ": Missing #elif/#else clause [$j]\n"
+		    if ($clauses->[$nc - 1]->{type} ne "elif" &&
+			$clauses->[$nc - 1]->{type} ne "else");
+	    }
+
+	    foreach my $clause (@{$clauses}) {
+		my $j = $clause->{nr};
+
+		die "$j: Clause missing parent\n" unless ($clause->{parent});
+		die "$j: Clause has wrong parent: ", $clause->{parent}->{nr}, "\n"
+		    unless ($clause->{parent} == $block);
+		die "$j: Unexpected body in #endif: ", $clause->{body}->{nr}, "\n"
+		    if ($clause->{type} eq "endif" && exists $clause->{body});
+		die "$j: Missing clause line array\n" unless (exists $clause->{lines});
+
+		validate_tree($clause, $clause->{body}) if (exists $clause->{body});
+	    }
+	} else {
+	    die "$nr: Invalid block type: '", $block->{type}, "'\n";
+	}
+    }
+
+    #print "<--validate_tree()\n";
+}
+
+validate_tree();
+#dump_tree(); exit 123;
+
+###############################################################################
+#
+# Eliminate empty bodies from the tree
+#
+###############################################################################
+sub discard_empties($);
+sub discard_empties($)
+{
+    my ($block) = @_;
+
+    while ($block) {
+	die unless exists $block->{type};
+	if ($block->{type} eq "n") {
+	    if ($#{$block->{lines}} < 0) {
+		#print "EMPTY: ", $block->{nr};
+		my $parent = $block->{parent};
+		my $prev = $block->{prev_block};
+		my $next = $block->{next_block};
+		delete $block->{type};
+
+		if ($next) {
+		    #print " next";
+		    die if ($next->{prev_block} != $block);
+		    $next->{prev_block} = $prev;
+		}
+
+		if ($prev) {
+		    #print " prev";
+		    die if ($prev->{next_block} != $block);
+		    $prev->{next_block} = $next;
+		} else {
+		    if ($parent) {
+			#print " parent(", $parent->{nr}, ")";
+			die unless ($parent->{body} == $block);
+			$parent->{body} = $next;
+		    } else {
+			#print " root";
+			die "Mismatch ", $first_block->{nr}, " != ", $block->{nr}, "\n"
+			    if ($first_block != $block);
+			$first_block = $next;
+		    }
+		}
+		die if ($next && $block == $next);
+		$block = $next;
+		#print "\n";
+		next;
+	    } else {
+		$block = $block->{next_block};
+		next;
+	    }
+	} elsif ($block->{type} eq "i") {
+	    ;
+	} elsif ($block->{type} eq "c") {
+	    my $clauses = $block->{clauses};
+	    die "Must be at least 2 clauses\n" if ($#{$clauses} < 1);
+	    foreach my $clause (@{$clauses}) {
+		discard_empties($clause->{body});
+	    }
+	} else {
+	    die;
+	}
+
+	$block = $block->{next_block};
+	next;
+    }
+}
+
+discard_empties($first_block);
+validate_tree();
+
+###############################################################################
+#
+# Mark up single variable only __KERNEL__ conditions and percolate marks up the
+# tree.
+#
+###############################################################################
+sub mark__KERNEL__($);
+sub mark__KERNEL__($)
+{
+    my ($first) = @_;
+    my $combined_kernel_mark = 0;
+
+    for (my $block = $_[0]; $block; $block = $block->{next_block}) {
+	next if ($block->{type} ne "c");
+
+	my $clauses = $block->{clauses};
+	my $cpp = $clauses->[0]->{cpp};
+
+	my $kernel_mark = 0;
+
+	if ($block->{retain}) {
+	    ;
+	} elsif ($cpp =~ /^#\s*ifdef\s+__KERNEL__/ ||
+	    ($cpp =~ /^#\s*if\s+defined\s*\(\s*__KERNEL__\s*\)/ &&
+	     $cpp !~ /[|][|]|[&][&]/)) {
+	    $kernel_mark |= 1 | 4;
+	} elsif ($cpp =~ /^#\s*ifndef\s+__KERNEL__/ ||
+		 ($cpp =~ /^#\s*if\s+!\s*defined\s*\(\s*__KERNEL__\s*\)/ &&
+		  $cpp !~ /[|][|]|[&][&]/)) {
+	    $kernel_mark |= 2 | 8;
+	}
+
+	if ($kernel_mark) {
+	    $clauses->[0]->{kernel_mark} = $kernel_mark;
+	    if ($#{$clauses} > 1) {
+		die $linuxhdr, ":", $clauses->[1]->{l}, ": __KERNEL__ guard has #elif clause\n"
+		    if ($#{$clauses} > 2 || $clauses->[1]->{type} eq "elif");
+		$clauses->[1]->{kernel_mark} = $kernel_mark ^ 15;
+		$kernel_mark = 15;
+		$clauses->[2]->{kernel_mark} = $kernel_mark;
+	    } else {
+		$clauses->[1]->{kernel_mark} = $kernel_mark;
+	    }
+	}
+
+	foreach my $clause (@{$clauses}) {
+	    die $linuxhdr, ":", $clause->{l}, ": #elif contains __KERNEL__\n"
+		if ($clause->{type} eq "elif" && $clause->{cpp} =~ /__KERNEL__/);
+
+	    if (exists $clause->{body}) {
+		my $k = mark__KERNEL__($clause->{body});
+		if ($k) {
+		    die $linuxhdr, ":", $clause->{l}, ": Body contains nested __KERNEL__\n"
+			if ($kernel_mark & 3);
+		    $clause->{kernel_mark} |= $k | 8;
+		    $kernel_mark = $k | 8;
+		}
+	    }
+	}
+
+	$block->{kernel_mark} = $kernel_mark;
+
+	$combined_kernel_mark |= $kernel_mark;
+    }
+
+    return $combined_kernel_mark & (4 | 8);
+}
+
+mark__KERNEL__($first_block);
+validate_tree();
+#dump_tree(); exit 123;
+
+###############################################################################
+#
+# Determine reinclusion guards and validate inclusion order checks that are
+# outside the guards
+#
+###############################################################################
+sub determine_guards()
+{
+    for (my $block = $first_block; $block; $block = $block->{next_block}) {
+	next if ($block->{type} ne "c");
+
+	if ($block->{clauses}->[0]->{guard}) {
+	    $block->{guard} = 1;
+	    $block->{kernel_mark} = 8;
+	    die unless (exists $block->{guard_label});
+	} elsif ($block->{clauses}->[0]->{order_check}) {
+	    $block->{order_check} = 1;
+	    $block->{kernel_mark} = 8;
+	    die $linuxhdr, ":", $block->{l}, ": Inclusion order check with multiple clauses\n"
+		unless ($#{$block->{clauses}} == 1);
+	    die $linuxhdr, ":", $block->{l}, ": Inclusion order check with extra body\n"
+		if ($block->{clauses}->[0]->{body});
+	}
+    }
+}
+
+determine_guards();
+#dump_tree();
+validate_tree();
+
+###############################################################################
+#
+# Render the two header files
+#
+###############################################################################
+my $include_uapi_at = -1;
+
+sub render(@);
+sub render(@)
+{
+    my $root = $#_ >= 0 ? $_[0] : $first_block;
+    my $parent_kernel_mark = $#_ >= 1 ? $_[1] : 8;
+
+    for (my $block = $root; $block; $block = $block->{next_block}) {
+	my $kernel_mark = $parent_kernel_mark;
+
+	#push @kernellines, "KM$kernel_mark\n";
+
+	if ($block->{type} eq "n") {
+	    my $is_banner = exists $block->{banner};
+	    my $lines = $block->{lines};
+	    push @kernellines, @{$lines} if ($is_banner || !($kernel_mark & 8));
+	    push @uapilines, @{$lines} if ($is_banner || $kernel_mark & 8);
+	    next;
+	}
+
+	if ($block->{type} eq "i") {
+	    push @kernellines, "#include <uapi/$inchdr>\n";
+	    next;
+	}
+
+	if ($block->{type} eq "c") {
+	    my $clauses = $block->{clauses};
+
+	    if ($block->{order_check}) {
+		push(@uapilines,
+		     @{$clauses->[0]->{lines}},
+		     @{$clauses->[0]->{order_check}},
+		     @{$clauses->[1]->{lines}});
+		next;
+	    }
+
+	    if ($block->{guard}) {
+		push(@kernellines,
+		     @{$clauses->[0]->{lines}},
+		     @{$clauses->[0]->{guard}});
+		push @kernellines, "\n";
+
+		if ($linuxhdr =~ m!^include/! &&
+		    $linuxhdr !~ m@^include/asm-generic/@ &&
+		    !exists($asm_includeable_linux_files{$linuxhdr})) {
+		    push @kernellines, "#ifdef __ASSEMBLY__\n";
+		    push @kernellines, "#error include/linux headers may not be included in .S files\n";
+		    push @kernellines, "#endif\n";
+		    push @kernellines, "\n";
+		}
+
+		push @kernellines, "#define __EXPORTED_HEADERS__\n"
+		    if ($linuxhdr eq "include/linux/types.h");
+
+		unless ($specified_include_point) {
+		    push @kernellines, "#include <uapi/$inchdr>\n";
+		    $include_uapi_at = $#kernellines;
+		    push @kernellines, "\n";
+		}
+
+		push(@uapilines,
+		     "#ifndef _UAPI" . $block->{guard_label} . "\n",
+		     "#define _UAPI" . $block->{guard_label} . "\n");
+
+		render($block->{clauses}->[0]->{body}, $kernel_mark);
+		push(@kernellines,
+		     @{$clauses->[1]->{lines}});
+		push(@uapilines,
+		     "#endif /* _UAPI" . $block->{guard_label} . " */\n");
+		next;
+	    }
+
+	    $kernel_mark = $block->{kernel_mark} if ($block->{kernel_mark});
+
+	    if (($kernel_mark & 3) == 0) {
+		# no mention of __KERNEL__ only
+		foreach my $clause (@{$clauses}) {
+		    my $lines = $clause->{lines};
+
+		    push @kernellines, @{$clause->{lines}} if ($kernel_mark & 4);
+		    push @uapilines, @{$clause->{lines}} if ($kernel_mark & 8);
+		    render($clause->{body}, $kernel_mark)
+			if (exists $clause->{body});
+		}
+	    } elsif (($kernel_mark & 3) == 1) {
+		# #ifdef __KERNEL__
+		render($block->{clauses}->[0]->{body}, 4);
+	    } elsif (($kernel_mark & 3) == 2) {
+		# #ifndef __KERNEL__
+		push @uapilines, @{$block->{clauses}->[0]->{lines}};
+		render($block->{clauses}->[0]->{body}, 8);
+		push @uapilines, @{$block->{clauses}->[1]->{lines}};
+	    } else {
+		if ($block->{clauses}->[0]->{kernel_mark} & 1) {
+		    # #ifdef __KERNEL__ ... #else
+		    render($block->{clauses}->[0]->{body}, 4);
+
+		    my @iflines = @{$block->{clauses}->[0]->{lines}};
+		    $iflines[0] =~ s/#(\s*if)def/#$1ndef/;
+		    $iflines[0] =~ s/#(\s*if\s+)defined/#$1!defined/;
+		    push @uapilines, @iflines;
+		    render($block->{clauses}->[1]->{body}, 8);
+		    push @uapilines, @{$block->{clauses}->[2]->{lines}};
+		} else {
+		    # #ifndef __KERNEL__ ... #else
+		    render($block->{clauses}->[1]->{body}, 4);
+
+		    push @uapilines, @{$block->{clauses}->[0]->{lines}};
+		    render($block->{clauses}->[0]->{body}, 8);
+		    push @uapilines, @{$block->{clauses}->[2]->{lines}};
+		}
+	    }
+	}
+    }
+}
+
+render();
+
+###############################################################################
+#
+# See if a file actually has anything left in it after all the blank lines,
+# comments and CPP conditionals and inclusions are removed.
+#
+# Returns:
+#  0: non-reducible
+#  1: reducible to nothing
+#  2: reducible to a single #include
+#  3: reducible to a multiple #includes
+#
+###############################################################################
+sub reduce_file(@)
+{
+    my (@lines) = @_;
+
+    my $blocks = 0;
+    my $level = 0;
+    my $guarded = 0;
+    my $guardname = "";
+    my $guarddefline = -2;
+    my $first_if = 1;
+    my $includes = 0;
+
+    for (my $l = 0; $l <= $#lines; $l++) {
+	my $line = $lines[$l];
+	my $suppress = 0;
+
+	# parse out the blocks
+	# - this may be split over multiple lines using backslashes and comments
+	#   that have embedded newlines
+	my $block = $line;
+      restart:
+	$block =~ s@\s+$@@g;
+	$block =~ s@\s+@ @g;
+
+	while ($block =~ m@(/[*])@) {
+	    my $o = index($block, "/*");
+	    if ($block =~ m@([*]/)@) {
+		my $c = index($block, "*/") + 2;
+		substr($block, $o, $c - $o) = "";
+	    } else {
+		$l++;
+		$block .= $lines[$l];
+		#push @buffer, $lines[$l];
+		goto restart;
+	    }
+	}
+
+	if ($block =~ /^(.*)[\\]$/) {
+	    $l++;
+	    $block = $1 . $lines[$l];
+	    #push @buffer, $lines[$l];
+	    goto restart;
+	}
+
+	$block =~ s@\s+$@@g;
+	$block =~ s@\s\s+@ @g;
+
+	if ($line =~ /^#/) {
+	    # handle conditional macros
+	    if ($block =~ /^#\s*if/) {
+		$level++;
+		if ($block =~ /^#\s*ifndef\s+([_A-Za-z0-9]+)/ && $first_if == 1) {
+		    $guardname = $1;
+		    $guarddefline = $l + 1;
+		    $first_if = 0;
+		    next;
+		}
+
+		$first_if = 0;
+	    } elsif ($block =~ /^#\s*endif/) {
+		$level--;
+		next;
+	    } elsif ($block =~ /^#\s*else/) {
+		next;
+	    } elsif ($block =~ /^#\s*elif/) {
+		next;
+	    } elsif ($l == $guarddefline && $block =~ /^#\s*define\s+$guardname/) {
+		next;
+	    } elsif ($block =~ m@^#\s*include <uapi/@) {
+		next;
+	    } elsif ($block =~ /^#\s*include/) {
+		$includes++;
+		next;
+	    } elsif ($block =~ /^#error only arch headers may be included in asm/) {
+		next;
+	    }
+ 
+	} elsif ($block eq "") {
+	    next;
+	}
+
+	#print "[", $block, "]\n";
+	$blocks++;
+    }
+
+    die $linuxhdr, ": #if/#endif level mismatch ($level)\n"
+	if ($level != 0);
+
+    return 0 if ($blocks > 0);
+    return 2 if ($includes == 1);
+    return 3 if ($includes > 0);
+    return 1;
+}
+
+###############################################################################
+#
+# Attempt to slide down the #include of the UAPI file to after the #include set
+# if it was added automatically (if it was manually specified, then we leave it
+# where it is).
+#
+###############################################################################
+sub slide_include_uapi()
+{
+    # first of all, locate the #include of the UAPI file
+    my $include_uapi = $kernellines[$include_uapi_at];
+    die if ($include_uapi !~ m@#include <uapi/@);
+
+    my $here = -1;
+    my $if_level = 0;
+    my $cond_include = 0;
+    for (my $l = $include_uapi_at + 1; $l <= $#kernellines; $l++) {
+	my $line = $kernellines[$l];
+	chomp $line;
+
+	if ($line eq "") {
+	} elsif ($line =~ /#\s*include\s+<([^>]*)>/) {
+	    last if ($1 eq "linux/byteorder/generic.h");
+	    if ($if_level == 0) {
+		$here = $l;
+	    } else {
+		$cond_include = 1;
+	    }
+	} elsif ($line =~ /#\s*if/) {
+	    $if_level++;
+	} elsif ($line =~ /#\s*else/) {
+	} elsif ($line =~ /#\s*elif/) {
+	} elsif ($line =~ /#\s*endif/) {
+	    $if_level--;
+	    if ($if_level == 0) {
+		$here = $l if ($cond_include);
+		$cond_include = 0;
+	    }
+	} else {
+	    last;
+	}
+    }
+
+    if ($here > -1) {
+	splice @kernellines, $include_uapi_at, 2;
+	splice @kernellines, $here - 1, 0, $include_uapi;
+	splice @kernellines, $here, 0, "\n" unless ($kernellines[$here] eq "\n");
+    }
+}
+
+slide_include_uapi() if ($include_uapi_at > -1);
+
+###############################################################################
+#
+#
+#
+###############################################################################
+output:
+    ;
+
+#print @kernellines;
+#print "_" x 79, "\n";
+#print @uapilines;
+
+my $kred = reduce_file(@kernellines);
+my $ured = reduce_file(@uapilines);
+
+#print "kred: ", $kred, "\n";
+#print "ured: ", $ured, "\n";
+#exit 123;
+
+if ($ured == 2) {
+    @uapilines = grep /^#\s*include/, @uapilines;
+} elsif ($ured == 1) {
+    @uapilines = ();
+}
+
+if ($kred == 1) {
+    # if all we're doing is #include'ing the UAPI header, then we may as well
+    # delete the file and let CPP include the UAPI header directly
+    @kernellines = ();
+    @uapilines = @lines;
+}
+
+my $uapidir = $uapihdr;
+$uapidir = $1 if ($uapidir =~ m!(.*)/!);
+mkpath($uapidir) if (! -d $uapidir);
+
+if ($#kernellines >= 0) {
+    # we must create a UAPI header, even if it is blank
+    open(FD, '>', $uapihdr) or die "$uapihdr: $!\n";
+    print FD @uapilines or die "$uapihdr: $!\n";
+    close FD or die "$uapihdr: $!\n";
+
+    my $linuxhdrorig = $linuxhdr . ".orig";
+    open(FD, '>', $linuxhdrorig) or die $linuxhdrorig, ": $!\n";
+    print FD @kernellines or die $linuxhdrorig, ": $!\n";
+    close FD or die $linuxhdrorig, ": $!\n";
+    rename $linuxhdrorig, $linuxhdr or die $linuxhdr, ": $!\n";
+} else {
+    rename $linuxhdr, $uapihdr or die $uapihdr, ": $!\n";
+}
+
+###############################################################################
+#
+# Add the file to the uapi Kbuild file
+#
+###############################################################################
+my $uapi_kbuild = $uapidir . "/Kbuild";
+
+die "$uapi_kbuild: Not found\n" unless (-f $uapi_kbuild);
+
+my $hdrname;
+$uapihdr =~ m@([^/]*)$@, $hdrname = $1;
+
+open(FD, '>>', $uapi_kbuild) or die "$uapi_kbuild: $!\n";
+
+if ($linuxhdr eq "include/linux/a.out.h" ||
+    $linuxhdr eq "include/linux/kvm.h" ||
+    $linuxhdr eq "include/linux/kvm_para.h"
+    ) {
+    print FD
+	"\n",
+	'ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/', $hdrname, " \\\n",
+	"\t\t", '  $(srctree)/include/asm-$(SRCARCH)/', $hdrname, " \\\n",
+	"\t\t", '  $(INSTALL_HDR_PATH)/include/asm-*/', $hdrname, "),)\n",
+	"header-y += ", $hdrname, "\n",
+	"endif\n\n"
+	or die "$uapi_kbuild: $!\n";
+} else {
+    print FD "header-y += $hdrname\n" or die "$uapi_kbuild: $!\n";
+}
+
+close FD or die "$uapi_kbuild: $!\n";
+
+
+###############################################################################
+#
+# Delete the file from the include/ Kbuild file
+#
+###############################################################################
+my $linuxdir;
+$linuxhdr =~ m@(.*)/[^/]*$@, $linuxdir = $1;
+my $linux_kbuild = $linuxdir . "/Kbuild";
+
+open(FD, '<', $linux_kbuild) or die $linux_kbuild, ": $!\n";
+my @kblines = <FD> or die $linux_kbuild, ": $!\n";
+close(FD) or die $linux_kbuild, ": $!\n";
+
+my $temp = $linux_kbuild . ".temp";
+open(FD, '>', $temp) or die "$temp: $!\n";
+foreach my $kbline (@kblines) {
+    if ($kbline =~ m@^header-y\s+[+]=\s+([a-zA-Z0-9_.-]+)@) {
+	next if ($1 eq $hdrname);
+    }
+    print FD $kbline or die "$temp: $!\n";
+}
+close FD or die "$temp: $!\n";
+rename $temp, $linux_kbuild or die "$temp -> $linux_kbuild: $!\n";
diff --git a/scripts/uapi-disintegration/disintegrate-to-git-by-dir.pl b/scripts/uapi-disintegration/disintegrate-to-git-by-dir.pl
new file mode 100755
index 0000000..aa4321c
--- /dev/null
+++ b/scripts/uapi-disintegration/disintegrate-to-git-by-dir.pl
@@ -0,0 +1,69 @@
+#!/usr/bin/perl -w
+#
+# Perform header disintegration of the user API, producing commits on a
+# dir-by-dir basis to GIT
+#
+
+use strict;
+use File::Basename;
+
+my $main_branch = "uapi-split";
+
+my $UAPI = "uapi";
+
+$ENV{UAPI} = "uapi";
+
+my $execdir = dirname($0);
+
+sub commit($@) {
+    my ($dirname, @files) = @_;
+
+    system("git commit -m 'UAPI: Disintegrate $dirname\n\nSigned-off-by: David Howells <dhowells\@redhat.com>\n' " . join(" ", @files)) == 0 or die;
+}
+
+###############################################################################
+#
+#
+#
+###############################################################################
+system("git checkout $main_branch") == 0 or die;
+
+my $curdir = "xxxxx";
+
+my @headerlist = sort {
+    dirname($a) cmp dirname($b) || $a cmp $b;
+} `$execdir/genlist.pl`;
+
+my @files = ();
+foreach my $origfile (@headerlist) {
+    chomp $origfile;
+    if (! -f $origfile) {
+	print "Skip $origfile\n";
+	next;
+    }
+
+    my $odir = dirname($origfile);
+
+    if ($odir ne $curdir) {
+	print "[]";
+
+	commit($curdir, @files) unless ($curdir eq "xxxxx");
+	$curdir = $odir;
+	@files = ();
+    }
+
+    print "$origfile\n";
+    my $uapifile = $origfile;
+    $uapifile =~ s@include/@include/$UAPI/@;
+    my $udir = dirname($uapifile);
+
+    system("$execdir/disintegrate-one.pl $origfile $uapifile") == 0 or die;
+
+    if (-r $uapifile) {
+	push @files, $uapifile;
+	system("git add $uapifile") == 0 or die;
+    }
+    push @files, "$udir/Kbuild", $origfile, "$odir/Kbuild";
+}
+
+commit($curdir, @files) unless ($curdir eq "xxxxx");
diff --git a/scripts/uapi-disintegration/disintegrate-to-git.pl b/scripts/uapi-disintegration/disintegrate-to-git.pl
new file mode 100755
index 0000000..a1a4a69
--- /dev/null
+++ b/scripts/uapi-disintegration/disintegrate-to-git.pl
@@ -0,0 +1,70 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Basename;
+
+my $main_branch = "uapi-split";
+
+my $UAPI = "uapi";
+
+$ENV{UAPI} = "uapi";
+
+my $execdir = dirname($0);
+
+###############################################################################
+#
+#
+#
+###############################################################################
+system("git checkout $main_branch") == 0 or die;
+
+my $curdir = "xxxxx";
+my %branches = ();
+
+my @headerlist = sort {
+    dirname($a) cmp dirname($b) || $a cmp $b;
+} `$execdir/genlist.pl`;
+
+foreach my $origfile (@headerlist) {
+    chomp $origfile;
+    if (! -f $origfile) {
+	print "Skip $origfile\n";
+	next;
+    }
+
+    my $odir = dirname($origfile);
+
+    if ($odir ne $curdir) {
+	print "[]";
+	my $br = $odir;
+	$br =~ s@[/-]@__@g;
+
+	system("git checkout $main_branch") == 0 or die;
+	if (! exists($branches{$br})) {
+	    system("git branch $br") == 0 or die;
+	    $branches{$br} = 1;
+	}
+	system("git checkout $br") == 0 or die;
+	$curdir = $odir;
+    }
+
+    print "$origfile\n";
+    my $uapifile = $origfile;
+    $uapifile =~ s@include/include/@$UAPI/@;
+    my $udir = dirname($uapifile);
+
+    system("$execdir/disintegrate-one.pl $origfile $uapifile") == 0 or die;
+
+    my @files = ();
+    if (-r $uapifile) {
+	push @files, $uapifile;
+	system("git add $uapifile") == 0 or die;
+    }
+    push @files, "$udir/Kbuild", $origfile, "$odir/Kbuild";
+
+    system("git commit -m 'UAPI: Disintegrate $origfile\n\nSigned-off-by: David Howells <dhowells\@redhat.com>\n' " . join(" ", @files)) == 0 or die;
+}
+
+system("git checkout $main_branch") == 0 or die;
+system("git merge " . join(" ", keys %branches)) == 0 or die;
+system("git branch -d " . join(" ", keys %branches)) == 0 or die;
diff --git a/scripts/uapi-disintegration/disintegrate-to-stg-by-dir.pl b/scripts/uapi-disintegration/disintegrate-to-stg-by-dir.pl
new file mode 100755
index 0000000..fc2e2ae
--- /dev/null
+++ b/scripts/uapi-disintegration/disintegrate-to-stg-by-dir.pl
@@ -0,0 +1,85 @@
+#!/usr/bin/perl -w
+#
+# Perform header disintegration of the user API, producing commits on a
+# dir-by-dir basis to StGIT
+#
+
+use strict;
+use File::Basename;
+
+my $UAPI = "uapi";
+
+$ENV{UAPI} = "uapi";
+
+my $execdir = dirname($0);
+
+sub new_patch($$) {
+    my ($dirname, $patchname) = @_;
+
+    system("stg new $patchname -m 'UAPI: Disintegrate $dirname' --sign") == 0 or die;
+}
+
+#
+# Changes must be committed first
+#
+system("git diff --quiet") == 0 or die "Uncommitted changes; aborting\n";
+
+###############################################################################
+#
+#
+#
+###############################################################################
+if (system("stg id begin-marker") == 0) {
+    system("stg del begin-marker..") == 0 or die;
+}
+
+system("stg new begin-marker -m \"Begin userspace API extraction\"") == 0 or die;
+
+###############################################################################
+#
+#
+#
+###############################################################################
+my $curdir = "xxxxx";
+
+my @headerlist = sort {
+    dirname($a) cmp dirname($b) || $a cmp $b;
+} `$execdir/genlist.pl`;
+
+foreach my $origfile (@headerlist) {
+    chomp $origfile;
+    if (! -f $origfile) {
+	print "Skip $origfile\n";
+	next;
+    }
+
+    my $odir = dirname($origfile);
+    if ($odir ne $curdir) {
+	unless ($curdir eq "xxxxx") {
+	    system("stg ref") == 0 or die;
+	}
+	$curdir = $odir;
+
+	print "[$curdir]\n";
+
+	my $patchname = $curdir;
+	$patchname =~ s@/@__@g;
+
+	new_patch($curdir, "uapi-dis-" . $patchname);
+    }
+
+    print "$origfile\n";
+    my $uapifile = $origfile;
+    $uapifile =~ s@include/@include/$UAPI/@;
+    my $udir = dirname($uapifile);
+
+    system("$execdir/disintegrate-one.pl $origfile $uapifile") == 0 or die;
+
+    if (-r $uapifile) {
+	system("stg add $uapifile") == 0 or die;
+    }
+}
+
+unless ($curdir eq "xxxxx") {
+    system("stg ref") == 0 or die;
+}
diff --git a/scripts/uapi-disintegration/genlist.pl b/scripts/uapi-disintegration/genlist.pl
new file mode 100755
index 0000000..f9d022a
--- /dev/null
+++ b/scripts/uapi-disintegration/genlist.pl
@@ -0,0 +1,79 @@
+#!/usr/bin/perl -w
+
+use File::Find;
+
+#
+# We assume that only Kbuild files in include directories are pertinent to
+# determining which headers are UAPI headers.
+#
+@kbuilds = ();
+%headers = ();
+sub find_Kbuild()
+{
+    push(@kbuilds, $File::Find::name) if ($_ eq "Kbuild");
+    $headers{$File::Find::name} = 1 if ($_ =~ /[.]h$/ || $_ =~ /[.]agh$/);
+}
+
+find(\&find_Kbuild, "arch", "include");
+
+# Read the common arch list
+open FD, '<include/asm-generic/Kbuild.asm' or die "open Kbuild.asm: $!\n";
+my @kbuild_asm = <FD>;
+close FD or die;
+
+my %uapihdrs = ();
+
+foreach my $i (sort(grep { $_ !~ m@uapi/@ } @kbuilds)) {
+    #print "[[[ $i ]]]\n";
+
+    my $dir = $i;
+    $dir =~ m@(^.*)/@, $dir = $1;
+
+    open FD, '<', $i or die "open $i: $!\n";
+    my @lines = <FD>;
+    close FD or die;
+
+    for (my $l = 0; $l <= $#lines; $l++) {
+	my $line = $lines[$l];
+
+	# parse out the blocks
+	# - this may be split over multiple lines using backslashes
+	my $block = $line;
+      restart:
+	$block =~ s@#.*$@@;
+	$block =~ s@\s+$@@g;
+	$block =~ s@\s+@ @g;
+
+	if ($block =~ /^(.*)[\\]$/) {
+	    $l++;
+	    $block = $1 . $lines[$l];
+	    goto restart;
+	}
+
+	$block =~ s@\s+$@@g;
+	$block =~ s@\s\s+@ @g;
+
+	if ($block =~ m@^include include/asm-generic/Kbuild.asm@) {
+	    push @lines, @kbuild_asm;
+	}
+
+	if ($block =~ m@^header-y\s*[+:]?=\s*(.*)@ ||
+	    $block =~ m@^opt-header\s*[+:]?=\s*(.*)@ ||
+	    $block =~ m@^asm-headers\s*[+:]?=\s*(.*)@
+	    ) {
+	    foreach $h (map { "$dir/" . $_ } grep m@[^/]$@, split /\s+/, $1) {
+		if (exists $headers{$h}) {
+		    $uapihdrs{$h} = 1;
+		}
+	    }
+	}
+    }
+}
+
+if ($#ARGV == -1) {
+    # no arguments: all listed header files
+    print map { $_ . "\n"; } sort keys %uapihdrs;
+} else {
+    # any arguments: all unlisted header files
+    print map { $_ . "\n"; } sort grep { !exists $uapihdrs{$_}; } keys %headers;
+}
diff --git a/scripts/uapi-disintegration/sound-headers.pl b/scripts/uapi-disintegration/sound-headers.pl
new file mode 100755
index 0000000..da6153f
--- /dev/null
+++ b/scripts/uapi-disintegration/sound-headers.pl
@@ -0,0 +1,75 @@
+#!/usr/bin/perl -w
+
+use File::Find;
+
+#
+# Find all the .c and .h files under drivers/gpu/
+#
+%files = ();
+sub find_file()
+{
+    $files{$File::Find::name} = 1 if ($_ =~ /[.][ch]$/);
+}
+
+find(\&find_file, "sound");
+
+#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;
+		} else {
+		    print "Couldn't find \e[31m$name\e[m\n";
+		    next;
+		}
+	    }
+
+	    print $file, ": ", $name, " -> ", $path, "\n";
+	    $lines[$l] = $pre . "<" . $path . ">" . $post;
+	    $alter_file = 1;
+	}
+    }
+
+    if ($alter_file) {
+	my $temp = $file . ".soundinc";
+	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";
+    }
+}
+
+exit 0;


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

end of thread, other threads:[~2011-07-28 15:58 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28 15:49 [PATCH 00/40] UAPI header file split [ver #3] David Howells
2011-07-28 15:49 ` [PATCH 01/40] UAPI: Add script to convert #include "..." to #include <path/...> in sys headers " David Howells
2011-07-28 15:49 ` [PATCH 02/40] UAPI: Convert #include "..." to #include <path/...> in kernel system " David Howells
2011-07-28 15:49 ` [PATCH 03/40] UAPI: Add script to audit drivers/gpu/ for #including system headers with "..." " David Howells
2011-07-28 15:49 ` [PATCH 04/40] UAPI: Convert #include "..." to #include <path/...> in kernel system headers " David Howells
2011-07-28 15:50 ` [PATCH 05/40] UAPI: Add include/uapi/ directories to build " David Howells
2011-07-28 15:50 ` [PATCH 06/40] UAPI: Differentiate userspace build and kernelspace build include path sets " David Howells
2011-07-28 15:50 ` [PATCH 07/40] UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed " David Howells
2011-07-28 15:50 ` [PATCH 08/40] UAPI: ac_etime in linux/acct.h must keep its __KERNEL__ guards " David Howells
2011-07-28 15:50 ` [PATCH 09/40] UAPI: Make linux/patchkey.h easier to parse " David Howells
2011-07-28 15:50 ` [PATCH 10/40] UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h " David Howells
2011-07-28 15:51 ` [PATCH 11/40] UAPI: Fix nested __KERNEL__ guards in video/edid.h " David Howells
2011-07-28 15:51 ` [PATCH 12/40] UAPI: Split trivial #if defined(__KERNEL__) && X conditionals " David Howells
2011-07-28 15:51 ` [PATCH 13/40] UAPI: Remove the inclusion of linux/types.h from x86's asm/page.h " David Howells
2011-07-28 15:51 ` [PATCH 14/40] UAPI: Fix definition of HZ in asm-generic/param.h " David Howells
2011-07-28 15:51 ` [PATCH 15/40] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace " David Howells
2011-07-28 15:51 ` [PATCH 16/40] UAPI: Fix sigset_t ordering problem " David Howells
2011-07-28 15:52 ` [PATCH 17/40] UAPI: Fix E820_X_MAX " David Howells
2011-07-28 15:52 ` [PATCH 18/40] UAPI: Fix linux/netfilter.h inclusion order " David Howells
2011-07-28 15:52 ` [PATCH 19/40] UAPI: Fix linux/input.h " David Howells
2011-07-28 15:52 ` [PATCH 20/40] UAPI: Fix up linux/netfilter/xt_policy.h " David Howells
2011-07-28 15:52 ` [PATCH 21/40] UAPI: Fix linux/auto_fs.h inclusion order " David Howells
2011-07-28 15:52 ` [PATCH 22/40] UAPI: Fix drmP.h to use #include <...> when referring to system header files " David Howells
2011-07-28 15:53 ` [PATCH 23/40] UAPI: sound/sound_core.c should include linux/fs.h " David Howells
2011-07-28 15:53 ` [PATCH 24/40] UAPI: Fix SNDRV_*_ENDIAN ordering problem " David Howells
2011-07-28 15:53 ` [PATCH 25/40] UAPI: Fix u_quad_t ordering problem in linux/coda.h " David Howells
2011-07-28 15:53 ` [PATCH 26/40] UAPI: Fix " David Howells
2011-07-28 15:53 ` [PATCH 27/40] UAPI: Guard linux/isdn_divertif.h " David Howells
2011-07-28 15:53 ` [PATCH 28/40] UAPI: Guard linux/sound.h " David Howells
2011-07-28 15:53 ` [PATCH 29/40] UAPI: Fix linux/ncp.h " David Howells
2011-07-28 15:54 ` [PATCH 30/40] UAPI: Fix x86_64 system call count and generation " David Howells
2011-07-28 15:54 ` [PATCH 31/40] UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines " David Howells
2011-07-28 15:54 ` [PATCH 32/40] UAPI: Add a script to create a commit to set up new UAPI dirs " David Howells
2011-07-28 15:54 ` [PATCH 33/40] UAPI: Set up UAPI Kbuild files " David Howells
2011-07-28 15:54 ` [PATCH 34/40] UAPI: Plumb the UAPI Kbuilds into the user header handling system " David Howells
2011-07-28 15:54 ` [PATCH 35/40] UAPI: Set up uapi/asm/Kbuild.asm " David Howells
2011-07-28 15:55 ` [PATCH 36/40] UAPI: Move linux/version.h " David Howells
2011-07-28 15:55 ` [PATCH 37/40] UAPI: Make UAPI headers install to usr/include/ " David Howells
2011-07-28 15:55 ` [PATCH 38/40] UAPI: Fix the page-types query program in the docs " David Howells
2011-07-28 15:55 ` [PATCH 39/40] UAPI: Fix the x86 test_get_len tool " David Howells
2011-07-28 15:55 ` [PATCH 40/40] UAPI: Scripts to disintegrate header files " David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.