diff mbox

net: ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route

Message ID 5093BA27.3090109@asianux.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Chen Gang Nov. 2, 2012, 12:18 p.m. UTC
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(-)

Comments

solomon Nov. 2, 2012, 3:40 p.m. UTC | #1
Chen Gang said, at 2012/11/2 20:18:
> 
>   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>

1. not to send same patch triple times. 
2. config your email client,because tab is changed to space.
   you can read Documentation/email-clients.txt.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 : "");