aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2013-02-27 20:06:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:24 -0500
commitb67bfe0d42cac56c512dd5da4b1b347a23f4b70a (patch)
tree3d465aea12b97683f26ffa38eba8744469de9997 /drivers/net/ethernet
parent1e142b29e210b5dfb2deeb6ce2210b60af16d2a6 (diff)
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c18
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c8
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c17
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_rx.c4
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c10
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c10
-rw-r--r--drivers/net/ethernet/sun/sunvnet.c3
7 files changed, 34 insertions, 36 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index f4d2e9e3c6d5..c3f1afd86906 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -2197,13 +2197,13 @@ static int ixgbe_get_ethtool_fdir_entry(struct ixgbe_adapter *adapter,
2197 union ixgbe_atr_input *mask = &adapter->fdir_mask; 2197 union ixgbe_atr_input *mask = &adapter->fdir_mask;
2198 struct ethtool_rx_flow_spec *fsp = 2198 struct ethtool_rx_flow_spec *fsp =
2199 (struct ethtool_rx_flow_spec *)&cmd->fs; 2199 (struct ethtool_rx_flow_spec *)&cmd->fs;
2200 struct hlist_node *node, *node2; 2200 struct hlist_node *node2;
2201 struct ixgbe_fdir_filter *rule = NULL; 2201 struct ixgbe_fdir_filter *rule = NULL;
2202 2202
2203 /* report total rule count */ 2203 /* report total rule count */
2204 cmd->data = (1024 << adapter->fdir_pballoc) - 2; 2204 cmd->data = (1024 << adapter->fdir_pballoc) - 2;
2205 2205
2206 hlist_for_each_entry_safe(rule, node, node2, 2206 hlist_for_each_entry_safe(rule, node2,
2207 &adapter->fdir_filter_list, fdir_node) { 2207 &adapter->fdir_filter_list, fdir_node) {
2208 if (fsp->location <= rule->sw_idx) 2208 if (fsp->location <= rule->sw_idx)
2209 break; 2209 break;
@@ -2264,14 +2264,14 @@ static int ixgbe_get_ethtool_fdir_all(struct ixgbe_adapter *adapter,
2264 struct ethtool_rxnfc *cmd, 2264 struct ethtool_rxnfc *cmd,
2265 u32 *rule_locs) 2265 u32 *rule_locs)
2266{ 2266{
2267 struct hlist_node *node, *node2; 2267 struct hlist_node *node2;
2268 struct ixgbe_fdir_filter *rule; 2268 struct ixgbe_fdir_filter *rule;
2269 int cnt = 0; 2269 int cnt = 0;
2270 2270
2271 /* report total rule count */ 2271 /* report total rule count */
2272 cmd->data = (1024 << adapter->fdir_pballoc) - 2; 2272 cmd->data = (1024 << adapter->fdir_pballoc) - 2;
2273 2273
2274 hlist_for_each_entry_safe(rule, node, node2, 2274 hlist_for_each_entry_safe(rule, node2,
2275 &adapter->fdir_filter_list, fdir_node) { 2275 &adapter->fdir_filter_list, fdir_node) {
2276 if (cnt == cmd->rule_cnt) 2276 if (cnt == cmd->rule_cnt)
2277 return -EMSGSIZE; 2277 return -EMSGSIZE;
@@ -2358,19 +2358,19 @@ static int ixgbe_update_ethtool_fdir_entry(struct ixgbe_adapter *adapter,
2358 u16 sw_idx) 2358 u16 sw_idx)
2359{ 2359{
2360 struct ixgbe_hw *hw = &adapter->hw; 2360 struct ixgbe_hw *hw = &adapter->hw;
2361 struct hlist_node *node, *node2, *parent; 2361 struct hlist_node *node2;
2362 struct ixgbe_fdir_filter *rule; 2362 struct ixgbe_fdir_filter *rule, *parent;
2363 int err = -EINVAL; 2363 int err = -EINVAL;
2364 2364
2365 parent = NULL; 2365 parent = NULL;
2366 rule = NULL; 2366 rule = NULL;
2367 2367
2368 hlist_for_each_entry_safe(rule, node, node2, 2368 hlist_for_each_entry_safe(rule, node2,
2369 &adapter->fdir_filter_list, fdir_node) { 2369 &adapter->fdir_filter_list, fdir_node) {
2370 /* hash found, or no matching entry */ 2370 /* hash found, or no matching entry */
2371 if (rule->sw_idx >= sw_idx) 2371 if (rule->sw_idx >= sw_idx)
2372 break; 2372 break;
2373 parent = node; 2373 parent = rule;
2374 } 2374 }
2375 2375
2376 /* if there is an old rule occupying our place remove it */ 2376 /* if there is an old rule occupying our place remove it */
@@ -2399,7 +2399,7 @@ static int ixgbe_update_ethtool_fdir_entry(struct ixgbe_adapter *adapter,
2399 2399
2400 /* add filter to the list */ 2400 /* add filter to the list */
2401 if (parent) 2401 if (parent)
2402 hlist_add_after(parent, &input->fdir_node); 2402 hlist_add_after(&parent->fdir_node, &input->fdir_node);
2403 else 2403 else
2404 hlist_add_head(&input->fdir_node, 2404 hlist_add_head(&input->fdir_node,
2405 &adapter->fdir_filter_list); 2405 &adapter->fdir_filter_list);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 68478d6dfa2d..db5611ae407e 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -3891,7 +3891,7 @@ static void ixgbe_configure_pb(struct ixgbe_adapter *adapter)
3891static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) 3891static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
3892{ 3892{
3893 struct ixgbe_hw *hw = &adapter->hw; 3893 struct ixgbe_hw *hw = &adapter->hw;
3894 struct hlist_node *node, *node2; 3894 struct hlist_node *node2;
3895 struct ixgbe_fdir_filter *filter; 3895 struct ixgbe_fdir_filter *filter;
3896 3896
3897 spin_lock(&adapter->fdir_perfect_lock); 3897 spin_lock(&adapter->fdir_perfect_lock);
@@ -3899,7 +3899,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
3899 if (!hlist_empty(&adapter->fdir_filter_list)) 3899 if (!hlist_empty(&adapter->fdir_filter_list))
3900 ixgbe_fdir_set_input_mask_82599(hw, &adapter->fdir_mask); 3900 ixgbe_fdir_set_input_mask_82599(hw, &adapter->fdir_mask);
3901 3901
3902 hlist_for_each_entry_safe(filter, node, node2, 3902 hlist_for_each_entry_safe(filter, node2,
3903 &adapter->fdir_filter_list, fdir_node) { 3903 &adapter->fdir_filter_list, fdir_node) {
3904 ixgbe_fdir_write_perfect_filter_82599(hw, 3904 ixgbe_fdir_write_perfect_filter_82599(hw,
3905 &filter->filter, 3905 &filter->filter,
@@ -4356,12 +4356,12 @@ static void ixgbe_clean_all_tx_rings(struct ixgbe_adapter *adapter)
4356 4356
4357static void ixgbe_fdir_filter_exit(struct ixgbe_adapter *adapter) 4357static void ixgbe_fdir_filter_exit(struct ixgbe_adapter *adapter)
4358{ 4358{
4359 struct hlist_node *node, *node2; 4359 struct hlist_node *node2;
4360 struct ixgbe_fdir_filter *filter; 4360 struct ixgbe_fdir_filter *filter;
4361 4361
4362 spin_lock(&adapter->fdir_perfect_lock); 4362 spin_lock(&adapter->fdir_perfect_lock);
4363 4363
4364 hlist_for_each_entry_safe(filter, node, node2, 4364 hlist_for_each_entry_safe(filter, node2,
4365 &adapter->fdir_filter_list, fdir_node) { 4365 &adapter->fdir_filter_list, fdir_node) {
4366 hlist_del(&filter->fdir_node); 4366 hlist_del(&filter->fdir_node);
4367 kfree(filter); 4367 kfree(filter);
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 5385474bb526..bb4d8d99f36d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -225,11 +225,10 @@ static inline struct mlx4_en_filter *
225mlx4_en_filter_find(struct mlx4_en_priv *priv, __be32 src_ip, __be32 dst_ip, 225mlx4_en_filter_find(struct mlx4_en_priv *priv, __be32 src_ip, __be32 dst_ip,
226 __be16 src_port, __be16 dst_port) 226 __be16 src_port, __be16 dst_port)
227{ 227{
228 struct hlist_node *elem;
229 struct mlx4_en_filter *filter; 228 struct mlx4_en_filter *filter;
230 struct mlx4_en_filter *ret = NULL; 229 struct mlx4_en_filter *ret = NULL;
231 230
232 hlist_for_each_entry(filter, elem, 231 hlist_for_each_entry(filter,
233 filter_hash_bucket(priv, src_ip, dst_ip, 232 filter_hash_bucket(priv, src_ip, dst_ip,
234 src_port, dst_port), 233 src_port, dst_port),
235 filter_chain) { 234 filter_chain) {
@@ -574,13 +573,13 @@ static void mlx4_en_put_qp(struct mlx4_en_priv *priv)
574 573
575 if (dev->caps.steering_mode != MLX4_STEERING_MODE_A0) { 574 if (dev->caps.steering_mode != MLX4_STEERING_MODE_A0) {
576 struct mlx4_mac_entry *entry; 575 struct mlx4_mac_entry *entry;
577 struct hlist_node *n, *tmp; 576 struct hlist_node *tmp;
578 struct hlist_head *bucket; 577 struct hlist_head *bucket;
579 unsigned int mac_hash; 578 unsigned int mac_hash;
580 579
581 mac_hash = priv->dev->dev_addr[MLX4_EN_MAC_HASH_IDX]; 580 mac_hash = priv->dev->dev_addr[MLX4_EN_MAC_HASH_IDX];
582 bucket = &priv->mac_hash[mac_hash]; 581 bucket = &priv->mac_hash[mac_hash];
583 hlist_for_each_entry_safe(entry, n, tmp, bucket, hlist) { 582 hlist_for_each_entry_safe(entry, tmp, bucket, hlist) {
584 if (ether_addr_equal_64bits(entry->mac, 583 if (ether_addr_equal_64bits(entry->mac,
585 priv->dev->dev_addr)) { 584 priv->dev->dev_addr)) {
586 en_dbg(DRV, priv, "Releasing qp: port %d, MAC %pM, qpn %d\n", 585 en_dbg(DRV, priv, "Releasing qp: port %d, MAC %pM, qpn %d\n",
@@ -609,11 +608,11 @@ static int mlx4_en_replace_mac(struct mlx4_en_priv *priv, int qpn,
609 struct hlist_head *bucket; 608 struct hlist_head *bucket;
610 unsigned int mac_hash; 609 unsigned int mac_hash;
611 struct mlx4_mac_entry *entry; 610 struct mlx4_mac_entry *entry;
612 struct hlist_node *n, *tmp; 611 struct hlist_node *tmp;
613 u64 prev_mac_u64 = mlx4_en_mac_to_u64(prev_mac); 612 u64 prev_mac_u64 = mlx4_en_mac_to_u64(prev_mac);
614 613
615 bucket = &priv->mac_hash[prev_mac[MLX4_EN_MAC_HASH_IDX]]; 614 bucket = &priv->mac_hash[prev_mac[MLX4_EN_MAC_HASH_IDX]];
616 hlist_for_each_entry_safe(entry, n, tmp, bucket, hlist) { 615 hlist_for_each_entry_safe(entry, tmp, bucket, hlist) {
617 if (ether_addr_equal_64bits(entry->mac, prev_mac)) { 616 if (ether_addr_equal_64bits(entry->mac, prev_mac)) {
618 mlx4_en_uc_steer_release(priv, entry->mac, 617 mlx4_en_uc_steer_release(priv, entry->mac,
619 qpn, entry->reg_id); 618 qpn, entry->reg_id);
@@ -1019,7 +1018,7 @@ static void mlx4_en_do_uc_filter(struct mlx4_en_priv *priv,
1019{ 1018{
1020 struct netdev_hw_addr *ha; 1019 struct netdev_hw_addr *ha;
1021 struct mlx4_mac_entry *entry; 1020 struct mlx4_mac_entry *entry;
1022 struct hlist_node *n, *tmp; 1021 struct hlist_node *tmp;
1023 bool found; 1022 bool found;
1024 u64 mac; 1023 u64 mac;
1025 int err = 0; 1024 int err = 0;
@@ -1035,7 +1034,7 @@ static void mlx4_en_do_uc_filter(struct mlx4_en_priv *priv,
1035 /* find what to remove */ 1034 /* find what to remove */
1036 for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) { 1035 for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) {
1037 bucket = &priv->mac_hash[i]; 1036 bucket = &priv->mac_hash[i];
1038 hlist_for_each_entry_safe(entry, n, tmp, bucket, hlist) { 1037 hlist_for_each_entry_safe(entry, tmp, bucket, hlist) {
1039 found = false; 1038 found = false;
1040 netdev_for_each_uc_addr(ha, dev) { 1039 netdev_for_each_uc_addr(ha, dev) {
1041 if (ether_addr_equal_64bits(entry->mac, 1040 if (ether_addr_equal_64bits(entry->mac,
@@ -1078,7 +1077,7 @@ static void mlx4_en_do_uc_filter(struct mlx4_en_priv *priv,
1078 netdev_for_each_uc_addr(ha, dev) { 1077 netdev_for_each_uc_addr(ha, dev) {
1079 found = false; 1078 found = false;
1080 bucket = &priv->mac_hash[ha->addr[MLX4_EN_MAC_HASH_IDX]]; 1079 bucket = &priv->mac_hash[ha->addr[MLX4_EN_MAC_HASH_IDX]];
1081 hlist_for_each_entry(entry, n, bucket, hlist) { 1080 hlist_for_each_entry(entry, bucket, hlist) {
1082 if (ether_addr_equal_64bits(entry->mac, ha->addr)) { 1081 if (ether_addr_equal_64bits(entry->mac, ha->addr)) {
1083 found = true; 1082 found = true;
1084 break; 1083 break;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index ce38654bbdd0..c7f856308e1a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -35,6 +35,7 @@
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/mlx4/qp.h> 36#include <linux/mlx4/qp.h>
37#include <linux/skbuff.h> 37#include <linux/skbuff.h>
38#include <linux/rculist.h>
38#include <linux/if_ether.h> 39#include <linux/if_ether.h>
39#include <linux/if_vlan.h> 40#include <linux/if_vlan.h>
40#include <linux/vmalloc.h> 41#include <linux/vmalloc.h>
@@ -617,7 +618,6 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
617 618
618 if (is_multicast_ether_addr(ethh->h_dest)) { 619 if (is_multicast_ether_addr(ethh->h_dest)) {
619 struct mlx4_mac_entry *entry; 620 struct mlx4_mac_entry *entry;
620 struct hlist_node *n;
621 struct hlist_head *bucket; 621 struct hlist_head *bucket;
622 unsigned int mac_hash; 622 unsigned int mac_hash;
623 623
@@ -625,7 +625,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
625 mac_hash = ethh->h_source[MLX4_EN_MAC_HASH_IDX]; 625 mac_hash = ethh->h_source[MLX4_EN_MAC_HASH_IDX];
626 bucket = &priv->mac_hash[mac_hash]; 626 bucket = &priv->mac_hash[mac_hash];
627 rcu_read_lock(); 627 rcu_read_lock();
628 hlist_for_each_entry_rcu(entry, n, bucket, hlist) { 628 hlist_for_each_entry_rcu(entry, bucket, hlist) {
629 if (ether_addr_equal_64bits(entry->mac, 629 if (ether_addr_equal_64bits(entry->mac,
630 ethh->h_source)) { 630 ethh->h_source)) {
631 rcu_read_unlock(); 631 rcu_read_unlock();
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 325e11e1ce0f..f89cc7a3fe6c 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -576,7 +576,7 @@ void qlcnic_free_mac_list(struct qlcnic_adapter *adapter)
576void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter) 576void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter)
577{ 577{
578 struct qlcnic_filter *tmp_fil; 578 struct qlcnic_filter *tmp_fil;
579 struct hlist_node *tmp_hnode, *n; 579 struct hlist_node *n;
580 struct hlist_head *head; 580 struct hlist_head *head;
581 int i; 581 int i;
582 unsigned long time; 582 unsigned long time;
@@ -584,7 +584,7 @@ void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter)
584 584
585 for (i = 0; i < adapter->fhash.fbucket_size; i++) { 585 for (i = 0; i < adapter->fhash.fbucket_size; i++) {
586 head = &(adapter->fhash.fhead[i]); 586 head = &(adapter->fhash.fhead[i]);
587 hlist_for_each_entry_safe(tmp_fil, tmp_hnode, n, head, fnode) { 587 hlist_for_each_entry_safe(tmp_fil, n, head, fnode) {
588 cmd = tmp_fil->vlan_id ? QLCNIC_MAC_VLAN_DEL : 588 cmd = tmp_fil->vlan_id ? QLCNIC_MAC_VLAN_DEL :
589 QLCNIC_MAC_DEL; 589 QLCNIC_MAC_DEL;
590 time = tmp_fil->ftime; 590 time = tmp_fil->ftime;
@@ -604,7 +604,7 @@ void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter)
604 for (i = 0; i < adapter->rx_fhash.fbucket_size; i++) { 604 for (i = 0; i < adapter->rx_fhash.fbucket_size; i++) {
605 head = &(adapter->rx_fhash.fhead[i]); 605 head = &(adapter->rx_fhash.fhead[i]);
606 606
607 hlist_for_each_entry_safe(tmp_fil, tmp_hnode, n, head, fnode) 607 hlist_for_each_entry_safe(tmp_fil, n, head, fnode)
608 { 608 {
609 time = tmp_fil->ftime; 609 time = tmp_fil->ftime;
610 if (jiffies > (QLCNIC_FILTER_AGE * HZ + time)) { 610 if (jiffies > (QLCNIC_FILTER_AGE * HZ + time)) {
@@ -621,14 +621,14 @@ void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter)
621void qlcnic_delete_lb_filters(struct qlcnic_adapter *adapter) 621void qlcnic_delete_lb_filters(struct qlcnic_adapter *adapter)
622{ 622{
623 struct qlcnic_filter *tmp_fil; 623 struct qlcnic_filter *tmp_fil;
624 struct hlist_node *tmp_hnode, *n; 624 struct hlist_node *n;
625 struct hlist_head *head; 625 struct hlist_head *head;
626 int i; 626 int i;
627 u8 cmd; 627 u8 cmd;
628 628
629 for (i = 0; i < adapter->fhash.fbucket_size; i++) { 629 for (i = 0; i < adapter->fhash.fbucket_size; i++) {
630 head = &(adapter->fhash.fhead[i]); 630 head = &(adapter->fhash.fhead[i]);
631 hlist_for_each_entry_safe(tmp_fil, tmp_hnode, n, head, fnode) { 631 hlist_for_each_entry_safe(tmp_fil, n, head, fnode) {
632 cmd = tmp_fil->vlan_id ? QLCNIC_MAC_VLAN_DEL : 632 cmd = tmp_fil->vlan_id ? QLCNIC_MAC_VLAN_DEL :
633 QLCNIC_MAC_DEL; 633 QLCNIC_MAC_DEL;
634 qlcnic_sre_macaddr_change(adapter, 634 qlcnic_sre_macaddr_change(adapter,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 6387e0cc3ea9..0e630061bff3 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -162,7 +162,7 @@ void qlcnic_add_lb_filter(struct qlcnic_adapter *adapter, struct sk_buff *skb,
162{ 162{
163 struct ethhdr *phdr = (struct ethhdr *)(skb->data); 163 struct ethhdr *phdr = (struct ethhdr *)(skb->data);
164 struct qlcnic_filter *fil, *tmp_fil; 164 struct qlcnic_filter *fil, *tmp_fil;
165 struct hlist_node *tmp_hnode, *n; 165 struct hlist_node *n;
166 struct hlist_head *head; 166 struct hlist_head *head;
167 unsigned long time; 167 unsigned long time;
168 u64 src_addr = 0; 168 u64 src_addr = 0;
@@ -179,7 +179,7 @@ void qlcnic_add_lb_filter(struct qlcnic_adapter *adapter, struct sk_buff *skb,
179 (adapter->fhash.fbucket_size - 1); 179 (adapter->fhash.fbucket_size - 1);
180 head = &(adapter->rx_fhash.fhead[hindex]); 180 head = &(adapter->rx_fhash.fhead[hindex]);
181 181
182 hlist_for_each_entry_safe(tmp_fil, tmp_hnode, n, head, fnode) { 182 hlist_for_each_entry_safe(tmp_fil, n, head, fnode) {
183 if (!memcmp(tmp_fil->faddr, &src_addr, ETH_ALEN) && 183 if (!memcmp(tmp_fil->faddr, &src_addr, ETH_ALEN) &&
184 tmp_fil->vlan_id == vlan_id) { 184 tmp_fil->vlan_id == vlan_id) {
185 time = tmp_fil->ftime; 185 time = tmp_fil->ftime;
@@ -205,7 +205,7 @@ void qlcnic_add_lb_filter(struct qlcnic_adapter *adapter, struct sk_buff *skb,
205 (adapter->fhash.fbucket_size - 1); 205 (adapter->fhash.fbucket_size - 1);
206 head = &(adapter->rx_fhash.fhead[hindex]); 206 head = &(adapter->rx_fhash.fhead[hindex]);
207 spin_lock(&adapter->rx_mac_learn_lock); 207 spin_lock(&adapter->rx_mac_learn_lock);
208 hlist_for_each_entry_safe(tmp_fil, tmp_hnode, n, head, fnode) { 208 hlist_for_each_entry_safe(tmp_fil, n, head, fnode) {
209 if (!memcmp(tmp_fil->faddr, &src_addr, ETH_ALEN) && 209 if (!memcmp(tmp_fil->faddr, &src_addr, ETH_ALEN) &&
210 tmp_fil->vlan_id == vlan_id) { 210 tmp_fil->vlan_id == vlan_id) {
211 found = 1; 211 found = 1;
@@ -272,7 +272,7 @@ static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
272 struct sk_buff *skb) 272 struct sk_buff *skb)
273{ 273{
274 struct qlcnic_filter *fil, *tmp_fil; 274 struct qlcnic_filter *fil, *tmp_fil;
275 struct hlist_node *tmp_hnode, *n; 275 struct hlist_node *n;
276 struct hlist_head *head; 276 struct hlist_head *head;
277 struct net_device *netdev = adapter->netdev; 277 struct net_device *netdev = adapter->netdev;
278 struct ethhdr *phdr = (struct ethhdr *)(skb->data); 278 struct ethhdr *phdr = (struct ethhdr *)(skb->data);
@@ -294,7 +294,7 @@ static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
294 hindex = qlcnic_mac_hash(src_addr) & (adapter->fhash.fbucket_size - 1); 294 hindex = qlcnic_mac_hash(src_addr) & (adapter->fhash.fbucket_size - 1);
295 head = &(adapter->fhash.fhead[hindex]); 295 head = &(adapter->fhash.fhead[hindex]);
296 296
297 hlist_for_each_entry_safe(tmp_fil, tmp_hnode, n, head, fnode) { 297 hlist_for_each_entry_safe(tmp_fil, n, head, fnode) {
298 if (!memcmp(tmp_fil->faddr, &src_addr, ETH_ALEN) && 298 if (!memcmp(tmp_fil->faddr, &src_addr, ETH_ALEN) &&
299 tmp_fil->vlan_id == vlan_id) { 299 tmp_fil->vlan_id == vlan_id) {
300 if (jiffies > (QLCNIC_READD_AGE * HZ + tmp_fil->ftime)) 300 if (jiffies > (QLCNIC_READD_AGE * HZ + tmp_fil->ftime))
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index 289b4eefb42f..1df0ff3839e8 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -614,10 +614,9 @@ struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb)
614{ 614{
615 unsigned int hash = vnet_hashfn(skb->data); 615 unsigned int hash = vnet_hashfn(skb->data);
616 struct hlist_head *hp = &vp->port_hash[hash]; 616 struct hlist_head *hp = &vp->port_hash[hash];
617 struct hlist_node *n;
618 struct vnet_port *port; 617 struct vnet_port *port;
619 618
620 hlist_for_each_entry(port, n, hp, hash) { 619 hlist_for_each_entry(port, hp, hash) {
621 if (ether_addr_equal(port->raddr, skb->data)) 620 if (ether_addr_equal(port->raddr, skb->data))
622 return port; 621 return port;
623 } 622 }