qca_debug: Reduce function calls for sequence output in qcaspi_info_show()
PATCH 1/1 qca_debug: Reduce function calls for sequence output in qcaspi_info_show()
From: Markus Elfring <[email protected]>
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.
--- drivers/net/ethernet/qualcomm/qca_debug.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/net/ethernet/qualcomm/qca_debug.c +2 -8
@@ -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",
Signature · 1 line
2.12.2
Am 08.05.2017 um 19:29 schrieb SF Markus Elfring:
Quoted 5 lines
From: Markus Elfring <[email protected]>
Date: Mon, 8 May 2017 19:21:27 +0200A 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
Quoted 8 lines
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- drivers/net/ethernet/qualcomm/qca_debug.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
Quoted 1 line
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.
Quoted 1 line
But for debugfs this won't be necessary.
I would appreciate also another improvement there.
Regards,
Markus