linux/arch/mips
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
..
alchemy MIPS: Alchemy: Make 32kHz and r4k timer coexist peacefully 2012-12-27 16:27:35 +01:00
ar7 MIPS: AR7: use part_probe_types to specificy the partition parser to use 2012-12-13 18:15:23 +01:00
ath79 USB: EHCI: remove ehci_port_power() routine 2012-10-31 12:48:07 -07:00
bcm47xx Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-02-08 18:02:14 -05:00
bcm63xx MIPS: BCM63XX: fix nvram checksum calculation 2012-12-12 18:57:49 +01:00
boot MIPS: Alchemy: Single kernel for DB1200/1300/1550 2012-10-11 11:11:20 +02:00
cavium-octeon Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-21 18:06:55 -08:00
cobalt
configs Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-12-14 14:27:45 -08:00
dec MIPS: DEC: use IS_ENABLED() 2012-07-23 13:55:54 +01:00
emma Disintegrate asm/system.h for MIPS 2012-03-28 18:30:02 +01:00
fw MIPS: Kconfig: Rename several firmware related config symbols. 2012-12-13 17:02:14 +01:00
include Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2013-02-23 18:50:11 -08:00
jazz arch/mips/jazz: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:43:12 -08:00
jz4740 MIPS: JZ4740: Forward declare struct uart_port in header. 2012-10-17 17:00:50 +02:00
kernel hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
lantiq Driver core patches for 3.9-rc1 2013-02-21 12:05:51 -08:00
lasat new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
lib MIPS: delay.c: Check BITS_PER_LONG instead of __SIZEOF_LONG__ 2013-01-22 16:53:48 +01:00
loongson MIPS: Loongson 2: Sort out clock managment. 2012-08-01 18:10:06 +02:00
loongson1 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-12-14 14:27:45 -08:00
math-emu MIPS: Fix for warning from FPU emulation code 2012-12-13 18:15:27 +01:00
mm mips: Move __virt_addr_valid() to a place for MIPS 64 2013-01-31 15:14:59 +01:00
mti-malta MIPS: Malta: Fix interupt number of CBUS UART. 2012-11-13 14:50:15 +01:00
mti-sead3 MIPS: drivers: remove __dev* attributes. 2013-01-03 15:57:09 -08:00
netlogic MIPS: Netlogic: Fix UP compilation on XLR 2013-01-30 21:44:18 +01:00
oprofile Merge branch 'mips-next' of http://dev.phrozen.org/githttp/mips-next into mips-for-linux-next 2012-12-13 19:40:13 +01:00
pci Driver core patches for 3.9-rc1 2013-02-21 12:05:51 -08:00
pmc-sierra MIPS: PMC-Sierra Yosemite: Remove support. 2012-12-13 18:15:30 +01:00
pnx833x MIPS: PNX833x: use IS_ENABLED() macro 2012-07-23 13:55:53 +01:00
pnx8550 MIPS: PNX8550: use OHCI platform driver 2012-10-22 11:24:11 -07:00
power MIPS: Switch remaining assembler PAGE_SIZE users to <asm/asm-offsets.h>. 2012-12-28 17:04:16 +01:00
powertv MIPS: PowerTV: Fix build. 2012-12-13 18:15:28 +01:00
rb532 MIPS: RB532: Fix build of prom code. 2012-12-13 18:15:28 +01:00
sgi-ip22 MIPS: IP22/IP28: Fix build of EISA code. 2012-12-13 18:15:28 +01:00
sgi-ip27 arch/mips/sgi-ip27: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:43:12 -08:00
sgi-ip32 Disintegrate asm/system.h for MIPS 2012-03-28 18:30:02 +01:00
sibyte MIPS: Kconfig: Rename several firmware related config symbols. 2012-12-13 17:02:14 +01:00
sni serial: sccnxp: Rename header file to match functionality 2013-01-15 23:00:38 -08:00
txx9 MIPS: drivers: remove __dev* attributes. 2013-01-03 15:57:09 -08:00
vr41xx Disintegrate asm/system.h for MIPS 2012-03-28 18:30:02 +01:00
wrppmc MIPS: wrppmc: Fix build of PCI code. 2012-12-13 18:15:29 +01:00
Kbuild
Kbuild.platforms Merge branch 'ralf-3.7' of git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill into mips-for-linux-next 2012-09-28 16:29:55 +02:00
Kconfig arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
Kconfig.debug Fix typo in various Kconfig file 2012-04-16 14:40:08 +02:00
Makefile MIPS: PMC-Sierra Yosemite: Remove support. 2012-12-13 18:15:30 +01:00