mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Deepak R Varma <drv@mailo.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Saurabh Singh Sengar <ssengar@microsoft.com>,
	Praveen Kumar <kumarpraveen@linux.microsoft.com>
Subject: Re: [PATCH v2 1/3] perf/x86/core: Use sysfs_emit() in show() callback function
Date: Wed, 22 Feb 2023 21:35:53 +0100	[thread overview]
Message-ID: <Y/Z8qUYDXPFlzdsY@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <719558b8a435a6f942b2cc3f5c0431212be76bc6.1676987821.git.drv@mailo.com>

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 ?!?

  reply	other threads:[~2023-02-22 20:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 14:05 [PATCH v2 0/3] perf/x86: " Deepak R Varma
2023-02-21 14:06 ` [PATCH v2 1/3] perf/x86/core: " Deepak R Varma
2023-02-22 20:35   ` Peter Zijlstra [this message]
2023-02-23  4:55     ` Deepak R Varma
2023-02-26 17:36       ` Deepak R Varma
2023-02-21 14:06 ` [PATCH v2 2/3] perf/x86/intel/pt: " Deepak R Varma
2023-02-21 14:07 ` [PATCH v2 3/3] perf/x86/intel: " Deepak R Varma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/Z8qUYDXPFlzdsY@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=drv@mailo.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=kumarpraveen@linux.microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=ssengar@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®