public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel•com>, 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>
Subject: Re: [net-next 8/9] i40e: Moving variable declaration out of the loops
Date: Fri, 24 Oct 2014 16:20:19 +0400	[thread overview]
Message-ID: <544A4403.9090108@cogentembedded.com> (raw)
In-Reply-To: <1414123806-20049-9-git-send-email-jeffrey.t.kirsher@intel.com>

Hello.

On 10/24/2014 8:10 AM, Jeff Kirsher wrote:

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

> Move the three variables out of the loop, so it only declares once.

    It's only declared once in either case. I think gcc allocates maximum 
local variable space at the start of the function, so declaring variables in 
the loop body comes with no extra price.

> 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;
> -

WBR, Sergei

  reply	other threads:[~2014-10-24 12:20 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 ` [net-next 8/9] i40e: Moving variable declaration out of the loops Jeff Kirsher
2014-10-24 12:20   ` Sergei Shtylyov [this message]
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=544A4403.9090108@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded$(echo .)com \
    --cc=akeem.g.abodunrin@intel$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=jeffrey.t.kirsher@intel$(echo .)com \
    --cc=jogreene@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nhorman@redhat$(echo .)com \
    --cc=patrick.lu@intel$(echo .)com \
    --cc=sassmann@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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