[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <544A4403.9090108@cogentembedded.com>
Date: Fri, 24 Oct 2014 16:20:19 +0400
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>, davem@...emloft.net
CC: Akeem G Abodunrin <akeem.g.abodunrin@...el.com>,
netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
jogreene@...hat.com, Patrick Lu <patrick.lu@...el.com>
Subject: Re: [net-next 8/9] i40e: Moving variable declaration out of the loops
Hello.
On 10/24/2014 8:10 AM, Jeff Kirsher wrote:
> From: Akeem G Abodunrin <akeem.g.abodunrin@...el.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@...el.com>
> Signed-off-by: Patrick Lu <patrick.lu@...el.com>
> Tested-by: Jim Young <jamesx.m.young@...el.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists