lkml.org 
[lkml]   [2023]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] perf/x86/core: Use sysfs_emit() in show() callback function
On Tue, Feb 21, 2023 at 07:36:12PM +0530, Deepak R Varma wrote:
> diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> index 85a63a41c471..27c03e6dcb5d 100644
> --- a/arch/x86/events/core.c
> +++ b/arch/x86/events/core.c
> @@ -1896,9 +1896,7 @@ ssize_t events_hybrid_sysfs_show(struct device *dev,
> if (x86_pmu.hybrid_pmu[i].cpu_type & pmu->cpu_type) {
> next_str = strchr(str, ';');
> if (next_str)
> - return snprintf(page, next_str - str + 1, "%s", str);
> - else
> - return sprintf(page, "%s", str);
> + return sysfs_emit(page, "%s", str);
> }
> str = strchr(str, ';');
> str++;

How is this correct ?!?

\
 
 \ /
  Last update: 2023-03-27 00:32    [W:0.489 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site