uapi: Allow automatic generation of uapi/asm/ header files

Several arch/*/include/uapi/asm/* header simply include the
corresponding <asm-generic/*> file. This patch allows such files to be
specified in uapi/asm/Kbuild via "generic-y += ..." to be automatically
generated (similar to asm/Kbuild).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>
UAPI: Make uapi/linux/irqnr.h non-empty

uapi/linux/irqnr.h was emitted by the UAPI disintegration script as an empty
file because the parent linux/irqnr.h had no UAPI stuff in it, despite being
marked with "header-y".

Unfortunately, the patch program deletes the empty file when applying a kernel
patch.

It's not clear why this file is part of the UAPI at all.  Looking in:

	/usr/include/linux/irqnr.h

there's nothing there but a header reinclusion guard and a comment.

So just stick a comment in there as a placeholder.

Without this, if the kernel is fabricated from, say, a tarball and a patch, you
can get this error when building x86_64 or usermode Linux (and probably
others):

include/linux/irqnr.h:4:30: fatal error: uapi/linux/irqnr.h: No such file or directory

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Reported-by: Alessandro Suardi <alessandro.suardi@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Randy Dunlap <rdunlap@xenotime.net>
cc: Alessandro Suardi <alessandro.suardi@gmail.com>
UAPI: Remove empty conditionals from include/linux/Kbuild

Remove empty conditionals from include/linux/Kbuild as the contents, with new
conditionals, have moved to include/uapi/linux/Kbuild.

Signed-off-by: David Howells <dhowells@redhat.com>
UAPI: Remove empty non-UAPI Kbuild files

Remove non-UAPI Kbuild files that have become empty as a result of UAPI
disintegration.  They used to have only header-y lines in them and those have
now moved to the Kbuild files in the corresponding uapi/ directories.

Possibly these should not be removed but rather have a comment inserted to say
they are intentionally left blank.  This would make it easier to add generated
header lines in future without having to restore the infrastructure.

Note that at this point not all the UAPI disintegration parts have been merged,
so it is likely that more empty Kbuild files will turn up.

It is probably necessary to make the files non-empty to prevent the patch
program from automatically deleting them when it reduces them to nothing.

Signed-off-by: David Howells <dhowells@redhat.com>
UAPI: Place comments in empty arch Kbuilds to make them non-empty

Place comments in:

	arch/mips/include/asm/Kbuild
	arch/tile/include/arch/Kbuild

to make them non-empty so that the patch program doesn't remove them when it
reduces them to nothing.

Possibly they should be just deleted, but it's possible that they'll acquire
generic-y or genhdr-y lines in future, so I'm keeping them around for the
moment.

Note that MIPS will compile happily if the file is deleted instead.  I haven't
tested TILE, but I suspect it will be the same there.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Ralf Baechle <ralf@linux-mips.org>
cc: Chris Metcalf <cmetcalf@tilera.com>
UAPI: The tile arch uses the generic ucontext.h file

Move the header-y and generic-y lines for ucontext.h from
arch/tile/include/asm/Kbuild to the uapi/ Kbuild as the asm-generic variant is
used.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Chris Metcalf <cmetcalf@tilera.com>
UAPI: Put a comment into uapi/asm-generic/kvm_para.h and use it from arches

Make uapi/asm-generic/kvm_para.h non-empty by addition of a comment to stop
the patch program from deleting it when it creates it.

Then delete empty arch-specific uapi/asm/kvm_para.h files and tell the Kbuild
files to use the generic instead.

Should this perhaps instead be a #warning or #error that the facility is
unsupported on this arch?

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Arnd Bergmann <arnd@arndb.de>
cc: Avi Kivity <avi@redhat.com>
cc: Marcelo Tosatti <mtosatti@redhat.com>
cc: kvm@vger.kernel.org
UAPI: Make arch/mn10300/include/uapi/asm/setup.h non-empty

arch/mn10300/include/uapi/asm/setup.h was emitted by the UAPI disintegration
script as an empty file because the parent file had no UAPI stuff in it,
despite being marked with "header-y".

Unfortunately, the patch program deletes resultant empty files when applying a
kernel patch.

So just stick a comment in there as a placeholder.

Signed-off-by: David Howells <dhowells@redhat.com>
UAPI: Make arch/sh/include/uapi/asm/hw_breakpoint.h non-empty

arch/sh/include/uapi/asm/hw_breakpoint.h was emitted by the UAPI disintegration
script as an empty file because the parent file had no UAPI stuff in it,
despite being marked with "header-y".

Unfortunately, the patch program deletes resultant empty files when applying a
kernel patch.

So just stick a comment in there as a placeholder.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Paul Mundt <lethal@linux-sh.org>
cc: linux-sh@vger.kernel.org
UAPI: Make arch/sparc/include/uapi/asm/sigcontext.h non-empty

arch/sparc/include/uapi/asm/sigcontext.h was emitted by the UAPI disintegration
script as an empty file because the parent file had no UAPI stuff in it,
despite being marked with "header-y".

Unfortunately, the patch program deletes resultant empty files when applying a
kernel patch.

So just stick a comment in there as a placeholder.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: David S. Miller <davem@davemloft.net>
cc: sparclinux@vger.kernel.org
Merge tag 'uapi-fixes-20121017' of git://git.infradead.org/users/dhowells/linux-headers

Pull misc UAPI fixes from David Howells:
 "They do a number of things:

  (1) Import a patch from Catalin Marinas to extend the generic-y in
      Kbuild facility to uapi directories.

  (2) Make arch/tile's ucontext.h file use (1) and remove the header-y
      line from the kernel internal side of things.

  (3) Remove some now-empty conditional bits from include/linux/Kbuild.
      The contents got moved to the UAPI side of things along with new
      conditionals.

  (4) Deal with now-empty files:

     (a) Empty Kbuild files under include/ get removed.

     (b) Empty Kbuild files under arch/ get comments to hold them as
         they are likely to end up with generic-y or genhdr-y lines.
         Deleting them appears to work if we want to go that route.

     (c) Put a comment into uapi/asm-generic/kvm_para.h to prevent the
         patch program from deleting that, and made the arches with
         empty kvm_para.h uapi files use that instead of having their
         own files.

     (d) Put comments into four other empty uapi/ headers to prevent the
         patch program from deleting them.

  A question: Is this the right way to deal with the now-empty Kbuild
  files?

  The ones under include/ are unlikely to be used - even for generated
  files, I think - so getting rid of them is probably okay.  Once all
  the bits are in, we can probably remove all the Kbuild files under
  include/ that aren't also under include/uapi/.

  The ones under arch/ are more of an issue because of the potential for
  generic-y and genhdr-y."

* tag 'uapi-fixes-20121017' of git://git.infradead.org/users/dhowells/linux-headers:
  UAPI: Make arch/sparc/include/uapi/asm/sigcontext.h non-empty
  UAPI: Make arch/sh/include/uapi/asm/hw_breakpoint.h non-empty
  UAPI: Make arch/mn10300/include/uapi/asm/setup.h non-empty
  UAPI: Put a comment into uapi/asm-generic/kvm_para.h and use it from arches
  UAPI: The tile arch uses the generic ucontext.h file
  UAPI: Place comments in empty arch Kbuilds to make them non-empty
  UAPI: Remove empty non-UAPI Kbuild files
  UAPI: Remove empty conditionals from include/linux/Kbuild
  UAPI: Make uapi/linux/irqnr.h non-empty
  uapi: Allow automatic generation of uapi/asm/ header files
apparmor: fix apparmor OOPS in audit_log_untrustedstring+0x1c/0x40

The capability defines have moved causing the auto generated names
of capabilities that apparmor uses in logging to be incorrect.

Fix the autogenerated table source to uapi/linux/capability.h

Reported-by: YanHong <clouds.yan@gmail.com>
Reported-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
Analyzed-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>