All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shan Wei <shanwei88@gmail.com>
To: Chen Gang <gang.chen@asianux.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] net: ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route
Date: Thu, 22 Nov 2012 13:28:07 +0800	[thread overview]
Message-ID: <50ADB7E7.1000009@gmail.com> (raw)
In-Reply-To: <50AD9351.5020805@asianux.com>

Hi chen gang:

For length of device name which less than 8 char,
your patch changes them to be print from align right 
to align left. But at least since 2005(git age-time),
we keep this style so far.
Maybe, since birth of this code, just align right. :-)

Why we *should* change this style?
just keep be consistent with the case which length of device
name greater than 8 char?

Not only old name rule i.e. eth0,eth1, but also new name rule
base on pci address ,i.e. em1,p3p1. most of them are less than 8 char.
Should not we take more attention on the case less than 8 char?

By addition, if we want to add new field in the future,
align right is a better choice.


Chen Gang said, at 2012/11/22 10:52:
> Hi Shan Wei, Eric Dumazet
> 
>   is this patch integrated into main branch ?
>   if need me for additional completion (such as: merge another 2 trivial patches into this patch, too)
>   please tell me, I will do. 
> 
>   I understand you are working overtime, maybe no time for any minor and trivial patches.
>   if surely it is, I think:
>     you can modify these code manually, and obsolete these minor and trivial patches which I provided.
>     I do not mind whether mention me in another new patches (you can mention me or not mention me, both are OK).
>     since our goal is to provide contributes to outside, efficiently.
> 
>  regards
> 
> gchen
> 
> 
> 于 2012年11月05日 11:02, Chen Gang 写道:
>>
>> 1. not to send same patch triple times. 
> 
>   thanks, I shall notice, next time.
>   (I shall 'believe' another members).
> 
>> 2. config your email client,because tab is changed to space.
>>    you can read Documentation/email-clients.txt.
> 
>   1) thanks. I shall notice, next time.
>   2) now, I get gvim as extention editor for thounderbird
>   3) the patch is generated by `git format-patch -s --summary --stat`
>      it use "' '\t" as head, I do not touch it, maybe it is correct.
> 
> welcome any members to giving additional suggestions and completions.
> 
> thanks
> 
> the modified contents are below,
> -----------------------------------------------------------------------------------
> 
>   the length of rt->dst.dev->name is 16 (IFNAMSIZ)
>   in seq_printf, it is not suitable to use %8s for rt->dst.dev->name.
>   so change it to %s, since each line has not been solid any more.
> 
>   additional information:
> 
>     %8s  limit the width, not for the original string output length
>          if name length is more than 8, it still can be fully displayed.
>          if name length is less than 8, the ' ' will be filled before name.
> 
>     %.8s truly limit the original string output length (precision)
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  net/ipv6/route.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index c42650c..b60bc52 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -2835,7 +2835,7 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg)
>  	} else {
>  		seq_puts(m, "00000000000000000000000000000000");
>  	}
> -	seq_printf(m, " %08x %08x %08x %08x %8s\n",
> +	seq_printf(m, " %08x %08x %08x %08x %s\n",
>  		   rt->rt6i_metric, atomic_read(&rt->dst.__refcnt),
>  		   rt->dst.__use, rt->rt6i_flags,
>  		   rt->dst.dev ? rt->dst.dev->name : "");
> 
> 
> 

  reply	other threads:[~2012-11-22 18:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22  2:52 [PATCH] net: ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route Chen Gang
2012-11-22  5:28 ` Shan Wei [this message]
2012-11-22  8:37   ` Chen Gang
2012-11-23  3:35     ` Fwd: " Chen Gang
2012-11-27  3:17       ` Shan Wei
2012-11-27  4:18         ` Chen Gang
2012-11-27  4:45           ` Chen Gang
2012-11-27  5:40             ` Chen Gang
2012-11-27  5:52               ` Chen Gang
2012-11-28  5:54                 ` Chen Gang
2012-11-27  4:56           ` Shan Wei
2012-11-27  5:35             ` Chen Gang
2012-11-29  1:43             ` [Consult] excuse me: sorry for the negative effects which I made Chen Gang
  -- strict thread matches above, loose matches on Subject: below --
2012-11-02  8:55 [PATCH] net-ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route Chen Gang
2012-11-02 12:18 ` [PATCH] net: ipv6: " Chen Gang
2012-11-02 15:40   ` Shan Wei
2012-11-05  3:02     ` Chen Gang
2012-11-05  5:50       ` David Miller
2012-11-05  6:02         ` Chen Gang

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=50ADB7E7.1000009@gmail.com \
    --to=shanwei88@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=gang.chen@asianux.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.