kernel-ark/arch/ia64/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 [CPUFREQ] use dynamic debug instead of custom infrastructure 2011-05-04 11:50:57 -04:00
.gitignore
acpi-ext.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
acpi.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
asm-offsets.c cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
audit.c [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
brl_emu.c
crash_dump.c crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr_addr, setup_elfcorehdr and saved_max_pfn 2011-03-23 19:47:19 -07:00
crash.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
cyclone.c ia64: Replace clocksource.fsys_mmio with generic arch data 2011-07-14 17:57:09 -07:00
dma-mapping.c ia64: Add export.h to arch/ia64 specific files as required 2011-10-31 19:30:58 -04:00
efi_stub.S
efi.c /dev/mem: use phys_addr_t for physical addresses 2012-10-24 15:32:50 -07:00
elfcore.c elf coredump: add extended numbering support 2010-03-06 11:26:46 -08:00
entry.h
entry.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
err_inject.c cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
esi_stub.S
esi.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
fsys.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
fsyscall_gtod_data.h ia64: vsyscall: Use seqcount instead of seqlock 2012-03-15 18:17:59 -07:00
ftrace.c
gate-data.S Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
gate.lds.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
gate.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
head.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
ia64_ksyms.c treewide: Put a space between #include and FILE 2012-06-28 11:44:36 +02:00
init_task.c Rename .data.init_task to .data..init_task. 2010-03-03 11:25:58 +01:00
iosapic.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
irq_ia64.c random: remove rand_initialize_irq() 2012-07-19 10:38:32 -04:00
irq_lsapic.c ia64: Convert lsapic to new irq_chip functions 2011-03-29 14:48:02 +02:00
irq.c ia64: Use generic show_interrupts() 2011-03-29 14:48:05 +02:00
ivt.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
jprobes.S
kprobes.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
machine_kexec.c [IA64] kexec: Move the dereference below the NULL test 2012-09-10 14:31:23 -07:00
machvec.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
Makefile iommu: Rename the DMAR and INTR_REMAP config options 2011-09-21 10:22:03 +02:00
Makefile.gate Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
mca_asm.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
mca_drv_asm.S
mca_drv.c userns: On ia64 deal with current_uid and current_gid being kuid and kgid 2012-09-21 03:13:29 -07:00
mca_drv.h
mca.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-28 17:19:28 -07:00
minstate.h cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
msi_ia64.c arch/ia64: remove references to cpu_*_map 2012-03-28 17:14:36 -07:00
nr-irqs.c
numa.c
pal.S
palinfo.c [IA64] Use static const char * const in palinfo.c 2010-09-23 14:22:05 -07:00
paravirt_inst.h
paravirt_patch.c ia64/pv_op/binarypatch: add helper functions to support binary patching for paravirt_ops. 2009-03-26 11:02:31 -07:00
paravirt_patchlist.c [IA64] Fix build error in paravirt_patchlist.c 2009-06-17 09:04:40 -07:00
paravirt_patchlist.h ia64/pv_ops: gate page paravirtualization. 2009-03-26 10:51:02 -07:00
paravirt.c static keys: Introduce 'struct static_key', static_key_true()/false() and static_key_slow_[inc|dec]() 2012-02-24 10:05:59 +01:00
paravirtentry.S Rename .data.read_mostly to .data..read_mostly. 2010-03-03 11:26:00 +01:00
patch.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
pci-dma.c iommu: Remove group_mf 2012-06-25 13:48:30 +02:00
pci-swiotlb.c X86 & IA64: adapt for dma_map_ops changes 2012-03-28 16:36:31 +02:00
perfmon_default_smpl.c Fix common misspellings 2011-03-31 11:26:23 -03:00
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
perfmon.c fs: Preserve error code in get_empty_filp(), part 2 2013-02-22 23:31:32 -05:00
process.c ia64 idle: delete pm_idle 2013-02-17 23:37:06 -05:00
ptrace.c ia64: kill thread_matches(), unexport ptrace_check_attach() 2013-01-20 12:26:05 -08:00
relocate_kernel.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
sal.c
salinfo.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
setup.c ia64 idle: delete pm_idle 2013-02-17 23:37:06 -05:00
sigframe.h
signal.c ia64: switch to generic sigaltstack 2013-02-03 18:15:58 -05:00
smp.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-28 17:19:28 -07:00
smpboot.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
stacktrace.c [IA64] Add CONFIG_STACKTRACE_SUPPORT 2010-09-23 13:52:07 -07:00
sys_ia64.c mm: use vm_unmapped_area() on ia64 architecture 2013-02-22 13:46:59 -08:00
time.c kvm: Prepare to add generic guest entry/exit callbacks 2013-01-27 20:35:40 +01:00
topology.c [IA64] Resolve name space collision for cache_show() 2012-11-07 15:51:04 -08:00
traps.c taint: add explicit flag to show whether lock dep is still OK. 2013-01-21 17:17:57 +10:30
unaligned.c [IA64] use __ratelimit 2010-05-18 14:45:54 -07:00
uncached.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
unwind_decoder.c
unwind_i.h
unwind.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
vmlinux.lds.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00