Skip to contentSkip to conversation

sky2: Use seq_putc() in sky2_debug_show()

PATCH In review SF Markus Elfring 4 participants 5 messages May 8, 2017 – May 9, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sky2: Use seq_putc() in sky2_debug_show()

From: Markus Elfring <[email protected]>
Date: Mon, 8 May 2017 18:38:17 +0200

A single character (line break) should be put into a sequence. Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

---
 drivers/net/ethernet/marvell/sky2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/sky2.c +1 -1
index 1145cde2274a..73575101cd72 100644
@@ -4562,7 +4562,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
 			seq_printf(seq, "[%d] %#x %d %#x\n",
 				   idx, le->opcode, le->length, le->status);
 		}
-		seq_puts(seq, "\n");
+		seq_putc(seq, '\n');
 	}
 
 	seq_printf(seq, "Tx ring pending=%u...%u report=%d done=%d\n",
Signature · 1 line
2.12.2
#1 lore raw

Hi,

Quoted 4 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 8 May 2017 18:38:17 +0200

A single character (line break) should be put into a sequence.

Why?

Quoted 3 lines

Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

Which issue do you mean? I dont see any issue you fix here.

Quoted 12 lines
---
 drivers/net/ethernet/marvell/sky2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/sky2.c +0 -0
index 1145cde2274a..73575101cd72 100644

drivers/net/ethernet/marvell/sky2.c static int sky2_debug_show(struct seq_file *seq, void *v) · line 4568

Quoted 8 lines
drivers/net/ethernet/marvell/sky2.c +1 -1
@@ -4562,7 +4562,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
 			seq_printf(seq, "[%d] %#x %d %#x\n",
 				   idx, le->opcode, le->length, le->status);
 		}
-		seq_puts(seq, "\n");
+		seq_putc(seq, '\n');
 	}
 
 	seq_printf(seq, "Tx ring pending=%u...%u report=%d done=%d\n",

Regards,
Lino

#2 lore raw
Quoted 1 line

Which issue do you mean? I dont see any issue you fix here.

Are the run time characteristics a bit nicer for the function “seq_putc” in comparison to the function “seq_puts” for printing a single line break here?

Regards,
Markus

#3 lore raw
Quoted 7 lines · On Mon, 8 May 2017 19:42:46 +0200 SF Markus Elfring…
Quoted 1 line

Which issue do you mean? I dont see any issue you fix here.

Are the run time characteristics a bit nicer for the function “seq_putc” in comparison to the function “seq_puts” for printing a single line break here?

Regards,
Markus

I would put this in why bother category. seq_puts is correct and this is only in diagnostic output useful to developer and disabled on most distro kernels

#4 lore raw

RnJvbTogU3RlcGhlbiBIZW1taW5nZXINCj4gU2VudDogMDkgTWF5IDIwMTcgMDY6NTANCj4gT24g TW9uLCA4IE1heSAyMDE3IDE5OjQyOjQ2ICswMjAwDQo+IFNGIE1hcmt1cyBFbGZyaW5nIDxlbGZy aW5nQHVzZXJzLnNvdXJjZWZvcmdlLm5ldD4gd3JvdGU6DQo+IA0KPiA+ID4gV2hpY2ggaXNzdWUg ZG8geW91IG1lYW4/IEkgZG9udCBzZWUgYW55IGlzc3VlIHlvdSBmaXggaGVyZS4NCj4gPg0KPiA+ IEFyZSB0aGUgcnVuIHRpbWUgY2hhcmFjdGVyaXN0aWNzIGEgYml0IG5pY2VyIGZvciB0aGUgZnVu Y3Rpb24gc2VxX3B1dGMNCj4gPiBpbiBjb21wYXJpc29uIHRvIHRoZSBmdW5jdGlvbiBzZXFfcHV0 cyBmb3IgcHJpbnRpbmcgYSBzaW5nbGUgbGluZSBicmVhayBoZXJlPw0KPiA+DQo+ID4gUmVnYXJk cywNCj4gPiBNYXJrdXMNCj4gDQo+IEkgd291bGQgcHV0IHRoaXMgaW4gd2h5IGJvdGhlciBjYXRl Z29yeS4gc2VxX3B1dHMgaXMgY29ycmVjdCBhbmQgdGhpcyBpcyBvbmx5DQo+IGluIGRpYWdub3N0 aWMgb3V0cHV0IHVzZWZ1bCB0byB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