Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1637492
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/3] mtdswap: Reduce function calls for sequence output in mtdswap_show() |
| Date | 2017-05-08 17:10 +0200 |
| Message-ID | <tESsq-5wT-35@gated-at.bofh.it> (permalink) |
| References | <tESsp-5wT-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 8 May 2017 16:02:34 +0200 Two line breaks were put into a sequence by separate function calls. Print the same data together with adjusted seq_printf() calls instead. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/mtd/mtdswap.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c index f12879a3d4ff..0805f45c5139 100644 --- a/drivers/mtd/mtdswap.c +++ b/drivers/mtd/mtdswap.c @@ -1283,19 +1283,14 @@ static int mtdswap_show(struct seq_file *s, void *data) "erased %u times\n", cwp, d->pages_per_eblk - cwp, cwecount); - seq_printf(s, "total erasures: %lu\n", sum); - - seq_puts(s, "\n"); - + seq_printf(s, "total erasures: %lu\n\n", sum); seq_printf(s, "mtdswap_readsect count: %llu\n", d->sect_read_count); seq_printf(s, "mtdswap_writesect count: %llu\n", d->sect_write_count); seq_printf(s, "mtdswap_discard count: %llu\n", d->discard_count); seq_printf(s, "mtd read count: %llu\n", d->mtd_read_count); seq_printf(s, "mtd write count: %llu\n", d->mtd_write_count); seq_printf(s, "discarded pages count: %llu\n", d->discard_page_count); - - seq_puts(s, "\n"); - seq_printf(s, "total pages: %u\n", pages); + seq_printf(s, "\ntotal pages: %u\n", pages); seq_printf(s, "pages mapped: %u\n", mapped); return 0; -- 2.12.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] mtdswap: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 17:10 +0200 [PATCH 1/3] mtdswap: Reduce function calls for sequence output in mtdswap_show() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 17:10 +0200 [PATCH 3/3] mtdswap: Improve a size determination in mtdswap_erase_block() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 17:20 +0200 [PATCH 2/3] mtdswap: Improve two size determinations in mtdswap_add_mtd() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 17:20 +0200
csiph-web