Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548889 > unrolled thread

[PATCH 0/5] staging-Lustre: Fine-tuning for some function implementations

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-01-01 17:40 +0100
Last post2017-01-01 17:50 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/5] staging-Lustre: Fine-tuning for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-01-01 17:40 +0100
    [PATCH 5/5] staging/lustre/obdclass: Use seq_puts() in three  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-01-01 17:50 +0100

#1548889 — [PATCH 0/5] staging-Lustre: Fine-tuning for some function implementations

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-01-01 17:40 +0100
Subject[PATCH 0/5] staging-Lustre: Fine-tuning for some function implementations
Message-ID<sURkR-2H5-3@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 1 Jan 2017 17:10:10 +0100

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (5):
  llite: Use seq_puts() in three functions
  mgc: Combine two seq_printf() calls into one call in lprocfs_mgc_rd_ir_state()
  obdclass: Use seq_putc() in four functions
  obdclass: Combine two seq_printf() calls into one call in lprocfs_rd_state()
  obdclass: Use seq_puts() in three functions

 drivers/staging/lustre/lustre/llite/lproc_llite.c  | 12 +++++------
 drivers/staging/lustre/lustre/mgc/mgc_request.c    |  5 +----
 drivers/staging/lustre/lustre/obdclass/cl_object.c |  8 ++++----
 .../lustre/lustre/obdclass/lprocfs_status.c        | 23 ++++++++++------------
 4 files changed, 21 insertions(+), 27 deletions(-)

-- 
2.11.0

[toc] | [next] | [standalone]


#1548892 — [PATCH 5/5] staging/lustre/obdclass: Use seq_puts() in three functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-01-01 17:50 +0100
Subject[PATCH 5/5] staging/lustre/obdclass: Use seq_puts() in three functions
Message-ID<sURux-2Km-3@gated-at.bofh.it>
In reply to#1548889
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 1 Jan 2017 16:45:32 +0100

A string which did not contain a data format specification should be put
into a sequence. Thus use the corresponding function "seq_puts"
so that the data output will be a bit more efficient in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/staging/lustre/lustre/obdclass/cl_object.c      |  4 ++--
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 15 +++++++--------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c
index 277908d66a89..3e00aa4747b8 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
@@ -510,11 +510,11 @@ locks: ...... ...... ...... ...... ...... [...... ...... ...... ...... ......]
  */
 	lu_site_stats_print(&site->cs_lu, m);
 	cache_stats_print(&site->cs_pages, m, 1);
-	seq_printf(m, " [");
+	seq_puts(m, " [");
 	for (i = 0; i < ARRAY_SIZE(site->cs_pages_state); ++i)
 		seq_printf(m, "%s: %u ", pstate[i],
 			   atomic_read(&site->cs_pages_state[i]));
-	seq_printf(m, "]\n");
+	seq_puts(m, "]\n");
 	cache_stats_print(&cl_env_stats, m, 0);
 	seq_putc(m, '\n');
 	return 0;
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index a167cbe8a50e..3ce590cdd957 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -649,7 +649,7 @@ static int obd_import_flags2str(struct obd_import *imp, struct seq_file *m)
 	bool first = true;
 
 	if (imp->imp_obd->obd_no_recov) {
-		seq_printf(m, "no_recov");
+		seq_puts(m, "no_recov");
 		first = false;
 	}
 
@@ -715,15 +715,14 @@ int lprocfs_rd_import(struct seq_file *m, void *data)
 		   imp->imp_connect_data.ocd_instance);
 	obd_connect_seq_flags2str(m, imp->imp_connect_data.ocd_connect_flags,
 				  ", ");
-	seq_printf(m, " ]\n");
+	seq_puts(m, " ]\n");
 	obd_connect_data_seqprint(m, ocd);
-	seq_printf(m, "    import_flags: [ ");
+	seq_puts(m, "    import_flags: [ ");
 	obd_import_flags2str(imp, m);
-
-	seq_printf(m,
-		   " ]\n"
-		   "    connection:\n"
-		   "       failover_nids: [ ");
+	seq_puts(m,
+		 " ]\n"
+		 "    connection:\n"
+		 "       failover_nids: [ ");
 	spin_lock(&imp->imp_lock);
 	j = 0;
 	list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
-- 
2.11.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web