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


Groups > linux.kernel > #1558062

Re: [PATCH 2/5] staging/lustre/mgc: Combine two seq_printf() calls into one call in lprocfs_mgc_rd_ir_state()

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Oleg Drokin <oleg.drokin@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/5] staging/lustre/mgc: Combine two seq_printf() calls into one call in lprocfs_mgc_rd_ir_state()
Date Fri, 13 Jan 2017 08:00:01 +0100
Message-ID <sZ409-62y-5@gated-at.bofh.it> (permalink)
References <sURkR-2H5-3@gated-at.bofh.it> <sURkR-2H5-13@gated-at.bofh.it>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.33,220,1477983600"; d="scan'208";a="1111964522"
MIME-Version 1.0 (Apple Message framework v1283)
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 8BIT
X-Mailer Apple Mail (2.1283)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc <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>, Sebastien Buisson <sbuisson@ddn.com>, Stephen Champion <schamp@sgi.com>, wang di <di.wang@intel.com>, LKML <linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
X-Original-Date Fri, 13 Jan 2017 01:58:37 -0500
X-Original-Message-ID <C204F97C-59ED-4558-9322-0EC7B63AA44B@intel.com>
X-Original-References <45ae8939-a775-865b-ade0-9e38a7ff2b5d@users.sourceforge.net> <25b07069-c624-cdd4-ca7b-85aaae51e79e@users.sourceforge.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1558062

Show key headers only | View raw


On Jan 1, 2017, at 11:35 AM, SF Markus Elfring wrote:

> From: Markus Elfring <elfring@users.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@users.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

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 2/5] staging/lustre/mgc: Combine two seq_printf() calls into one call in lprocfs_mgc_rd_ir_state() Oleg Drokin <oleg.drokin@intel.com> - 2017-01-13 08:00 +0100
  Re: [PATCH 2/5] staging/lustre/mgc: Combine two seq_printf() calls  into one call in lprocfs_mgc_rd_ir_state() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-13 08:50 +0100

csiph-web