Skip to content

Commit fa6f90f

Browse files
JoePerchesgregkh
authored andcommitted
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>
1 parent ad90ff6 commit fa6f90f

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎drivers/misc/sgi-gru/gruprocfs.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int mcs_statistics_show(struct seq_file *s, void *p)
119119
"cch_interrupt_sync", "cch_deallocate", "tfh_write_only",
120120
"tfh_write_restart", "tgh_invalidate"};
121121

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");
123123
for (op = 0; op < mcsop_last; op++) {
124124
count = atomic_long_read(&mcs_op_statistics[op].count);
125125
total = atomic_long_read(&mcs_op_statistics[op].total);
@@ -165,8 +165,7 @@ static int cch_seq_show(struct seq_file *file, void *data)
165165
const char *mode[] = { "??", "UPM", "INTR", "OS_POLL" };
166166

167167
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");
170169
if (gru)
171170
for (i = 0; i < GRU_NUM_CCH; i++) {
172171
ts = gru->gs_gts[i];
@@ -191,10 +190,8 @@ static int gru_seq_show(struct seq_file *file, void *data)
191190
struct gru_state *gru = GID_TO_GRU(gid);
192191

193192
if (gid == 0) {
194-
seq_printf(file, "#%5s%5s%7s%6s%6s%8s%6s%6s\n", "gid", "nid",
195-
"ctx", "cbr", "dsr", "ctx", "cbr", "dsr");
196-
seq_printf(file, "#%5s%5s%7s%6s%6s%8s%6s%6s\n", "", "", "busy",
197-
"busy", "busy", "free", "free", "free");
193+
seq_puts(file, "# gid nid ctx cbr dsr ctx cbr dsr\n");
194+
seq_puts(file, "# busy busy busy free free free\n");
198195
}
199196
if (gru) {
200197
ctxfree = GRU_NUM_CCH - gru->gs_active_contexts;

0 commit comments

Comments
 (0)