An error occurred while fetching folder content.
hlist: drop the node parameter from iterators
Sasha Levin authored
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...
b67bfe0d
Name Last commit Last update
..
debug kgdb: remove #include <linux/serial_8250.h> from kgdb.h
events hlist: drop the node parameter from iterators
gcov kernel/gcov: remove depends on CONFIG_EXPERIMENTAL
irq Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
power Merge tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
sched hlist: drop the node parameter from iterators
time Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
trace hlist: drop the node parameter from iterators
.gitignore Update kernel/.gitignore with new auto-generated files
Kconfig.freezer container freezer: implement freezer cgroup subsystem
Kconfig.hz sched: fix SCHED_HRTICK dependency
Kconfig.locks locking: Adjust spin lock inlining Kconfig options
Kconfig.preempt locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage
Makefile kcmp: make it depend on CHECKPOINT_RESTORE
acct.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
async.c async: initialise list heads to fix crash
audit.c kernel/audit.c: avoid negative sleep durations
audit.h audit: optimize audit_compare_dname_path
audit_tree.c audit: catch possible NULL audit buffers
audit_watch.c audit: catch possible NULL audit buffers
auditfilter.c audit: fix auditfilter.c kernel-doc warnings
auditsc.c audit: catch possible NULL audit buffers
backtracetest.c backtrace: replace timer with tasklet + completions
bounds.c memcg: remove direct page_cgroup-to-page pointer
capability.c userns: Teach inode_capable to understand inodes whose uids map to other namespaces.
cgroup.c hlist: drop the node parameter from iterators
cgroup_freezer.c cgroup: rename ->create/post_create/pre_destroy/destroy() to ->css_alloc/online/offline/free()
compat.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
configs.c kernel/configs.c: include MODULE_*() when CONFIG_IKCONFIG_PROC=n
context_tracking.c Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
cpu.c Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
cpu_pm.c kernel/cpu_pm.c: fix various typos
cpuset.c Merge branch 'for-3.9-cpuset' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
crash_dump.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
cred.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
delayacct.c cputime: Use accessors to read task cputime stats
dma.c Remove all #inclusions of asm/system.h
elfcore.c elf coredump: add extended numbering support
exec_domain.c sys_personality: remove the bogus checks in sys_personality()->__set_personality() path
exit.c coredump: use a freezable_schedule for the coredump_finish wait
extable.c extable: Skip sorting if sorted at build time.
fork.c fork: unshare: remove dead code
freezer.c freezer: change ptrace_stop/do_signal_stop to use freezable_schedule()
futex.c Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
futex_compat.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
groups.c userns: Convert in_group_p and in_egroup_p to use kgid_t
hrtimer.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
hung_task.c hung task debugging: Inject NMI when hung and going to panic
irq_work.c Merge branch 'nohz/printk-v8' into irq/core
itimer.c itimer: Use printk_once instead of WARN_ONCE
jump_label.c
kallsyms.c
kcmp.c
kexec.c
kmod.c
kprobes.c
ksysfs.c
kthread.c
latencytop.c
lglock.c
lockdep.c
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
modsign_certificate.S
modsign_pubkey.c
module-internal.h
module.c
module_signing.c
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
notifier.c
nsproxy.c
padata.c
panic.c
params.c
pid.c
pid_namespace.c
posix-cpu-timers.c
posix-timers.c
printk.c
profile.c
ptrace.c
range.c
rcu.h
rcupdate.c
rcutiny.c
rcutiny_plugin.h
rcutorture.c
rcutree.c
rcutree.h
rcutree_plugin.h
rcutree_trace.c
relay.c
res_counter.c
resource.c
rtmutex-debug.c
rtmutex-debug.h