netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Patrick Lu <patrick.lu@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 8/9] i40e: Moving variable declaration out of the loops
Date: Thu, 23 Oct 2014 21:10:05 -0700	[thread overview]
Message-ID: <1414123806-20049-9-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1414123806-20049-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>

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>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 9d36d10..b0c10e0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -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;
@@ -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]);
 
-- 
1.9.3

  parent reply	other threads:[~2014-10-24  4:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24  4:09 [net-next 0/9][pull request] Intel Wired LAN Driver Updates 2014-10-23 Jeff Kirsher
2014-10-24  4:09 ` [net-next 1/9] i40e: mask phy events Jeff Kirsher
2014-10-24  4:09 ` [net-next 2/9] i40e: enable LSE poke and simplify link state Jeff Kirsher
2014-10-24  4:10 ` [net-next 3/9] i40e/i40evf: Fix whitespace indentation Jeff Kirsher
2014-10-24  4:10 ` [net-next 4/9] i40e/i40evf: Use usleep_range() instead of udelay() Jeff Kirsher
2014-10-24  4:10 ` [net-next 5/9] i40e: Fix a bug where Rx would stop after some time Jeff Kirsher
2014-10-24  4:10 ` [net-next 6/9] i40e: process link events when setting up switch Jeff Kirsher
2014-10-24  4:10 ` [net-next 7/9] i40e: Add 10GBaseT support Jeff Kirsher
2014-10-24  4:10 ` Jeff Kirsher [this message]
2014-10-24 12:20   ` [net-next 8/9] i40e: Moving variable declaration out of the loops Sergei Shtylyov
2014-10-24 13:10     ` David Laight
2014-10-24  4:10 ` [net-next 9/9] i40e: Bump version Jeff Kirsher
2014-10-24 20:43 ` [net-next 0/9][pull request] Intel Wired LAN Driver Updates 2014-10-23 David Miller
2014-10-24 20:45   ` Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414123806-20049-9-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=akeem.g.abodunrin@intel.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=patrick.lu@intel.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).