From: SF Markus Elfring <elfring@users.sourceforge.net>
To: devel@driverdev.osuosl.org, lustre-devel@lists.lustre.org,
Andreas Dilger <andreas.dilger@intel.com>,
Ben Evans <bevans@cray.com>, Bobi Jam <bobijam.xu@intel.com>,
Emoly Liu <emoly.liu@intel.com>, Fan Yong <fan.yong@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Gregoire Pichon <gregoire.pichon@bull.net>,
Henri Doreau <henri.doreau@cea.fr>,
James Simmons <jsimmons@infradead.org>,
Jinshan Xiong <jinshan.xiong@intel.com>,
"John L. Hammond" <john.hammond@intel.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Lai Siyao <lai.siyao@intel.com>,
Oleg Drokin <oleg.drokin@intel.com>,
Sebastien Buisson <sbuisson@ddn.com>,
Stephen Champion <schamp@sgi.com>, wang di <di.wang@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 5/5] staging/lustre/obdclass: Use seq_puts() in three functions
Date: Sun, 1 Jan 2017 17:40:05 +0100 [thread overview]
Message-ID: <8d8a448c-4648-2b52-ab88-d3145f6be804@users.sourceforge.net> (raw)
In-Reply-To: <45ae8939-a775-865b-ade0-9e38a7ff2b5d@users.sourceforge.net>
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
prev parent reply other threads:[~2017-01-01 16:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-01 16:30 [PATCH 0/5] staging-Lustre: Fine-tuning for some function implementations SF Markus Elfring
2017-01-01 16:33 ` [PATCH 1/5] staging/lustre/llite: Use seq_puts() in three functions SF Markus Elfring
2017-01-01 16:35 ` [PATCH 2/5] staging/lustre/mgc: Combine two seq_printf() calls into one call in lprocfs_mgc_rd_ir_state() SF Markus Elfring
2017-01-13 6:58 ` Oleg Drokin
2017-01-13 7:41 ` Greg Kroah-Hartman
2017-01-01 16:37 ` [PATCH 3/5] staging/lustre/obdclass: Use seq_putc() in four functions SF Markus Elfring
2017-01-01 16:38 ` [PATCH 4/5] staging/lustre/obdclass: Combine two seq_printf() calls into one call in lprocfs_rd_state() SF Markus Elfring
2017-01-13 6:59 ` Oleg Drokin
2017-01-01 16:40 ` SF Markus Elfring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d8a448c-4648-2b52-ab88-d3145f6be804@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=andreas.dilger@intel.com \
--cc=bevans@cray.com \
--cc=bobijam.xu@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=di.wang@intel.com \
--cc=emoly.liu@intel.com \
--cc=fan.yong@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=gregoire.pichon@bull.net \
--cc=henri.doreau@cea.fr \
--cc=jinshan.xiong@intel.com \
--cc=john.hammond@intel.com \
--cc=jsimmons@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=lai.siyao@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lustre-devel@lists.lustre.org \
--cc=oleg.drokin@intel.com \
--cc=sbuisson@ddn.com \
--cc=schamp@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox