linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qca_debug: Reduce function calls for sequence output in qcaspi_info_show()
@ 2017-05-08 17:29 SF Markus Elfring
  2017-05-09  7:07 ` Stefan Wahren
  0 siblings, 1 reply; 3+ messages in thread
From: SF Markus Elfring @ 2017-05-08 17:29 UTC (permalink / raw)
  To: netdev, David S. Miller, Philippe Reynes, Stefan Wahren
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 May 2017 19:21:27 +0200

A bit of data was 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/net/ethernet/qualcomm/qca_debug.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c b/drivers/net/ethernet/qualcomm/qca_debug.c
index d145df98feff..27b5c1dd27d0 100644
--- a/drivers/net/ethernet/qualcomm/qca_debug.c
+++ b/drivers/net/ethernet/qualcomm/qca_debug.c
@@ -81,11 +81,7 @@ qcaspi_info_show(struct seq_file *s, void *what)
 	else
 		seq_puts(s, "in use");
 
-	seq_puts(s, "\n");
-
-	seq_printf(s, "TX ring size     : %u\n",
-		   qca->txr.size);
-
+	seq_printf(s, "\nTX ring size     : %u\n", qca->txr.size);
 	seq_printf(s, "Sync state       : %u (",
 		   (unsigned int)qca->sync);
 	switch (qca->sync) {
@@ -102,10 +98,8 @@ qcaspi_info_show(struct seq_file *s, void *what)
 		seq_puts(s, "INVALID");
 		break;
 	}
-	seq_puts(s, ")\n");
 
-	seq_printf(s, "IRQ              : %d\n",
-		   qca->spi_dev->irq);
+	seq_printf(s, ")\nIRQ              : %d\n", qca->spi_dev->irq);
 	seq_printf(s, "INTR REQ         : %u\n",
 		   qca->intr_req);
 	seq_printf(s, "INTR SVC         : %u\n",
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] qca_debug: Reduce function calls for sequence output in qcaspi_info_show()
  2017-05-08 17:29 [PATCH] qca_debug: Reduce function calls for sequence output in qcaspi_info_show() SF Markus Elfring
@ 2017-05-09  7:07 ` Stefan Wahren
  2017-05-09  7:57   ` SF Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Wahren @ 2017-05-09  7:07 UTC (permalink / raw)
  To: SF Markus Elfring, netdev, David S. Miller, Philippe Reynes
  Cc: LKML, kernel-janitors

Am 08.05.2017 um 19:29 schrieb SF Markus Elfring:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 8 May 2017 19:21:27 +0200
>
> A bit of data was put into a sequence by separate function calls.
> Print the same data together with adjusted seq_printf() calls instead.

Sorry, i'm not happy with this patch. It doesn't increase readabilityand
mixes the output of multiple lines.

The only benefit is a little bit higher performance. But for debugfs
this won't be necessary.

Stefan

>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/net/ethernet/qualcomm/qca_debug.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: qca_debug: Reduce function calls for sequence output in qcaspi_info_show()
  2017-05-09  7:07 ` Stefan Wahren
@ 2017-05-09  7:57   ` SF Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-05-09  7:57 UTC (permalink / raw)
  To: Stefan Wahren, netdev
  Cc: David S. Miller, Philippe Reynes, LKML, kernel-janitors

> The only benefit is a little bit higher performance.

I would prefer such a small code reduction. I am not so concerned
about an other readability impression at this place.


> But for debugfs this won't be necessary.

I would appreciate also another improvement there.

Regards,
Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-09  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08 17:29 [PATCH] qca_debug: Reduce function calls for sequence output in qcaspi_info_show() SF Markus Elfring
2017-05-09  7:07 ` Stefan Wahren
2017-05-09  7:57   ` SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).