linux_dsm_epyc7002/drivers/net/ethernet/mellanox/mlx4
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
..
alloc.c mlx4_core: Change bitmap allocator to work in round-robin fashion 2012-05-14 13:44:38 -07:00
catas.c mlx4: Add support for EEH error recovery 2012-07-25 15:24:13 -07:00
cmd.c mlx4_core: Fix potential deadlock in mlx4_eq_int() 2012-11-29 12:14:54 -08:00
cq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00
en_cq.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
en_dcb_nl.c net/mlx4_en: Can set maxrate only for TC0 2012-11-28 11:15:32 -05:00
en_ethtool.c drivers: net: Remove remaining alloc/OOM messages 2013-02-08 17:44:39 -05:00
en_main.c Main batch of InfiniBand/RDMA changes for 3.9: 2013-02-26 11:41:08 -08:00
en_netdev.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
en_port.c mlx4: Ethernet port management modifications 2011-12-13 13:56:07 -05:00
en_port.h net/mlx4_core: set port QoS attributes 2012-04-05 05:08:03 -04:00
en_resources.c net/mlx4_en: Force user priority by QP attribute 2012-04-05 05:08:03 -04:00
en_rx.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
en_selftest.c net/mlx4_en: Optimize loopback related checks in data path 2013-02-07 23:26:12 -05:00
en_tx.c mlx4_en: Fix BQL reset TX queue call point 2013-02-07 23:33:51 -05:00
eq.c First batch of InfiniBand/RDMA changes for the 3.8 merge window: 2012-12-13 19:19:09 -08:00
fw.c Main batch of InfiniBand/RDMA changes for 3.9: 2013-02-26 11:41:08 -08:00
fw.h Main batch of InfiniBand/RDMA changes for 3.9: 2013-02-26 11:41:08 -08:00
icm.c mlx4_core: Fix integer overflows so 8TBs of memory registration works 2012-09-13 17:52:02 -07:00
icm.h mlx4_core: Fix integer overflows so 8TBs of memory registration works 2012-09-13 17:52:02 -07:00
intf.c mlx4: Use port management change event instead of smp_snoop 2012-07-10 09:47:10 -07:00
Kconfig mlx4_en: Remove remnants of LRO support 2012-11-19 19:13:59 -05:00
main.c Main batch of InfiniBand/RDMA changes for 3.9: 2013-02-26 11:41:08 -08:00
Makefile net/mlx4_en: DCB QoS support 2012-04-05 05:08:04 -04:00
mcg.c net/mlx4_core: Set correctly allow_loopback flag 2013-01-31 12:48:46 -05:00
mlx4_en.h net/mlx4_en: Add unicast MAC filtering 2013-02-07 23:26:13 -05:00
mlx4.h Main batch of InfiniBand/RDMA changes for 3.9: 2013-02-26 11:41:08 -08:00
mr.c mlx4: Implement memory windows allocation and deallocation 2013-02-25 10:44:32 -08:00
pd.c net/mlx4_core: Add XRC domains and counters to resource tracker 2012-05-16 00:56:59 -04:00
port.c net/mlx4: Move Ethernet related functionality from mlx4_core to mlx4_en 2013-02-07 23:26:12 -05:00
profile.c mlx4_core: Fix integer overflow issues around MTT table 2012-08-15 21:05:26 -07:00
qp.c mlx4: Modify proxy/tunnel QP mechanism so that guests do no calculations 2012-09-30 20:33:43 -07:00
reset.c mlx4: Use PCI Express Capability accessors 2012-08-23 10:11:13 -06:00
resource_tracker.c Main batch of InfiniBand/RDMA changes for 3.9: 2013-02-26 11:41:08 -08:00
sense.c Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
srq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00