diff mbox series

[net-next] net: Keep vertical alignment

Message ID 20210802050937.604-1-yajun.deng@linux.dev
State New
Headers show
Series [net-next] net: Keep vertical alignment | expand

Commit Message

Yajun Deng Aug. 2, 2021, 5:09 a.m. UTC
Those files under /proc/net/stat/ don't have vertical alignment, it looks
very difficult. Modify the seq_printf statement, keep vertical alignment.

use seq_puts() instead of seq_printf(), avoid the warning.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 net/core/neighbour.c | 7 ++++---
 net/ipv4/route.c     | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

Comments

kernel test robot Aug. 2, 2021, 9:41 a.m. UTC | #1
Hi Yajun,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Yajun-Deng/net-Keep-vertical-alignment/20210802-131102
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git aae950b189413ed3201354600d44223da0bcf63c
config: x86_64-randconfig-a002-20210802 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 4f71f59bf3d9914188a11d0c41bedbb339d36ff5)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/895e15bdf966d3c440d9e2e4cc0c9de89d899420
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yajun-Deng/net-Keep-vertical-alignment/20210802-131102
        git checkout 895e15bdf966d3c440d9e2e4cc0c9de89d899420
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=x86_64 SHELL=/bin/bash net/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> net/core/neighbour.c:3325:6: error: too many arguments to function call, expected 2, have 15
                      atomic_read(&tbl->entries),
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/seq_file.h:120:6: note: 'seq_puts' declared here
   void seq_puts(struct seq_file *m, const char *s);
        ^
   1 error generated.
--
>> net/ipv4/route.c:286:6: error: too many arguments to function call, expected 2, have 19
                      dst_entries_get_slow(&ipv4_dst_ops),
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/seq_file.h:120:6: note: 'seq_puts' declared here
   void seq_puts(struct seq_file *m, const char *s);
        ^
   1 error generated.


vim +3325 net/core/neighbour.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  3311  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3312  static int neigh_stat_seq_show(struct seq_file *seq, void *v)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3313  {
71a5053a41fd8d Christoph Hellwig 2018-04-15  3314  	struct neigh_table *tbl = PDE_DATA(file_inode(seq->file));
^1da177e4c3f41 Linus Torvalds    2005-04-16  3315  	struct neigh_statistics *st = v;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3316  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3317  	if (v == SEQ_START_TOKEN) {
895e15bdf966d3 Yajun Deng        2021-08-02  3318  		seq_puts(seq, "entries  allocs   destroys hash_grows lookups  hits     res_failed rcv_probes_mcast rcv_probes_ucast periodic_gc_runs forced_gc_runs unresolved_discards table_fulls\n");
^1da177e4c3f41 Linus Torvalds    2005-04-16  3319  		return 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3320  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  3321  
895e15bdf966d3 Yajun Deng        2021-08-02  3322  	seq_puts(seq, "%08x %08lx %08lx %08lx   %08lx %08lx %08lx   "
895e15bdf966d3 Yajun Deng        2021-08-02  3323  		      "%08lx         %08lx         %08lx         "
895e15bdf966d3 Yajun Deng        2021-08-02  3324  		      "%08lx       %08lx            %08lx\n",
^1da177e4c3f41 Linus Torvalds    2005-04-16 @3325  		   atomic_read(&tbl->entries),
^1da177e4c3f41 Linus Torvalds    2005-04-16  3326  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3327  		   st->allocs,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3328  		   st->destroys,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3329  		   st->hash_grows,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3330  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3331  		   st->lookups,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3332  		   st->hits,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3333  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3334  		   st->res_failed,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3335  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3336  		   st->rcv_probes_mcast,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3337  		   st->rcv_probes_ucast,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3338  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3339  		   st->periodic_gc_runs,
9a6d276e85aa3d Neil Horman       2008-07-16  3340  		   st->forced_gc_runs,
fb811395cd5a71 Rick Jones        2015-08-07  3341  		   st->unres_discards,
fb811395cd5a71 Rick Jones        2015-08-07  3342  		   st->table_fulls
^1da177e4c3f41 Linus Torvalds    2005-04-16  3343  		   );
^1da177e4c3f41 Linus Torvalds    2005-04-16  3344  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3345  	return 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3346  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  3347  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index c294addb7818..c018a27fc36b 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -3315,12 +3315,13 @@  static int neigh_stat_seq_show(struct seq_file *seq, void *v)
 	struct neigh_statistics *st = v;
 
 	if (v == SEQ_START_TOKEN) {
-		seq_printf(seq, "entries  allocs destroys hash_grows  lookups hits  res_failed  rcv_probes_mcast rcv_probes_ucast  periodic_gc_runs forced_gc_runs unresolved_discards table_fulls\n");
+		seq_puts(seq, "entries  allocs   destroys hash_grows lookups  hits     res_failed rcv_probes_mcast rcv_probes_ucast periodic_gc_runs forced_gc_runs unresolved_discards table_fulls\n");
 		return 0;
 	}
 
-	seq_printf(seq, "%08x  %08lx %08lx %08lx  %08lx %08lx  %08lx  "
-			"%08lx %08lx  %08lx %08lx %08lx %08lx\n",
+	seq_puts(seq, "%08x %08lx %08lx %08lx   %08lx %08lx %08lx   "
+		      "%08lx         %08lx         %08lx         "
+		      "%08lx       %08lx            %08lx\n",
 		   atomic_read(&tbl->entries),
 
 		   st->allocs,
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 04754d55b3c1..68ca0e4072c1 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -276,12 +276,13 @@  static int rt_cpu_seq_show(struct seq_file *seq, void *v)
 	struct rt_cache_stat *st = v;
 
 	if (v == SEQ_START_TOKEN) {
-		seq_printf(seq, "entries  in_hit in_slow_tot in_slow_mc in_no_route in_brd in_martian_dst in_martian_src  out_hit out_slow_tot out_slow_mc  gc_total gc_ignored gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search\n");
+		seq_puts(seq, "entries  in_hit   in_slow_tot in_slow_mc in_no_route in_brd   in_martian_dst in_martian_src out_hit  out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search\n");
 		return 0;
 	}
 
-	seq_printf(seq,"%08x  %08x %08x %08x %08x %08x %08x %08x "
-		   " %08x %08x %08x %08x %08x %08x %08x %08x %08x \n",
+	seq_puts(seq, "%08x %08x %08x    %08x   %08x    %08x %08x       "
+		      "%08x       %08x %08x     %08x    %08x %08x   %08x     "
+		      "%08x        %08x        %08x\n",
 		   dst_entries_get_slow(&ipv4_dst_ops),
 		   0, /* st->in_hit */
 		   st->in_slow_tot,