Skip to content

Commit

Permalink
i40e: Moving variable declaration out of the loops
Browse files Browse the repository at this point in the history
Move the three variables out of the loop, so it only declares once.

Change-ID: I436913777c7da3c16dc0031b59e3ffa61de74718
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Patrick Lu <patrick.lu@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Akeem G Abodunrin authored and Jeff Kirsher committed Oct 24, 2014
1 parent 5960d33 commit bf00b37
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,10 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
struct i40e_eth_stats *oes;
struct i40e_eth_stats *es; /* device's eth stats */
u32 tx_restart, tx_busy;
struct i40e_ring *p;
u32 rx_page, rx_buf;
u64 bytes, packets;
unsigned int start;
u64 rx_p, rx_b;
u64 tx_p, tx_b;
u16 q;
Expand All @@ -837,10 +840,6 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
rx_buf = 0;
rcu_read_lock();
for (q = 0; q < vsi->num_queue_pairs; q++) {
struct i40e_ring *p;
u64 bytes, packets;
unsigned int start;

/* locate Tx ring */
p = ACCESS_ONCE(vsi->tx_rings[q]);

Expand Down

0 comments on commit bf00b37

Please sign in to comment.