dell-laptop: Fix krealloc() misuse in parse_da_table()

If krealloc() returns NULL, it *doesn't* free the original. So any code
of the form 'foo = krealloc(foo, …);' is almost certainly a bug.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
params: Fix potential memory leak in add_sysfs_param()

On allocation failure, it would fail to free the old attrs array which
was no longer referenced by anything (since it would free the old
module_param_attrs struct on the way out).

Comment the suspicious-looking krealloc() usage to explain why it *isn't*
actually buggy, despite looking like a classic realloc() usage bug.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
pcmcia: remove Motorola MBX860 support

The CONFIG_MBX symbol is not defined anywhere in the kernel tree, which means
this platform is not supported by the Linux kernel and we can remove the
corresponding code from the 'm8xx_pcmcia' driver.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: linux-pcmcia@lists.infradead.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
m68k: remove rpxlite stuff

The CONFIG_RPXLITE is not defined anywhere, which means that this board is not
supported anyway, and we can clean-up commproc.h a little.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: linux-pcmcia@lists.infradead.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
pcmcia: remove RPX board stuff

The RPX board is not supported by the kernel because CONFIG_RPXCLASSIC and
CONFIG_RPXLITE symbols and not defined anywhere. Clean-up the m8xx_pcmcia
driver a little bit.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: linux-pcmcia@lists.infradead.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
MIPS: Add linux/mm_types.h to pgtable.h

With the addition of transparent huge pages, pgtable.h uses struct page.
However, it is possible to include pgtable.h without anything defining
struct page.  So add the include to get it.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
audit: improve GID/EGID comparation logic

It is useful to extend GID/EGID comparation logic to be able to
match not only the exact EID/EGID values but the group/egroup also.

Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
audit: refactor hold queue flush

The hold queue flush code is an autonomous chunk of code that can be
refactored, removed from kauditd_thread() into flush_hold_queue() and
flattenned for better legibility.

Signed-off-by: Richard Guy Briggs <rbriggs@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
audit: flatten kauditd_thread wait queue code

The wait queue control code in kauditd_thread() was nested deeper than
necessary.  The function has been flattened for better legibility.

Signed-off-by: Richard Guy Briggs <rbriggs@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
audit: move kaudit thread start from auditd registration to kaudit init

The kauditd_thread() task was started only after the auditd userspace daemon
registers itself with kaudit.  This was fine when only auditd consumed messages
from the kaudit netlink unicast socket.  With the addition of a multicast group
to that socket it is more convenient to have the thread start on init of the
kaudit kernel subsystem.

Signed-off-by: Richard Guy Briggs <rbriggs@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
audit: Syscall rules are not applied to existing processes on non-x86

Commit b05d8447e782 (audit: inline audit_syscall_entry to reduce
burden on archs) changed audit_syscall_entry to check for a dummy
context before calling __audit_syscall_entry. Unfortunately the dummy
context state is maintained in __audit_syscall_entry so once set it
never gets cleared, even if the audit rules change.

As a result, if there are no auditing rules when a process starts
then it will never be subject to any rules added later. x86 doesn't
see this because it has an assembly fast path that calls directly into
__audit_syscall_entry.

I noticed this issue when working on audit performance optimisations.
I wrote a set of simple test cases available at:

http://ozlabs.org/~anton/junkcode/audit_tests.tar.gz

02_new_rule.py fails without the patch and passes with it. The
test case clears all rules, starts a process, adds a rule then
verifies the process produces a syscall audit record.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org> # 3.3+
Signed-off-by: Eric Paris <eparis@redhat.com>
powerpc: Remove static branch prediction in 64bit traced syscall path

Some distros enable auditing by default which forces us through the
syscall trace path. Remove the static branch prediction in our 64bit
syscall handler and let the hardware do the prediction.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Eric Paris <eparis@redhat.com>
audit: destroy long filenames correctly

filename should be destroyed via final_putname() instead of __putname()
Otherwise this result in following BUGON() in case of long names:
  kernel BUG at mm/slab.c:3006!
  Call Trace:
  kmem_cache_free+0x1c1/0x850
  audit_putname+0x88/0x90
  putname+0x73/0x80
  sys_symlinkat+0x120/0x150
  sys_symlink+0x16/0x20
  system_call_fastpath+0x16/0x1b

