1
0
Fork 0
alistair23-linux/arch/arm/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
..
.gitignore [ARM] 5194/1: update .gitignore 2008-08-12 19:54:09 +01:00
Makefile ARM: psci: add support for PSCI invocations from the kernel 2013-01-10 21:10:20 +00:00
arch_timer.c ARM: arch_timer: include linux/errno.h 2013-02-15 19:32:03 +01:00
armksyms.c Merge branches 'audit', 'delay', 'fixes', 'misc' and 'sta2x11' into for-linus 2012-07-27 23:06:32 +01:00
arthur.c [ARM] arm/kernel/arthur.c: add MODULE_LICENSE 2008-05-17 22:55:16 +01:00
asm-offsets.c ARM: KVM: arch_timers: Add timer world switch 2013-02-11 19:05:38 +00:00
atags.h ARM: 7506/1: allow for ATAGS to be configured out when DT support is selected 2012-09-03 22:56:15 +01:00
atags_compat.c ARM: 7505/1: split out ATAGS parsing 2012-09-03 22:55:56 +01:00
atags_parse.c ARM: 7505/1: split out ATAGS parsing 2012-09-03 22:55:56 +01:00
atags_proc.c ARM: 7505/1: split out ATAGS parsing 2012-09-03 22:55:56 +01:00
bios32.c ARM: 7648/1: pci: Allow passing per-controller private data 2013-02-16 17:54:25 +00:00
calls.S arm: switch to generic sigaltstack 2013-02-03 18:15:46 -05:00
cpuidle.c cpuidle: Add common time keeping and irq enabling 2012-03-21 01:59:40 -04:00
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
debug.S ARM: compile fix for DEBUG_LL=y && MMU=n 2013-01-16 14:30:06 -08:00
devtree.c ARM: 7585/1: kernel: fix nr_cpu_ids check in DT logical map init 2012-11-23 13:01:31 +00:00
dma-isa.c ARM: dma-isa: request cascade channel after registering it 2009-12-24 18:34:08 +00:00
dma.c locking, ARM: Annotate low level hw locks as raw 2011-09-13 11:12:14 +02:00
early_printk.c ARM: Add an earlyprintk debug console 2009-12-09 10:02:18 +00:00
elf.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
entry-armv.S ARM: Fix undefined instruction exception handling 2012-07-31 12:04:30 +01:00
entry-common.S arm: switch to generic sigaltstack 2013-02-03 18:15:46 -05:00
entry-header.S Merge branch 'devel-stable' into for-next 2011-07-22 23:09:07 +01:00
etm.c ARM: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
fiq.c ARM: fiq: change FIQ_START to a variable 2012-07-01 21:59:19 +08:00
fiqasm.S ARM: 6938/1: fiq: Refactor {get,set}_fiq_regs() for Thumb-2 2011-05-26 10:31:06 +01:00
ftrace.c ARM: 7468/1: ftrace: Trace function entry before updating index 2012-07-31 10:30:42 +01:00
head-common.S arm/dt: Make __vet_atags also accept a dtb image 2011-05-11 15:12:32 +02:00
head-nommu.S ARM: 7591/1: nommu: Enable the strict alignment (CR_A) bit only if ARCH < v6 2012-12-07 11:48:57 +00:00
head.S Merge branch 'for-rmk/virt/hyp-boot/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into fixes 2013-01-19 15:27:30 +00:00
hw_breakpoint.c ARM: hw_breakpoint: Debug powerdown support for self-hosted debug 2013-01-10 21:13:07 +00:00
hyp-stub.S ARM: virt: simplify __hyp_stub_install epilog 2013-01-10 21:08:55 +00:00
insn.c ARM: fix missing bug.h include in arch/arm/kernel/insn.c 2012-03-30 11:51:46 +01:00
insn.h ARM: 7334/1: add jump label support 2012-03-24 09:38:56 +00:00
io.c arm: convert core files from module.h to export.h 2011-10-31 19:30:49 -04:00
irq.c arm: add set_handle_irq() to register the parent IRQ controller handler function 2013-01-10 11:44:38 -06:00
isa.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
iwmmxt.S ARM: pxa: fix logic error in PJ4 iWMMXt handling 2011-08-11 10:10:26 +08:00
jump_label.c ARM: 7334/1: add jump label support 2012-03-24 09:38:56 +00:00
kgdb.c kgdb,arm: fix register dump 2010-10-29 13:14:40 -05:00
kprobes-arm.c ARM: 7181/1: Restrict kprobes probing SWP instructions to ARMv5 and below 2011-11-30 23:54:54 +00:00
kprobes-common.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
kprobes-test-arm.c ARM: kprobes: make more tests conditional 2012-10-09 17:07:43 +02:00
kprobes-test-thumb.c ARM: 7174/1: Fix build error in kprobes test code on Thumb2 kernels 2011-11-26 21:58:53 +00:00
kprobes-test.c treewide: fix printk typo in multiple drivers 2012-11-19 11:08:17 +01:00
kprobes-test.h ARM: 7174/1: Fix build error in kprobes test code on Thumb2 kernels 2011-11-26 21:58:53 +00:00
kprobes-thumb.c ARM: 7423/1: kprobes: run t32_simulate_ldr_literal() without insn slot 2012-06-14 15:11:44 +01:00
kprobes.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
kprobes.h ARM: kprobes: Add exports for test code 2011-09-20 18:17:43 +00:00
machine_kexec.c ARM: 7555/1: kexec: fix segment memory addresses check 2012-10-18 11:05:19 +01:00
module.c ARM: 7059/1: LPAE: Use PMD_(SHIFT|SIZE|MASK) instead of PGDIR_* 2011-08-23 15:30:33 +01:00
opcodes.c ARM: 7206/1: Add generic ARM instruction set condition code checks. 2011-12-13 08:52:02 +00:00
patch.c ARM: 7332/1: extract out code patch function from kprobes 2012-03-24 09:38:55 +00:00
patch.h ARM: 7332/1: extract out code patch function from kprobes 2012-03-24 09:38:55 +00:00
perf_event.c ARM: perf: simplify __hw_perf_event_init err handling 2013-01-18 16:54:30 +00:00
perf_event_cpu.c ARM: perf: handle armpmu_register failing 2013-01-18 13:46:09 +00:00
perf_event_v6.c ARM: perf: don't pretend to support counting of L1I writes 2013-01-16 12:01:59 +00:00
perf_event_v7.c ARM: perf: don't pretend to support counting of L1I writes 2013-01-16 12:01:59 +00:00
perf_event_xscale.c ARM: perf: don't pretend to support counting of L1I writes 2013-01-16 12:01:59 +00:00
pj4-cp0.c arm: remove several unnecessary module.h include instances 2011-10-31 19:30:48 -04:00
process.c ARM idle: delete pm_idle 2013-02-17 23:37:04 -05:00
psci.c ARM: psci: add support for PSCI invocations from the kernel 2013-01-10 21:10:20 +00:00
ptrace.c ARM: 7595/1: syscall: rework ordering in syscall_trace_exit 2012-12-11 00:18:26 +00:00
relocate_kernel.S ARM: 7065/1: kexec: ensure new kernel is entered in ARM state 2011-08-28 10:39:41 +01:00
return_address.c arm: convert core files from module.h to export.h 2011-10-31 19:30:49 -04:00
sched_clock.c ARM: 7643/1: sched: correct update_sched_clock() 2013-02-11 17:33:08 +00:00
setup.c ARM: 7602/1: Pass real "__machine_arch_type" variable to setup_machine_tags() procedure 2012-12-16 10:04:24 +00:00
signal.c arm: switch to struct ksignal * passing 2013-02-14 09:21:16 -05:00
signal.h ARM: 7471/1: Revert "7442/1: Revert "remove unused restart trampoline"" 2012-07-28 11:11:51 +01:00
sleep.S Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
smp.c arm-soc: virtualization changes 2013-02-21 15:40:16 -08:00
smp_scu.c ARM: scu: mask cluster id from cpu_logical_map 2013-01-31 13:54:16 -06:00
smp_tlb.c smp: introduce a generic on_each_cpu_mask() function 2012-03-28 17:14:35 -07:00
smp_twd.c arm-soc: cleanups 2013-02-21 14:58:40 -08:00
stacktrace.c arm: convert core files from module.h to export.h 2011-10-31 19:30:49 -04:00
suspend.c ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-09-25 11:20:26 +01:00
swp_emulate.c ARM: missing ->mmap_sem around find_vma() in swp_emulate.c 2012-12-20 10:40:24 +00:00
sys_arm.c arm: switch to generic fork/vfork/clone 2012-11-28 22:13:54 -05:00
sys_oabi-compat.c userns: Convert stat to return values mapped from kuids and kgids 2012-05-15 14:08:35 -07:00
tcm.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
tcm.h ARM: 5580/2: ARM TCM (Tightly-Coupled Memory) support v3 2009-09-15 22:11:05 +01:00
thumbee.c ARM: 7385/1: ThumbEE: Use cpuid macros to read ID_PFR0 for ThumbEE 2012-04-25 19:49:26 +01:00
time.c ARM: delete struct sys_timer 2012-12-24 09:36:38 -07:00
topology.c ARM: kernel: update topology to use new MPIDR macros 2012-11-19 15:44:33 +00:00
traps.c taint: add explicit flag to show whether lock dep is still OK. 2013-01-21 17:17:57 +10:30
unwind.c ARM: unwinder: fix bisection to find origin in .idx section 2011-12-15 14:02:19 -08:00
vmlinux.lds.S ARM: Section based HYP idmap 2013-01-23 13:29:09 -05:00
xscale-cp0.c arm: remove several unnecessary module.h include instances 2011-10-31 19:30:48 -04:00