Skip to contentSkip to conversation

Staging: lustre: Use seq_puts instead of seq_printf

PATCH In review Bhumika Goyal 2 participants 3 messages Feb 27, 2016 – Mar 2, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lustre: Use seq_puts instead of seq_printf

This patch converts the seq_printf output with constant strings to seq_puts.
Done using coccinelle:

@@
identifier a;
constant b;
@@
(
- seq_printf(a,"\n");
+ seq_putc(a,'\n');
|
- seq_printf(a,b);
+ seq_puts(a,b);
)

---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 14 +++++++-------
 drivers/staging/lustre/lustre/mgc/mgc_request.c   |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/lustre/lustre/llite/lproc_llite.c +7 -7
index f5fe928..a6aec0e 100644
@@ -776,7 +776,7 @@ static int ll_sbi_flags_seq_show(struct seq_file *m, void *v)
 		flags >>= 1;
 		++i;
 	}
-	seq_printf(m, "\b\n");
+	seq_puts(m, "\b\n");
 	return 0;
 }
 
@@ -1153,8 +1153,8 @@ static int ll_rw_extents_stats_pp_seq_show(struct seq_file *seq, void *v)
 	ktime_get_real_ts64(&now);
 
 	if (!sbi->ll_rw_stats_on) {
-		seq_printf(seq, "disabled\n"
-			   "write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
+		seq_puts(seq,
+			 "disabled\n write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
 		return 0;
 	}
 	seq_printf(seq, "snapshot_time:	 %llu.%09lu (secs.usecs)\n",
@@ -1231,8 +1231,8 @@ static int ll_rw_extents_stats_seq_show(struct seq_file *seq, void *v)
 	ktime_get_real_ts64(&now);
 
 	if (!sbi->ll_rw_stats_on) {
-		seq_printf(seq, "disabled\n"
-			   "write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
+		seq_puts(seq,
+			 "disabled\n write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
 		return 0;
 	}
 	seq_printf(seq, "snapshot_time:	 %llu.%09lu (secs.usecs)\n",
@@ -1411,8 +1411,8 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v)
 	ktime_get_real_ts64(&now);
 
 	if (!sbi->ll_rw_stats_on) {
-		seq_printf(seq, "disabled\n"
-			   "write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
+		seq_puts(seq,
+			 "disabled\n write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
 		return 0;
 	}
 	spin_lock(&sbi->ll_process_lock);
drivers/staging/lustre/lustre/mgc/mgc_request.c +1 -1
index 6fc8225..a72fad3 100644
@@ -455,7 +455,7 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
 
 	seq_printf(m, "imperative_recovery: %s\n",
 		      OCD_HAS_FLAG(ocd, IMP_RECOV) ? "ENABLED" : "DISABLED");
-	seq_printf(m, "client_state:\n");
+	seq_puts(m, "client_state:\n");
 
 	spin_lock(&config_list_lock);
 	list_for_each_entry(cld, &config_llog_list, cld_list_chain) {
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 16 lines · Bhumika Goyal

This patch converts the seq_printf output with constant strings to seq_puts.
Done using coccinelle:

@@
identifier a;
constant b;
@@
(
- seq_printf(a,"\n");
+ seq_putc(a,'\n');
|
- seq_printf(a,b);
+ seq_puts(a,b);
)

Quoted 6 lines
---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 14 +++++++-------
 drivers/staging/lustre/lustre/mgc/mgc_request.c   |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

Doesn't apply to my tree :(

maintainer
#2 lore raw
In reply to Bhumika Goyal
Quoted 16 lines · Bhumika Goyal

This patch converts the seq_printf output with constant strings to seq_puts.
Done using coccinelle:

@@
identifier a;
constant b;
@@
(
- seq_printf(a,"\n");
+ seq_putc(a,'\n');
|
- seq_printf(a,b);
+ seq_puts(a,b);
)

Quoted 6 lines
---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 14 +++++++-------
 drivers/staging/lustre/lustre/mgc/mgc_request.c   |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

Doesn't apply to my tree :(