Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1637955 > unrolled thread

[PATCH] wil6210: Replace five seq_puts() calls by seq_putc()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-05-09 10:00 +0200
Last post2017-05-09 14:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] wil6210: Replace five seq_puts() calls by seq_putc() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-09 10:00 +0200
    Re: [PATCH] wil6210: Replace five seq_puts() calls by seq_putc() Eric Dumazet <eric.dumazet@gmail.com> - 2017-05-09 14:30 +0200

#1637955 — [PATCH] wil6210: Replace five seq_puts() calls by seq_putc()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-09 10:00 +0200
Subject[PATCH] wil6210: Replace five seq_puts() calls by seq_putc()
Message-ID<tF8dQ-7bU-5@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 May 2017 22:22:04 +0200

Five single characters (line breaks) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/net/wireless/ath/wil6210/debugfs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 5648ebbd0e16..90118d286fb9 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -76,11 +76,11 @@ static void wil_print_vring(struct seq_file *s, struct wil6210_priv *wil,
 			volatile struct vring_tx_desc *d = &vring->va[i].tx;
 
 			if ((i % 128) == 0 && (i != 0))
-				seq_puts(s, "\n");
+				seq_putc(s, '\n');
 			seq_printf(s, "%c", (d->dma.status & BIT(0)) ?
 					_s : (vring->ctx[i].skb ? _h : 'h'));
 		}
-		seq_puts(s, "\n");
+		seq_putc(s, '\n');
 	}
 	seq_puts(s, "}\n");
 }
@@ -233,7 +233,7 @@ static void wil_print_ring(struct seq_file *s, const char *prefix,
 				wil_seq_hexdump(s, databuf, len, "      : ");
 			}
 		} else {
-			seq_puts(s, "\n");
+			seq_putc(s, '\n');
 		}
 	}
  out:
@@ -1366,7 +1366,7 @@ static void wil_print_rxtid_crypto(struct seq_file *s, int tid,
 		seq_printf(s, " [%i%s]%6phN", i, cc->key_set ? "+" : "-",
 			   cc->pn);
 	}
-	seq_puts(s, "\n");
+	seq_putc(s, '\n');
 }
 
 static int wil_sta_debugfs_show(struct seq_file *s, void *data)
@@ -1423,7 +1423,7 @@ __acquires(&p->tid_rx_lock) __releases(&p->tid_rx_lock)
 			     mcs++)
 				seq_printf(s, " %lld",
 					   p->stats.rx_per_mcs[mcs]);
-			seq_puts(s, "\n");
+			seq_putc(s, '\n');
 		}
 	}
 
-- 
2.12.2

[toc] | [next] | [standalone]


#1638085

FromEric Dumazet <eric.dumazet@gmail.com>
Date2017-05-09 14:30 +0200
Message-ID<tFcr8-1Fu-15@gated-at.bofh.it>
In reply to#1637955
On Tue, 2017-05-09 at 09:50 +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 8 May 2017 22:22:04 +0200
> 
> Five single characters (line breaks) should be put into a sequence.
> Thus use the corresponding function "seq_putc".
> 
> This issue was detected by using the Coccinelle software.

There is no _issue_ at all here, only a matter of taste.

printf("\n")  or putchar('\n')  in some slow path is really not that
interesting.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web