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


Groups > linux.kernel > #1548886 > unrolled thread

[PATCH 4/5] staging/lustre/obdclass: Combine two seq_printf() calls into one call in lprocfs_rd_state()

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

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/5] staging/lustre/obdclass: Combine two seq_printf() calls  into one call in lprocfs_rd_state() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-01-01 17:40 +0100

#1548886 — [PATCH 4/5] staging/lustre/obdclass: Combine two seq_printf() calls into one call in lprocfs_rd_state()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-01-01 17:40 +0100
Subject[PATCH 4/5] staging/lustre/obdclass: Combine two seq_printf() calls into one call in lprocfs_rd_state()
Message-ID<sURkS-2H5-25@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 1 Jan 2017 16:26:36 +0100

Some data were printed into a sequence by two separate function calls.
Print the same data by a single function call instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 3f6fcab5a1fc..a167cbe8a50e 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -853,10 +853,8 @@ int lprocfs_rd_state(struct seq_file *m, void *data)
 		return rc;
 
 	imp = obd->u.cli.cl_import;
-
-	seq_printf(m, "current_state: %s\n",
+	seq_printf(m, "current_state: %s\nstate_history:\n",
 		   ptlrpc_import_state_name(imp->imp_state));
-	seq_printf(m, "state_history:\n");
 	k = imp->imp_state_hist_idx;
 	for (j = 0; j < IMP_STATE_HIST_LEN; j++) {
 		struct import_state_hist *ish =
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web