Introduced-in: 7950e3852

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
kernel: audit: beautify code, for extern function, better to check its parameters by itself

  __audit_socketcall is an extern function.
  better to check its parameters by itself.

    also can return error code, when fail (find invalid parameters).
    also use macro instead of real hard code number
    also give related comments for it.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
[eparis: fix the return value when !CONFIG_AUDIT]
Signed-off-by: Eric Paris <eparis@redhat.com>
auditsc: Use kzalloc instead of kmalloc+memset.

  In function audit_alloc_context(), use kzalloc, instead of kmalloc+memset. Patch also renames audit_zero_context() to
audit_set_context(), to represent it's inner workings properly.

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
auditsc: remove audit_set_context() altogether - fold it into its caller

>   In function audit_alloc_context(), use kzalloc, instead of kmalloc+memset. Patch also renames audit_zero_context() to
> audit_set_context(), to represent it's inner workings properly.

Fair enough.  I'd go futher...

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Paris <eparis@redhat.com>
Cc: Rakib Mullick <rakib.mullick@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Eric Paris <eparis@redhat.com>
MIPS: Use inline function to access current thread pointer.

With LTE this fixes this issue:

  LDFINAL vmlinux.o
arch/mips/built-in.o (symbol from plugin): In function `sgimc_init':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
kernel/built-in.o (symbol from plugin): In function `get_task_mm':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
mm/built-in.o (symbol from plugin): In function `iov_iter_single_seg_count':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
fs/built-in.o (symbol from plugin): In function `finish_no_open':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
ipc/built-in.o (symbol from plugin): In function `ipc_init_ids':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
security/built-in.o (symbol from plugin): In function `key_schedule_gc':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
crypto/built-in.o (symbol from plugin): In function `crypto_find_alg':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
block/built-in.o (symbol from plugin): In function `elv_rb_find':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
argv_split.o (symbol from plugin): In function `argv_free':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
dec_and_lock.o (symbol from plugin): In function `_atomic_dec_and_lock':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
extable.o (symbol from plugin): In function `sort_extable':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
flex_proportions.o (symbol from plugin): In function `fprop_global_init':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
idr.o (symbol from plugin): In function `idr_for_each':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
is_single_threaded.o (symbol from plugin): In function `current_is_single_threaded':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
kobject.o (symbol from plugin): In function `kobject_get':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
kobject_uevent.o (symbol from plugin): In function `add_uevent_var':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
plist.o (symbol from plugin): In function `plist_add':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
radix-tree.o (symbol from plugin): In function `radix_tree_lookup_slot':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
ratelimit.o (symbol from plugin): In function `___ratelimit':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
rwsem-spinlock.o (symbol from plugin): In function `__init_rwsem':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
show_mem.o (symbol from plugin): In function `show_mem':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
timerqueue.o (symbol from plugin): In function `timerqueue_iterate_next':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
vsprintf.o (symbol from plugin): In function `simple_strtoull':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
delay.o (symbol from plugin): In function `__delay':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
mips-atomic.o (symbol from plugin): In function `arch_local_irq_disable':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
uncached.o (symbol from plugin): In function `run_uncached':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
lib/built-in.o (symbol from plugin): In function `_bcd2bin':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
arch/mips/lib/built-in.o (symbol from plugin): In function `ioread8':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
drivers/built-in.o (symbol from plugin): In function `fb_notifier_call_chain':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
net/built-in.o (symbol from plugin): In function `sock_from_file':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here
klist.o (symbol from plugin): In function `klist_init':
(.text+0x0): multiple definition of `$28'
init/built-in.o (symbol from plugin):(.text+0x0): first defined here

It also makes the code a little more readable, so let's merge it.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
MIPS: Make tlb exception handler definitions and declarations match.

The code was written as it is because it's more expressive, a bit easier.
But it's always been dirty, if not a bug.  But we can't cheat with LTO
compilers, so this results in:

[...]
  LDFINAL vmlinux.o
