Re: [PATCH 6/6] IA64-sn2_smp: Combine two seq_printf() calls into one call in sn2_ptc_seq_show()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Joe Perches <joe@xxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx
- Subject: Re: [PATCH 6/6] IA64-sn2_smp: Combine two seq_printf() calls into one call in sn2_ptc_seq_show()
- From: SF Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 22 Oct 2016 22:48:07 +0200
- Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Borislav Petkov <bp@xxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Hans-Christian Noren Egtvedt <egtvedt@xxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Jörg Rödel <jroedel@xxxxxxx>, Krzysztof Kozlowski <krzk@xxxxxxxxxx>, Robert Richter <rrichter@xxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Toshi Kani <toshi.kani@xxxxxxx>, Vineet Gupta <vgupta@xxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, kernel-janitors@xxxxxxxxxxxxxxx
- In-reply-to: <1477166856.3817.4.camel@perches.com>
- References: <8daf03e1-5f6d-fc3b-c2db-397e6d4a9a1c@users.sourceforge.net> <c3e12189-6122-e806-6cb2-b2518e64e983@users.sourceforge.net> <1477166856.3817.4.camel@perches.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0
>> @@ -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?
Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]