linux/arch/mips/kernel
Sasha Levin b67bfe0d42 hlist: drop the node parameter from iterators
I'm not sure why, but the hlist for each entry iterators were conceived

        list_for_each_entry(pos, head, member)

The hlist ones were greedy and wanted an extra parameter:

        hlist_for_each_entry(tpos, pos, head, member)

Why did they need an extra pos parameter? I'm not quite sure. Not only
they don't really need it, it also prevents the iterator from looking
exactly like the list iterator, which is unfortunate.

Besides the semantic patch, there was some manual work required:

 - Fix up the actual hlist iterators in linux/list.h
 - Fix up the declaration of other iterators based on the hlist ones.
 - A very small amount of places were using the 'node' parameter, this
 was modified to use 'obj->member' instead.
 - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
 properly, so those had to be fixed up manually.

The semantic patch which is mostly the work of Peter Senna Tschudin is here:

@@
iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;

type T;
expression a,c,d,e;
identifier b;
statement S;
@@

-T b;
    <+... when != b
(
hlist_for_each_entry(a,
- b,
c, d) S
|
hlist_for_each_entry_continue(a,
- b,
c) S
|
hlist_for_each_entry_from(a,
- b,
c) S
|
hlist_for_each_entry_rcu(a,
- b,
c, d) S
|
hlist_for_each_entry_rcu_bh(a,
- b,
c, d) S
|
hlist_for_each_entry_continue_rcu_bh(a,
- b,
c) S
|
for_each_busy_worker(a, c,
- b,
d) S
|
ax25_uid_for_each(a,
- b,
c) S
|
ax25_for_each(a,
- b,
c) S
|
inet_bind_bucket_for_each(a,
- b,
c) S
|
sctp_for_each_hentry(a,
- b,
c) S
|
sk_for_each(a,
- b,
c) S
|
sk_for_each_rcu(a,
- b,
c) S
|
sk_for_each_from
-(a, b)
+(a)
S
+ sk_for_each_from(a) S
|
sk_for_each_safe(a,
- b,
c, d) S
|
sk_for_each_bound(a,
- b,
c) S
|
hlist_for_each_entry_safe(a,
- b,
c, d, e) S
|
hlist_for_each_entry_continue_rcu(a,
- b,
c) S
|
nr_neigh_for_each(a,
- b,
c) S
|
nr_neigh_for_each_safe(a,
- b,
c, d) S
|
nr_node_for_each(a,
- b,
c) S
|
nr_node_for_each_safe(a,
- b,
c, d) S
|
- for_each_gfn_sp(a, c, d, b) S
+ for_each_gfn_sp(a, c, d) S
|
- for_each_gfn_indirect_valid_sp(a, c, d, b) S
+ for_each_gfn_indirect_valid_sp(a, c, d) S
|
for_each_host(a,
- b,
c) S
|
for_each_host_safe(a,
- b,
c, d) S
|
for_each_mesh_entry(a,
- b,
c, d) S
)
    ...+>

[akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
[akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
[akpm@linux-foundation.org: checkpatch fixes]
[akpm@linux-foundation.org: fix warnings]
[akpm@linux-foudnation.org: redo intrusive kvm changes]
Tested-by: Peter Senna Tschudin <peter.senna@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27 19:10:24 -08:00
..
cpufreq
.gitignore
8250-platform.c
Makefile MIPS: PMC-Sierra Yosemite: Remove support. 2012-12-13 18:15:30 +01:00
asm-offsets.c MIPS: Include PAGE_S{IZE,HIFT} in <asm/offset.h>. 2012-12-28 17:04:10 +01:00
binfmt_elfn32.c
binfmt_elfo32.c
bmips_vec.S
branch.c
cevt-bcm1480.c
cevt-ds1287.c
cevt-gt641xx.c
cevt-r4k.c
cevt-sb1250.c
cevt-smtc.c
cevt-txx9.c
cpu-bugs64.c
cpu-probe.c MIPS: R3000/R3081: Fix CPU detection. 2012-12-05 19:58:54 +01:00
crash.c MIPS: kdump: Add support 2012-12-13 16:46:47 +01:00
crash_dump.c MIPS: Octeon: Add kexec and kdump support 2012-12-13 17:00:39 +01:00
csrc-bcm1480.c
csrc-ioasic.c
csrc-powertv.c
csrc-r4k.c
csrc-sb1250.c
early_printk.c
entry.S Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-12-12 12:22:13 -08:00
ftrace.c MIPS: Function tracer: Fix broken function tracing 2013-01-31 15:28:48 +01:00
genex.S MIPS: Switch remaining assembler PAGE_SIZE users to <asm/asm-offsets.h>. 2012-12-28 17:04:16 +01:00
gpio_txx9.c
head.S MIPS: Don't include <asm/page.h> unnecessarily. 2012-12-28 17:04:04 +01:00
i8253.c
i8259.c
irq-gic.c
irq-gt641xx.c
irq-msc01.c
irq-rm7000.c
irq.c
irq_cpu.c
irq_txx9.c
jump_label.c
kgdb.c mips,kgdb: fix recursive page fault with CONFIG_KPROBES 2012-10-12 06:37:34 -05:00
kprobes.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
linux32.c mips: switch to generic sys_fork() and sys_clone() 2013-02-03 18:33:02 -05:00
machine_kexec.c MIPS: kdump: Add support 2012-12-13 16:46:47 +01:00
mcount.S MIPS: Function tracer: Fix broken function tracing 2013-01-31 15:28:48 +01:00
mips-mt-fpaff.c MIPS: MT: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS=y 2012-12-13 18:15:26 +01:00
mips-mt.c
mips_ksyms.c Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-12-14 14:27:45 -08:00
mips_machine.c
module-rela.c
module.c
octeon_switch.S MIPS: Don't include <asm/page.h> unnecessarily. 2012-12-28 17:04:04 +01:00
perf_event.c
perf_event_mipsxx.c MIPS: perf: Fix build failure in XLP perf support. 2012-12-27 16:27:35 +01:00
proc.c MIPS: proc: Cleanup printing of ASEs. 2012-10-11 11:10:43 +02:00
process.c mips: take the "zero newsp means inherit the parent's one" to copy_thread() 2013-02-03 18:33:01 -05:00
prom.c
ptrace.c
ptrace32.c
r4k_fpu.S
r4k_switch.S MIPS: Don't include <asm/page.h> unnecessarily. 2012-12-28 17:04:04 +01:00
r2300_fpu.S
r2300_switch.S MIPS: Don't include <asm/page.h> unnecessarily. 2012-12-28 17:04:04 +01:00
r6000_fpu.S
relocate_kernel.S MIPS: Switch remaining assembler PAGE_SIZE users to <asm/asm-offsets.h>. 2012-12-28 17:04:16 +01:00
reset.c
rtlx.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
scall32-o32.S mips: switch to generic sys_fork() and sys_clone() 2013-02-03 18:33:02 -05:00
scall64-64.S mips: switch to generic sys_fork() and sys_clone() 2013-02-03 18:33:02 -05:00
scall64-n32.S mips: switch to generic sys_fork() and sys_clone() 2013-02-03 18:33:02 -05:00
scall64-o32.S mips: switch to generic sys_fork() and sys_clone() 2013-02-03 18:33:02 -05:00
setup.c MIPS: kdump: Add support 2012-12-13 16:46:47 +01:00
signal-common.h
signal.c mips: sigsuspend() is essentially the same as rt_sigsuspend() here 2013-02-03 18:32:59 -05:00
signal32.c mips: switch to generic compat rt_sigaction() 2013-02-03 18:33:00 -05:00
signal_n32.c switch mips to generic rt_sigsuspend(), make it unconditional 2013-02-03 18:32:49 -05:00
smp-bmips.c
smp-cmp.c MIPS: CMP: Fix physical core number calculation logic 2012-10-18 11:45:41 +02:00
smp-mt.c
smp-up.c
smp.c MIPS: drivers: remove __dev* attributes. 2013-01-03 15:57:09 -08:00
smtc-asm.S
smtc-proc.c
smtc.c
spinlock_test.c
spram.c
stacktrace.c
sync-r4k.c
syscall.c mips: switch to generic sys_fork() and sys_clone() 2013-02-03 18:33:02 -05:00
time.c
topology.c
traps.c taint: add explicit flag to show whether lock dep is still OK. 2013-01-21 17:17:57 +10:30
unaligned.c
vdso.c
vmlinux.lds.S MIPS: Switch remaining assembler PAGE_SIZE users to <asm/asm-offsets.h>. 2012-12-28 17:04:16 +01:00
vpe.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
watch.c