Skip to contentSkip to conversation

brcmfmac: Replace two seq_printf() calls in brcmf_feat_fwcap_debugfs_read()

PATCH In review Markus Elfring 2 participants 2 messages Jul 2, 2019

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

PATCH 1/1 brcmfmac: Replace two seq_printf() calls in brcmf_feat_fwcap_debugfs_read()

From: Markus Elfring <[email protected]>
Date: Tue, 2 Jul 2019 11:31:07 +0200

A line break and a single string should be put into a sequence. Thus use the corresponding output functions.

This issue was detected by using the Coccinelle software.

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +2 -2
index 73aff4e4039d..ec0e80296e43 100644
@@ -225,10 +225,10 @@ static int brcmf_feat_fwcap_debugfs_read(struct seq_file *seq, void *data)
 	}
 
 	/* Usually there is a space at the end of capabilities string */
-	seq_printf(seq, "%s", caps);
+	seq_puts(seq, caps);
 	/* So make sure we don't print two line breaks */
 	if (tmp > caps && *(tmp - 1) != '\n')
-		seq_printf(seq, "\n");
+		seq_putc(seq, '\n');
 
 	return 0;
 }

--
2.22.0

maintainer
#1 lore raw
Quoted 7 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Tue, 2 Jul 2019 11:31:07 +0200

A line break and a single string should be put into a sequence. Thus use the corresponding output functions.

This issue was detected by using the Coccinelle software.

pot-ato, po-tato

Quoted 25 lines
---
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +2 -3
index 73aff4e4039d..ec0e80296e43 100644
@@ -225,10 +225,10 @@ static int brcmf_feat_fwcap_debugfs_read(struct seq_file *seq, void *data)
  	}
 
  	/* Usually there is a space at the end of capabilities string */
-	seq_printf(seq, "%s", caps);
+	seq_puts(seq, caps);
  	/* So make sure we don't print two line breaks */
  	if (tmp > caps && *(tmp - 1) != '\n')
-		seq_printf(seq, "\n");
+		seq_putc(seq, '\n');
 
  	return 0;
  }
--

2.22.0