[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <C204F97C-59ED-4558-9322-0EC7B63AA44B@intel.com>
Date: Fri, 13 Jan 2017 01:58:37 -0500
From: Oleg Drokin <oleg.drokin@...el.com>
To: SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc: <devel@...verdev.osuosl.org>, <lustre-devel@...ts.lustre.org>,
"Andreas Dilger" <andreas.dilger@...el.com>,
Ben Evans <bevans@...y.com>, Bobi Jam <bobijam.xu@...el.com>,
Emoly Liu <emoly.liu@...el.com>, Fan Yong <fan.yong@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Gregoire Pichon <gregoire.pichon@...l.net>,
Henri Doreau <henri.doreau@....fr>,
James Simmons <jsimmons@...radead.org>,
Jinshan Xiong <jinshan.xiong@...el.com>,
"John L. Hammond" <john.hammond@...el.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Lai Siyao <lai.siyao@...el.com>,
Sebastien Buisson <sbuisson@....com>,
Stephen Champion <schamp@....com>, wang di <di.wang@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
<kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH 2/5] staging/lustre/mgc: Combine two seq_printf() calls into one call in lprocfs_mgc_rd_ir_state()
On Jan 1, 2017, at 11:35 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Sun, 1 Jan 2017 15:40:29 +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@...rs.sourceforge.net>
> ---
> drivers/staging/lustre/lustre/mgc/mgc_request.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c
> index b9c522a3c7a4..a6ca48d7e96b 100644
> --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
> +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
> @@ -460,11 +460,8 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
>
> imp = obd->u.cli.cl_import;
> ocd = &imp->imp_connect_data;
> -
> - seq_printf(m, "imperative_recovery: %s\n",
> + seq_printf(m, "imperative_recovery: %s\nclient_state:\n",
> OCD_HAS_FLAG(ocd, IMP_RECOV) ? "ENABLED" : "DISABLED");
> - seq_printf(m, "client_state:\n");
> -
Ugh, do we really need this?
I know it saves one call to seq_printf, but this is not a super performance-critical
code, and two calls are actually easier to read, don't you think?
> spin_lock(&config_list_lock);
> list_for_each_entry(cld, &config_llog_list, cld_list_chain) {
> if (!cld->cld_recover)
> --
> 2.11.0
Powered by blists - more mailing lists