aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_main.c
diff options
context:
space:
mode:
authorBrett Creeley <brett.creeley@intel.com>2019-02-08 15:50:54 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-03-19 19:54:23 -0400
commit80ed404abb480563aaefef28accc69801a95f964 (patch)
tree3431aee8ffa726e919b85e8593f4c2c1e6d2b3f9 /drivers/net/ethernet/intel/ice/ice_main.c
parentd8df260af70f8b8a9f23466f569c820a90e91696 (diff)
ice: use ice_for_each_vsi macro when possible
Replace all instances of: for (i = 0; i < pf->num_alloc_vsi; i++) with the following macro: ice_for_each_vsi(pf, i) This will allow the code to be consistent since there are currently cases of using both. Signed-off-by: Brett Creeley <brett.creeley@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index d353de4456f5..8b4c64ef85ed 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -322,7 +322,7 @@ static void ice_sync_fltr_subtask(struct ice_pf *pf)
322 322
323 clear_bit(ICE_FLAG_FLTR_SYNC, pf->flags); 323 clear_bit(ICE_FLAG_FLTR_SYNC, pf->flags);
324 324
325 for (v = 0; v < pf->num_alloc_vsi; v++) 325 ice_for_each_vsi(pf, v)
326 if (pf->vsi[v] && ice_vsi_fltr_changed(pf->vsi[v]) && 326 if (pf->vsi[v] && ice_vsi_fltr_changed(pf->vsi[v]) &&
327 ice_vsi_sync_fltr(pf->vsi[v])) { 327 ice_vsi_sync_fltr(pf->vsi[v])) {
328 /* come back and try again later */ 328 /* come back and try again later */
@@ -642,7 +642,7 @@ static void ice_watchdog_subtask(struct ice_pf *pf)
642 * can look at updated numbers whenever it cares to 642 * can look at updated numbers whenever it cares to
643 */ 643 */
644 ice_update_pf_stats(pf); 644 ice_update_pf_stats(pf);
645 for (i = 0; i < pf->num_alloc_vsi; i++) 645 ice_for_each_vsi(pf, i)
646 if (pf->vsi[i] && pf->vsi[i]->netdev) 646 if (pf->vsi[i] && pf->vsi[i]->netdev)
647 ice_update_vsi_stats(pf->vsi[i]); 647 ice_update_vsi_stats(pf->vsi[i]);
648} 648}
@@ -3273,7 +3273,7 @@ static void ice_vsi_release_all(struct ice_pf *pf)
3273 if (!pf->vsi) 3273 if (!pf->vsi)
3274 return; 3274 return;
3275 3275
3276 for (i = 0; i < pf->num_alloc_vsi; i++) { 3276 ice_for_each_vsi(pf, i) {
3277 if (!pf->vsi[i]) 3277 if (!pf->vsi[i])
3278 continue; 3278 continue;
3279 3279
@@ -3372,7 +3372,7 @@ static int ice_vsi_rebuild_all(struct ice_pf *pf)
3372 int i; 3372 int i;
3373 3373
3374 /* loop through pf->vsi array and reinit the VSI if found */ 3374 /* loop through pf->vsi array and reinit the VSI if found */
3375 for (i = 0; i < pf->num_alloc_vsi; i++) { 3375 ice_for_each_vsi(pf, i) {
3376 int err; 3376 int err;
3377 3377
3378 if (!pf->vsi[i]) 3378 if (!pf->vsi[i])
@@ -3409,7 +3409,7 @@ static int ice_vsi_replay_all(struct ice_pf *pf)
3409 int i; 3409 int i;
3410 3410
3411 /* loop through pf->vsi array and replay the VSI if found */ 3411 /* loop through pf->vsi array and replay the VSI if found */
3412 for (i = 0; i < pf->num_alloc_vsi; i++) { 3412 ice_for_each_vsi(pf, i) {
3413 if (!pf->vsi[i]) 3413 if (!pf->vsi[i])
3414 continue; 3414 continue;
3415 3415
@@ -3520,7 +3520,7 @@ static void ice_rebuild(struct ice_pf *pf)
3520 3520
3521 ice_reset_all_vfs(pf, true); 3521 ice_reset_all_vfs(pf, true);
3522 3522
3523 for (i = 0; i < pf->num_alloc_vsi; i++) { 3523 ice_for_each_vsi(pf, i) {
3524 bool link_up; 3524 bool link_up;
3525 3525
3526 if (!pf->vsi[i] || pf->vsi[i]->type != ICE_VSI_PF) 3526 if (!pf->vsi[i] || pf->vsi[i]->type != ICE_VSI_PF)