From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbcJWFmc (ORCPT ); Sun, 23 Oct 2016 01:42:32 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:10470 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbcJWFm2 (ORCPT ); Sun, 23 Oct 2016 01:42:28 -0400 X-IronPort-AV: E=Sophos;i="5.31,387,1473112800"; d="scan'208";a="241969758" Date: Sun, 23 Oct 2016 07:42:05 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: SF Markus Elfring cc: Joe Perches , linux-ia64@vger.kernel.org, Al Viro , Borislav Petkov , Fenghua Yu , Greg Kroah-Hartman , Hans-Christian Noren Egtvedt , Ingo Molnar , =?ISO-8859-15?Q?J=F6rg_R=F6del?= , Krzysztof Kozlowski , Robert Richter , Robin Murphy , Tony Luck , Toshi Kani , Vineet Gupta , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 6/6] IA64-sn2_smp: Combine two seq_printf() calls into one call in sn2_ptc_seq_show() In-Reply-To: <72f6fc41-9bf8-2eef-848f-8eefba7dade6@users.sourceforge.net> Message-ID: References: <8daf03e1-5f6d-fc3b-c2db-397e6d4a9a1c@users.sourceforge.net> <1477166856.3817.4.camel@perches.com> <72f6fc41-9bf8-2eef-848f-8eefba7dade6@users.sourceforge.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 22 Oct 2016, SF Markus Elfring wrote: > >> @@ -494,12 +494,11 @@ static int sn2_ptc_seq_show(struct seq_file *file, void *data) > >> int cpu; > >> > >> cpu = *(loff_t *) data; > >> - > >> - if (!cpu) { > >> + if (!cpu) > >> seq_printf(file, > >> - "# cpu ptc_l newrid ptc_flushes nodes_flushed deadlocks lock_nsec shub_nsec shub_nsec_max not_my_mm deadlock2 ipi_fluches ipi_nsec\n"); > >> - seq_printf(file, "# ptctest %d, flushopt %d\n", sn2_ptctest, sn2_flush_opt); > >> - } > >> + "# cpu ptc_l newrid ptc_flushes nodes_flushed deadlocks lock_nsec shub_nsec shub_nsec_max not_my_mm deadlock2 ipi_fluches ipi_nsec\n" > >> + "# ptctest %d, flushopt %d\n", > >> + sn2_ptctest, sn2_flush_opt); > >> > >> if (cpu < nr_cpu_ids && cpu_online(cpu)) { > >> stat = &per_cpu(ptcstats, cpu); > > > > Please think more. > > > > printf has to inspect character by character looking for > > a vsprintf % character and 0 termination. > > > > seq_puts does a strlen then memcpy. > > Would you prefer to use this function also at this source code place? I think that he is expecting that you will figure out the answer by yourself. julia