In file included from arch/mips/kernel/topology.c:604:0,
                 from arch/mips/kernel/time.c:212,
                 from arch/mips/kernel/syscall.c:300,
                 from arch/mips/kernel/signal.c:853,
                 from arch/mips/kernel/setup.c:1030,
                 from arch/mips/kernel/reset.c:354,
                 from arch/mips/kernel/ptrace.c:562,
                 from arch/mips/kernel/process.c:770,
                 from arch/mips/kernel/irq.c:350,
                 from arch/mips/kernel/branch.c:321,
                 from arch/mips/kernel/cpu-probe.c:1370,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:345,
                 from arch/mips/sgi-ip22/ip22-gio.c:660,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/sgialib.h:219,
                 from arch/mips/sgi-ip22/ip22-reset.c:224,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/paccess.h:116,
                 from arch/mips/sgi-ip22/ip22-nvram.c:334,
                 from include/linux/kernel_stat.h:79,
                 from arch/mips/sgi-ip22/ip22-int.c:592,
                 from arch/mips/sgi-ip22/ip22-hpc.c:470,
                 from arch/mips/sgi-ip22/ip22-mc.c:135,
                 from init/init_task.c:54,
                 from init/calibrate.c:744,
                 from init/noinitramfs.c:62,
                 from init/do_mounts.c:573,
                 from init/version.c:1009,
                 from init/main.c:777,
                 from :729:
arch/mips/kernel/traps.c:63:49: error: variable ‘handle_tlbl’ redeclared as function
In file included from arch/mips/mm/page.c:310:0,
                 from arch/mips/mm/mmap.c:208,
                 from arch/mips/mm/init.c:641,
                 from arch/mips/mm/gup.c:811,
                 from arch/mips/mm/fault.c:659,
                 from include/linux/module.h:682,
                 from arch/mips/mm/dma-default.c:161,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:397,
                 from arch/mips/kernel/i8253.c:538,
                 from arch/mips/kernel/proc.c:145,
                 from arch/mips/kernel/irq_cpu.c:129,
                 from arch/mips/kernel/i8259.c:229,
                 from include/uapi/linux/elf.h:251,
                 from arch/mips/kernel/mips_ksyms.c:129,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/time.h:50,
                 from arch/mips/kernel/cevt-r4k.c:90,
                 from arch/mips/kernel/vdso.c:136,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:351,
                 from arch/mips/kernel/unaligned.c:809,
                 from arch/mips/kernel/traps.c:1720,
                 from arch/mips/kernel/topology.c:684,
                 from arch/mips/kernel/time.c:212,
                 from arch/mips/kernel/syscall.c:300,
                 from arch/mips/kernel/signal.c:853,
                 from arch/mips/kernel/setup.c:1030,
                 from arch/mips/kernel/reset.c:354,
                 from arch/mips/kernel/ptrace.c:562,
                 from arch/mips/kernel/process.c:770,
                 from arch/mips/kernel/irq.c:350,
                 from arch/mips/kernel/branch.c:321,
                 from arch/mips/kernel/cpu-probe.c:1370,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:345,
                 from arch/mips/sgi-ip22/ip22-gio.c:660,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/sgialib.h:219,
                 from arch/mips/sgi-ip22/ip22-reset.c:224,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/paccess.h:116,
                 from arch/mips/sgi-ip22/ip22-nvram.c:334,
                 from include/linux/kernel_stat.h:79,
                 from arch/mips/sgi-ip22/ip22-int.c:592,
                 from arch/mips/sgi-ip22/ip22-hpc.c:470,
                 from arch/mips/sgi-ip22/ip22-mc.c:135,
                 from init/init_task.c:54,
                 from init/calibrate.c:744,
                 from init/noinitramfs.c:62,
                 from init/do_mounts.c:573,
                 from init/version.c:1009,
                 from init/main.c:777,
                 from :729:
arch/mips/mm/tlbex.c:1448:5: note: previously declared here
In file included from arch/mips/kernel/topology.c:604:0,
                 from arch/mips/kernel/time.c:212,
                 from arch/mips/kernel/syscall.c:300,
                 from arch/mips/kernel/signal.c:853,
                 from arch/mips/kernel/setup.c:1030,
                 from arch/mips/kernel/reset.c:354,
                 from arch/mips/kernel/ptrace.c:562,
                 from arch/mips/kernel/process.c:770,
                 from arch/mips/kernel/irq.c:350,
                 from arch/mips/kernel/branch.c:321,
                 from arch/mips/kernel/cpu-probe.c:1370,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:345,
                 from arch/mips/sgi-ip22/ip22-gio.c:660,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/sgialib.h:219,
                 from arch/mips/sgi-ip22/ip22-reset.c:224,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/paccess.h:116,
                 from arch/mips/sgi-ip22/ip22-nvram.c:334,
                 from include/linux/kernel_stat.h:79,
                 from arch/mips/sgi-ip22/ip22-int.c:592,
                 from arch/mips/sgi-ip22/ip22-hpc.c:470,
                 from arch/mips/sgi-ip22/ip22-mc.c:135,
                 from init/init_task.c:54,
                 from init/calibrate.c:744,
                 from init/noinitramfs.c:62,
                 from init/do_mounts.c:573,
                 from init/version.c:1009,
                 from init/main.c:777,
                 from :729:
arch/mips/kernel/traps.c:62:49: error: variable ‘handle_tlbm’ redeclared as function
In file included from arch/mips/mm/page.c:310:0,
                 from arch/mips/mm/mmap.c:208,
                 from arch/mips/mm/init.c:641,
                 from arch/mips/mm/gup.c:811,
                 from arch/mips/mm/fault.c:659,
                 from include/linux/module.h:682,
                 from arch/mips/mm/dma-default.c:161,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:397,
                 from arch/mips/kernel/i8253.c:538,
                 from arch/mips/kernel/proc.c:145,
                 from arch/mips/kernel/irq_cpu.c:129,
                 from arch/mips/kernel/i8259.c:229,
                 from include/uapi/linux/elf.h:251,
                 from arch/mips/kernel/mips_ksyms.c:129,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/time.h:50,
                 from arch/mips/kernel/cevt-r4k.c:90,
                 from arch/mips/kernel/vdso.c:136,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:351,
                 from arch/mips/kernel/unaligned.c:809,
                 from arch/mips/kernel/traps.c:1720,
                 from arch/mips/kernel/topology.c:684,
                 from arch/mips/kernel/time.c:212,
                 from arch/mips/kernel/syscall.c:300,
                 from arch/mips/kernel/signal.c:853,
                 from arch/mips/kernel/setup.c:1030,
                 from arch/mips/kernel/reset.c:354,
                 from arch/mips/kernel/ptrace.c:562,
                 from arch/mips/kernel/process.c:770,
                 from arch/mips/kernel/irq.c:350,
                 from arch/mips/kernel/branch.c:321,
                 from arch/mips/kernel/cpu-probe.c:1370,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:345,
                 from arch/mips/sgi-ip22/ip22-gio.c:660,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/sgialib.h:219,
                 from arch/mips/sgi-ip22/ip22-reset.c:224,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/paccess.h:116,
                 from arch/mips/sgi-ip22/ip22-nvram.c:334,
                 from include/linux/kernel_stat.h:79,
                 from arch/mips/sgi-ip22/ip22-int.c:592,
                 from arch/mips/sgi-ip22/ip22-hpc.c:470,
                 from arch/mips/sgi-ip22/ip22-mc.c:135,
                 from init/init_task.c:54,
                 from init/calibrate.c:744,
                 from init/noinitramfs.c:62,
                 from init/do_mounts.c:573,
                 from init/version.c:1009,
                 from init/main.c:777,
                 from :729:
