linux/arch/arm
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
..
boot MMC highlights for 3.9: 2013-02-26 09:31:09 -08:00
common ARM: GIC: fix GIC cpumask initialization 2013-02-08 10:17:22 +00:00
configs Merge branch 'akpm' (incoming from Andrew) 2013-02-21 17:38:49 -08:00
crypto ARM: 7626/1: arm/crypto: Make asm SHA-1 and AES code Thumb-2 compatible 2013-01-13 12:41:22 +00:00
include Merge branch 'for-v3.9' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping 2013-02-26 10:45:25 -08:00
kernel hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
kvm ARM: KVM: fix compilation after removal of user_alloc from struct kvm_memory_slot 2013-02-25 11:48:41 +02:00
lib
mach-at91 arm-soc: device tree conversions 2013-02-21 15:38:49 -08:00
mach-bcm Merge remote-tracking branches 'arm-soc/irqchip/gic-vic-move' and 'arm-soc/timer/cleanup' into soc 2013-01-24 17:57:20 +09:00
mach-bcm2835 arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
mach-clps711x The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-cns3xxx The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-davinci Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2013-02-24 17:35:10 -08:00
mach-dove The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-ebsa110 The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-ep93xx The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-exynos IOMMU Updates for Linux v3.9 2013-02-26 11:09:17 -08:00
mach-footbridge The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-gemini The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-h720x The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-highbank arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-imx arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
mach-integrator arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-iop13xx The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-iop32x The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-iop33x The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-ixp4xx The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-kirkwood arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
mach-ks8695 The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-l7200/include/mach
mach-lpc32xx The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-mmp Merge branch 'akpm' (incoming from Andrew) 2013-02-21 17:38:49 -08:00
mach-msm arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-mv78xx0 The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-mvebu arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-mxs arm-soc: device tree conversions 2013-02-21 15:38:49 -08:00
mach-netx The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-nomadik arm-soc: device tree conversions 2013-02-21 15:38:49 -08:00
mach-omap1 arm-soc: board specific changes 2013-02-21 15:33:45 -08:00
mach-omap2 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2013-02-26 09:29:02 -08:00
mach-orion5x The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-picoxcell Merge remote-tracking branches 'arm-soc/irqchip/gic-vic-move' and 'arm-soc/timer/cleanup' into soc 2013-01-24 17:57:20 +09:00
mach-prima2 arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
mach-pxa GPIO changes for Linux 3.9 2013-02-26 09:35:29 -08:00
mach-realview arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-rpc The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-s3c24xx arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-s3c64xx Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-02-26 09:24:48 -08:00
mach-s5p64x0 arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-s5pc100 Merge remote-tracking branches 'arm-soc/irqchip/gic-vic-move' and 'arm-soc/timer/cleanup' into soc 2013-01-24 17:57:20 +09:00
mach-s5pv210 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2013-02-24 17:35:10 -08:00
mach-sa1100 arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-shark The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
mach-shmobile IOMMU Updates for Linux v3.9 2013-02-26 11:09:17 -08:00
mach-socfpga Merge branch 'socfpga/hw' into next/soc 2013-02-11 19:37:51 -08:00
mach-spear3xx Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-02-26 09:24:48 -08:00
mach-spear6xx Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-02-26 09:24:48 -08:00
mach-spear13xx Revert "ARM: SPEAr13xx: Pass DW DMAC platform data from DT" 2013-02-20 15:48:02 +05:30
mach-sunxi arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-tegra arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
mach-u300 arm-soc: driver specific changes 2013-02-21 15:12:18 -08:00
mach-ux500 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2013-02-26 09:29:02 -08:00
mach-versatile arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-vexpress Merge remote-tracking branch 'korg_arm-soc/timer/cleanup' into for-3.9/cleanup 2013-01-28 10:20:34 -07:00
mach-virt ARM: mach-virt: fixup machine descriptor after removal of sys_timer 2013-02-11 10:39:30 -08:00
mach-vt8500 arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
mach-w90x900 arm-soc: cleanups 2013-02-21 14:58:40 -08:00
mach-zynq arm: zynq: Add missing irqchip.h to common.c 2013-01-29 10:55:28 -08:00
mm Merge branch 'for-v3.9' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping 2013-02-26 10:45:25 -08:00
net ARM: net: bpf_jit: fix emit_swap16() for non ARMv6+. 2013-02-14 13:26:44 -05:00
nwfpe
oprofile
plat-iop ARM: use clockevents_config_and_register() where possible 2013-01-14 10:12:42 -08:00
plat-omap arm-soc: multiplatform support 2013-02-21 15:20:41 -08:00
plat-orion arm-soc: cleanups 2013-02-21 14:58:40 -08:00
plat-pxa ARM: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
plat-samsung arm-soc: cleanups 2013-02-21 14:58:40 -08:00
plat-spear arm-soc: driver specific changes 2013-02-21 15:12:18 -08:00
plat-versatile Merge branch 'for-arm-soc/arch-timers' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into kvm-arm/timer 2013-02-11 19:03:52 +00:00
tools
vfp ARM: 7627/1: Predicate preempt logic on PREEMP_COUNT not PREEMPT alone 2013-01-16 16:51:10 +00:00
xen xen: implement updated XENMEM_add_to_physmap_range ABI 2013-02-19 22:01:55 -05:00
Kconfig arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
Kconfig-nommu
Kconfig.debug arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
Makefile arm-soc: virtualization changes 2013-02-21 15:40:16 -08:00