Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sgi-gru: simplify procfs code some more

Use seq_puts and simple string output and not seq_printf with formats
and individual strings to reduce overall object size.

$ size drivers/misc/sgi-gru/gruprocfs.o* (x86-64 defconfig with gru)
text data bss dec hex filename
7006 8 0 7014 1b66 drivers/misc/sgi-gru/gruprocfs.o.new
7472 8 0 7480 1d38 drivers/misc/sgi-gru/gruprocfs.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Dimitri Sivanich <sivanich@hpe.com>
Link: https://lore.kernel.org/r/cce61906a5f7f42f5b2b8b947fc61357bcb56e71.camel@perches.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Joe Perches and committed by
Greg Kroah-Hartman
fa6f90f3 ad90ff69

+4 -7
+4 -7
drivers/misc/sgi-gru/gruprocfs.c
··· 119 119 "cch_interrupt_sync", "cch_deallocate", "tfh_write_only", 120 120 "tfh_write_restart", "tgh_invalidate"}; 121 121 122 - seq_printf(s, "%-20s%12s%12s%12s\n", "#id", "count", "aver-clks", "max-clks"); 122 + seq_puts(s, "#id count aver-clks max-clks\n"); 123 123 for (op = 0; op < mcsop_last; op++) { 124 124 count = atomic_long_read(&mcs_op_statistics[op].count); 125 125 total = atomic_long_read(&mcs_op_statistics[op].total); ··· 165 165 const char *mode[] = { "??", "UPM", "INTR", "OS_POLL" }; 166 166 167 167 if (gid == 0) 168 - seq_printf(file, "#%5s%5s%6s%7s%9s%6s%8s%8s\n", "gid", "bid", 169 - "ctx#", "asid", "pid", "cbrs", "dsbytes", "mode"); 168 + seq_puts(file, "# gid bid ctx# asid pid cbrs dsbytes mode\n"); 170 169 if (gru) 171 170 for (i = 0; i < GRU_NUM_CCH; i++) { 172 171 ts = gru->gs_gts[i]; ··· 190 191 struct gru_state *gru = GID_TO_GRU(gid); 191 192 192 193 if (gid == 0) { 193 - seq_printf(file, "#%5s%5s%7s%6s%6s%8s%6s%6s\n", "gid", "nid", 194 - "ctx", "cbr", "dsr", "ctx", "cbr", "dsr"); 195 - seq_printf(file, "#%5s%5s%7s%6s%6s%8s%6s%6s\n", "", "", "busy", 196 - "busy", "busy", "free", "free", "free"); 194 + seq_puts(file, "# gid nid ctx cbr dsr ctx cbr dsr\n"); 195 + seq_puts(file, "# busy busy busy free free free\n"); 197 196 } 198 197 if (gru) { 199 198 ctxfree = GRU_NUM_CCH - gru->gs_active_contexts;