arch/mips/mm/tlbex.c:1450:5: note: previously declared here
In file included from arch/mips/kernel/topology.c:604:0,
                 from arch/mips/kernel/time.c:212,
                 from arch/mips/kernel/syscall.c:300,
                 from arch/mips/kernel/signal.c:853,
                 from arch/mips/kernel/setup.c:1030,
                 from arch/mips/kernel/reset.c:354,
                 from arch/mips/kernel/ptrace.c:562,
                 from arch/mips/kernel/process.c:770,
                 from arch/mips/kernel/irq.c:350,
                 from arch/mips/kernel/branch.c:321,
                 from arch/mips/kernel/cpu-probe.c:1370,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:345,
                 from arch/mips/sgi-ip22/ip22-gio.c:660,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/sgialib.h:219,
                 from arch/mips/sgi-ip22/ip22-reset.c:224,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/paccess.h:116,
                 from arch/mips/sgi-ip22/ip22-nvram.c:334,
                 from include/linux/kernel_stat.h:79,
                 from arch/mips/sgi-ip22/ip22-int.c:592,
                 from arch/mips/sgi-ip22/ip22-hpc.c:470,
                 from arch/mips/sgi-ip22/ip22-mc.c:135,
                 from init/init_task.c:54,
                 from init/calibrate.c:744,
                 from init/noinitramfs.c:62,
                 from init/do_mounts.c:573,
                 from init/version.c:1009,
                 from init/main.c:777,
                 from :729:
arch/mips/kernel/traps.c:64:49: error: variable ‘handle_tlbs’ redeclared as function
In file included from arch/mips/mm/page.c:310:0,
                 from arch/mips/mm/mmap.c:208,
                 from arch/mips/mm/init.c:641,
                 from arch/mips/mm/gup.c:811,
                 from arch/mips/mm/fault.c:659,
                 from include/linux/module.h:682,
                 from arch/mips/mm/dma-default.c:161,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:397,
                 from arch/mips/kernel/i8253.c:538,
                 from arch/mips/kernel/proc.c:145,
                 from arch/mips/kernel/irq_cpu.c:129,
                 from arch/mips/kernel/i8259.c:229,
                 from include/uapi/linux/elf.h:251,
                 from arch/mips/kernel/mips_ksyms.c:129,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/time.h:50,
                 from arch/mips/kernel/cevt-r4k.c:90,
                 from arch/mips/kernel/vdso.c:136,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:351,
                 from arch/mips/kernel/unaligned.c:809,
                 from arch/mips/kernel/traps.c:1720,
                 from arch/mips/kernel/topology.c:684,
                 from arch/mips/kernel/time.c:212,
                 from arch/mips/kernel/syscall.c:300,
                 from arch/mips/kernel/signal.c:853,
                 from arch/mips/kernel/setup.c:1030,
                 from arch/mips/kernel/reset.c:354,
                 from arch/mips/kernel/ptrace.c:562,
                 from arch/mips/kernel/process.c:770,
                 from arch/mips/kernel/irq.c:350,
                 from arch/mips/kernel/branch.c:321,
                 from arch/mips/kernel/cpu-probe.c:1370,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/thread_info.h:345,
                 from arch/mips/sgi-ip22/ip22-gio.c:660,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/sgialib.h:219,
                 from arch/mips/sgi-ip22/ip22-reset.c:224,
                 from /fluff/home/ralf/src/linux/lto/linux-misc/arch/mips/include/asm/paccess.h:116,
                 from arch/mips/sgi-ip22/ip22-nvram.c:334,
                 from include/linux/kernel_stat.h:79,
                 from arch/mips/sgi-ip22/ip22-int.c:592,
                 from arch/mips/sgi-ip22/ip22-hpc.c:470,
                 from arch/mips/sgi-ip22/ip22-mc.c:135,
                 from init/init_task.c:54,
                 from init/calibrate.c:744,
                 from init/noinitramfs.c:62,
                 from init/do_mounts.c:573,
                 from init/version.c:1009,
                 from init/main.c:777,
                 from :729:
arch/mips/mm/tlbex.c:1449:5: note: previously declared here
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: /usr/bin/mips-linux-gcc returned 1 exit status
/usr/lib64/gcc/mips-linux/4.7.1/../../../../mips-linux/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [vmlinux] Error 1
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
MIPS: Make declarations and definitions of tlbmiss_handler_setup_pgd match.

tlbmiss_handler_setup_pgd is run-time generated code and it was convenient
to pretend the symbol was an array in the generator but a function for
the users.  LTO gcc won't tolerate this kind of lie anymore so solve the
problem through a cast and function pointer instead.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
MIPS: Get rid of the use of .macro in C code.

It fails with LTO and probably has always been a fragile.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>