linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haowen Bai <baihaowen@meizu.com>
To: <kjain@linux.ibm.com>
Cc: <baihaowen@meizu.com>, <benh@kernel.crashing.org>,
	<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
	<linuxppc-dev@lists.ozlabs.org>, <mpe@ellerman.id.au>,
	<paulus@samba.org>, <shuah@kernel.org>
Subject: [PATCH V2] selftests/powerpc/pmu: Fix unsigned function returning negative constant
Date: Tue, 26 Apr 2022 14:46:23 +0800	[thread overview]
Message-ID: <1650955583-29581-1-git-send-email-baihaowen@meizu.com> (raw)
In-Reply-To: <0e4b0f8e-6c45-8d14-303f-2168f5004a12@linux.ibm.com>

The function __perf_reg_mask has an unsigned return type, but returns a
negative constant to indicate an error condition. So we change unsigned
to int.

Fixes: 5f6c3061af7c ("selftests/powerpc/pmu: Add utility functions to post
process the mmap buffer")

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
V1->V2: add fix tag.

 tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c b/tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c
index fca054bbc094..c01a31d5f4ee 100644
--- a/tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c
+++ b/tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c
@@ -274,7 +274,7 @@ u64 *get_intr_regs(struct event *event, void *sample_buff)
 	return intr_regs;
 }
 
-static const unsigned int __perf_reg_mask(const char *register_name)
+static const int __perf_reg_mask(const char *register_name)
 {
 	if (!strcmp(register_name, "R0"))
 		return 0;
-- 
2.7.4


  reply	other threads:[~2022-04-26  6:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24  8:26 [PATCH] selftests/powerpc/pmu: Fix unsigned function returning negative constant Haowen Bai
2022-04-26  6:30 ` kajoljain
2022-04-26  6:46   ` Haowen Bai [this message]
2022-05-15 10:12 ` Michael Ellerman

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=1650955583-29581-1-git-send-email-baihaowen@meizu.com \
    --to=baihaowen@meizu.com \
    --cc=benh@kernel.crashing.org \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=shuah@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;
as well as URLs for NNTP newsgroup(s).