Skip to content

Commit

Permalink
ice: use list_for_each_entry() helper
Browse files Browse the repository at this point in the history
Convert list_for_each() to list_for_each_entry() where applicable.
No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Yang Yingliang authored and Tony Nguyen committed Aug 17, 2023
1 parent 467a17e commit 1533b77
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/net/ethernet/intel/ice/ice_lag.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,9 @@ ice_lag_find_hw_by_lport(struct ice_lag *lag, u8 lport)
struct ice_lag_netdev_list *entry;
struct net_device *tmp_netdev;
struct ice_netdev_priv *np;
struct list_head *tmp;
struct ice_hw *hw;

list_for_each(tmp, lag->netdev_head) {
entry = list_entry(tmp, struct ice_lag_netdev_list, node);
list_for_each_entry(entry, lag->netdev_head, node) {
tmp_netdev = entry->netdev;
if (!tmp_netdev || !netif_is_ice(tmp_netdev))
continue;
Expand Down Expand Up @@ -1535,11 +1533,9 @@ static void ice_lag_disable_sriov_bond(struct ice_lag *lag)
struct ice_lag_netdev_list *entry;
struct ice_netdev_priv *np;
struct net_device *netdev;
struct list_head *tmp;
struct ice_pf *pf;

list_for_each(tmp, lag->netdev_head) {
entry = list_entry(tmp, struct ice_lag_netdev_list, node);
list_for_each_entry(entry, lag->netdev_head, node) {
netdev = entry->netdev;
np = netdev_priv(netdev);
pf = np->vsi->back;
Expand Down

0 comments on commit 1533b77

Please sign in to comment.