From patchwork Fri Nov 2 09:28:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 196515 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 328662C034B for ; Fri, 2 Nov 2012 20:27:40 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759776Ab2KBJ1i (ORCPT ); Fri, 2 Nov 2012 05:27:38 -0400 Received: from intranet.asianux.com ([58.214.24.6]:61890 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756629Ab2KBJ1g (ORCPT ); Fri, 2 Nov 2012 05:27:36 -0400 Received: by intranet.asianux.com (Postfix, from userid 103) id F3699184024B; Fri, 2 Nov 2012 17:27:34 +0800 (CST) X-Spam-Score: -100.8 X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on intranet.asianux.com X-Spam-Level: X-Spam-Status: No, score=-100.8 required=5.0 tests=AWL,BAYES_00, RATWARE_GECKO_BUILD,USER_IN_WHITELIST autolearn=no version=3.1.9 Received: from [10.1.0.143] (unknown [219.143.36.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intranet.asianux.com (Postfix) with ESMTP id 99251184024B; Fri, 2 Nov 2012 17:27:34 +0800 (CST) Message-ID: <50939243.7080507@asianux.com> Date: Fri, 02 Nov 2012 17:28:35 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eric Dumazet , netdev Subject: [PATCH] net-ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route References: <50938A65.6040507@asianux.com> In-Reply-To: <50938A65.6040507@asianux.com> X-Forwarded-Message-Id: <50938A65.6040507@asianux.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello Eric Dumazet: 1) This time (the first time): A) I have done according to what you have suggested. i) git clone git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git ii) format with `git format-patch -s --summary --stat` iii) cc to netdev@vger.kernel.org (not to linux-kernle@vger.kernel.org) B) please check the 'Main Contents' (below of this mail). C) thank you for your original information again, they are truly useful for me. 2) Next time (if also for net/ipv6): A) I will send mail according to MAINTAINERS (which also you suggested) M: "David S. Miller" M: Alexey Kuznetsov M: James Morris M: Hideaki YOSHIFUJI M: Patrick McHardy L: netdev@vger.kernel.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git B) Only have 'Main Content' in next time. Main Contents: ----------------------------------------------------------------------------------- From: Chen Gang Date: Fri, 2 Nov 2012 16:02:11 +0800 Subject: [PATCH] net-ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route 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 --- 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 : "");