[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f26722a-e838-4674-9617-87aea0a5d6ea@fujitsu.com>
Date: Tue, 16 Jan 2024 07:35:30 +0000
From: "Zhijian Li (Fujitsu)" <lizhijian@...itsu.com>
To: Adrian Hunter <adrian.hunter@...el.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Mark Rutland
<mark.rutland@....com>, Alexander Shishkin
<alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, Namhyung
Kim <namhyung@...nel.org>, Ian Rogers <irogers@...gle.com>, Thomas Gleixner
<tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>, Dave Hansen
<dave.hansen@...ux.intel.com>, "x86@...nel.org" <x86@...nel.org>, "H. Peter
Anvin" <hpa@...or.com>, "linux-perf-users@...r.kernel.org"
<linux-perf-users@...r.kernel.org>
Subject: Re: [PATCH 04/42] arch/x86/events/core: Convert snprintf to
sysfs_emit
Adrian,
On 16/01/2024 15:01, Adrian Hunter wrote:
>> diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
>> index 40ad1425ffa2..52e5707be03b 100644
>> --- a/arch/x86/events/core.c
>> +++ b/arch/x86/events/core.c
>> @@ -1892,7 +1892,7 @@ ssize_t events_hybrid_sysfs_show(struct device *dev,
>> if (x86_pmu.hybrid_pmu[i].pmu_type & pmu->pmu_type) {
>> next_str = strchr(str, ';');
>> if (next_str)
>> - return snprintf(page, next_str - str + 1, "%s", str);
>> + return sysfs_emit(page, "%s", str);
> The intention seems to be to print only up to, and not including, the next ';',
> but sysfs_emit() is not going to do that.
Indeed, it intend to print a sub-string only, this conversion was wrong.
Let's leave it alone
Powered by blists - more mailing lists