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>
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>
MIPS: Avoid overoptimization by GCC.

Without this, it's possible that LTO will discard the calls to
set_except_vector() in the probe for the DADDI overflow bug resulting in a
kernel crash like this:

 [...]
 Mount-cache hash table entries: 256
 Checking for the daddi bug... Integer overflow[#1]:
 Cpu 0
 $ 0   : 0000000000000000 0000000010008ce1 0000000000000001 0000000000000000
 $ 4   : 7fffffffffffedcd ffffffff81410000 0000000000000030 000000000000003f
 [...]

There are other similar places in the kernel so we've just been lucky
that GCC's been tolerant.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
IP27: Make declaration and definition of rt_timer_irq match.

Without, the LTO compiler will complain:

[...]
  LD      init/built-in.o
  LDFINAL vmlinux.o
arch/mips/sgi-ip27/ip27-irq.c:379:22: warning: type of ‘rt_timer_irq’ does not match original declaration [enabled by default]
  extern unsigned int rt_timer_irq;
                      ^
arch/mips/sgi-ip27/ip27-timer.c:72:5: note: previously declared here
 int rt_timer_irq;
     ^
  MODPOST vmlinux.o
[...]

And without LTO, it's still good stile to things match.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
MIPS: Remove further use of .subsection

7837314d141c661c70bc13c5050694413ecfe14a [MIPS: Get rid of branches to
.subsections] removed most uses of .subsection] removed most uses of
.subsection in inline assembler code.

It left the instances in spinlock.h alone because we knew their use was
in fairly small files where .subsection use was fine but of course this
was a fragile assumption.  LTO breaks this assumption resulting in build
errors due to exceeded branch range, so remove further instances of
.subsection.

The two functions that still use .macro don't currently cause issues
however this use is still fragile.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
MIPS: Remove redundant instructions from arch_spin_{,try}lock.

We were doing:
   SRL  $r,$?,16
   ANDI $r,$r,0xffff

The logical right shift by 16 leaves the upper 16 bits clear, so the
subsequent masking out of those bits is redundant, and can safely be
removed.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
m68k: clean up unused "config ROMVECSIZE"

Kconfig symbol ROMVECSIZE is unused since commit
f84f52a5c15db7d14a534815f27253b001735183 ("m68knommu: clean up linker
script"). Let's clean up its Kconfig entry too.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
romfs: fix nommu map length to keep inside filesystem

Checks introduced in commit 4991e7251 ("romfs: do not use
mtd->get_unmapped_area directly") re-introduce problems fixed in the earlier
commit 2b4b2482e ("romfs: fix romfs_get_unmapped_area() argument check").

If a flat binary app is located at the end of a romfs, its page aligned
length may be outside of the romfs filesystem. The flat binary loader, via
nommu do_mmap_pgoff(), page aligns the length it is mmaping. So simple
offset+size checks will fail - returning EINVAL.

We can truncate the length to keep it inside the romfs filesystem, and that
also keeps the call to mtd_get_unmapped_area() happy.

Are there any side effects to truncating the size here though?

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
m68k: Set ColdFire ACR1 cache mode depending on kernel configuration

For coldfire with MMU enabled, data cache did not follow the configuration but
was configured in writethrough mode.

Signed-off-by: Stany MARCEL <stany.marcel@novasys-ingenierie.com>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
m68k: remove unused asm/dbg.h

The contents of the m68k asm/dbg.h are never used, remove the file and
remove the one reference to it.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
m68knommu: create and use a common M53xx ColdFire class of CPUs

The current CONFIG_M532x support definitions are actually common to a larger
set of version 3 ColdFire CPU types. In the future we want to add support for
the 537x family. It is very similar to the 532x internally, and will be able
to use most of the same definitions.

Create a CONFIG_M53xx option that is enabled to support any of the common
532x and 537x CPU types. Convert the current users of CONFIG_M532x to use
CONFIG_M53xx instead.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
m68knommu: make ColdFire M532x platform support more v3 generic

The M532x CPU platform support can be used on more ColdFire CPU families
than just the 532x types. So rename and reconfigure it to reflect that.
The ColdFire 537x family has virtualy identical internals to the 532x,
and so it will be able to share this code when we add support for them.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>