netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: David.Laight@ACULAB.COM
Cc: romieu@fr.zoreil.com, rshearma@brocade.com,
	netdev@vger.kernel.org, roopa@cumulusnetworks.com,
	ebiederm@xmission.com
Subject: Re: [PATCH net-next 1/2] mpls: packet stats
Date: Tue, 16 Feb 2016 15:08:13 -0500 (EST)	[thread overview]
Message-ID: <20160216.150813.617905734698506558.davem@davemloft.net> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CCDAD79@AcuExch.aculab.com>

From: David Laight <David.Laight@ACULAB.COM>
Date: Mon, 8 Feb 2016 11:51:34 +0000

> From: Francois Romieu
>> Sent: 06 February 2016 10:59
>> > +void mpls_stats_inc_outucastpkts(struct net_device *dev,
>> > +				 const struct sk_buff *skb)
>> > +{
>> > +	struct mpls_dev *mdev;
>> > +	struct inet6_dev *in6dev;
>> 
>> Nit: the scope can be reduced for both variables.
> 
> And hiding the definitions of variables in the middle of
> functions just makes them harder to find.	

I completely disagree.  You look up from the scope you are reading back
to the top-level scope to fine variable declarations.

If the variable declarations are closer to where you are looking you
don't even need to scroll back at all.

It also happens to help the compiler run more efficiently.

  reply	other threads:[~2016-02-16 20:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 19:27 [PATCH net-next 0/2] mpls: packet stats and ttl propagation config Robert Shearman
2016-02-05 19:27 ` [PATCH net-next 1/2] mpls: packet stats Robert Shearman
2016-02-06 10:58   ` Francois Romieu
2016-02-08 11:51     ` David Laight
2016-02-16 20:08       ` David Miller [this message]
2016-02-08 16:17     ` Robert Shearman
2016-02-16 15:41   ` David Miller
2016-02-16 20:26     ` roopa
2016-02-19  9:57       ` Robert Shearman
2016-07-29  5:19   ` Roopa Prabhu
2016-02-05 19:27 ` [PATCH net-next 2/2] mpls: allow TTL propagation to/from IP packets to be configured Robert Shearman
2016-02-06 18:36   ` Eric W. Biederman
2016-02-09 16:10     ` Robert Shearman

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=20160216.150813.617905734698506558.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=David.Laight@ACULAB.COM \
    --cc=ebiederm@xmission.com \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=rshearma@brocade.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).