* [PATCH] selftests/powerpc/pmu: Fix unsigned function returning negative constant
@ 2022-04-24 8:26 Haowen Bai
2022-04-26 6:30 ` kajoljain
2022-05-15 10:12 ` [PATCH] " Michael Ellerman
0 siblings, 2 replies; 4+ messages in thread
From: Haowen Bai @ 2022-04-24 8:26 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras, Shuah Khan
Cc: Haowen Bai, linuxppc-dev, linux-kselftest, linux-kernel
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.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] selftests/powerpc/pmu: Fix unsigned function returning negative constant
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 ` [PATCH V2] " Haowen Bai
2022-05-15 10:12 ` [PATCH] " Michael Ellerman
1 sibling, 1 reply; 4+ messages in thread
From: kajoljain @ 2022-04-26 6:30 UTC (permalink / raw)
To: Haowen Bai, Michael Ellerman, Benjamin Herrenschmidt,
Paul Mackerras, Shuah Khan
Cc: linuxppc-dev, linux-kselftest, linux-kernel
On 4/24/22 13:56, Haowen Bai wrote:
> 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.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> 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)
> {
Hi Haowen,
Thanks for correcting it. Can you also add fix tag with corresponding
commit id details.
Other than that patch looks good to me.
Reviewed-by: Kajol Jain<kjain@linux.ibm.com>
Thanks,
Kajol Jain
> if (!strcmp(register_name, "R0"))
> return 0;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH V2] selftests/powerpc/pmu: Fix unsigned function returning negative constant
2022-04-26 6:30 ` kajoljain
@ 2022-04-26 6:46 ` Haowen Bai
0 siblings, 0 replies; 4+ messages in thread
From: Haowen Bai @ 2022-04-26 6:46 UTC (permalink / raw)
To: kjain
Cc: baihaowen, benh, linux-kernel, linux-kselftest, linuxppc-dev,
mpe, paulus, shuah
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] selftests/powerpc/pmu: Fix unsigned function returning negative constant
2022-04-24 8:26 [PATCH] selftests/powerpc/pmu: Fix unsigned function returning negative constant Haowen Bai
2022-04-26 6:30 ` kajoljain
@ 2022-05-15 10:12 ` Michael Ellerman
1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2022-05-15 10:12 UTC (permalink / raw)
To: Michael Ellerman, Shuah Khan, Benjamin Herrenschmidt,
Paul Mackerras, Haowen Bai
Cc: linuxppc-dev, linux-kernel, linux-kselftest
On Sun, 24 Apr 2022 16:26:41 +0800, Haowen Bai wrote:
> 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.
>
>
Applied to powerpc/next.
[1/1] selftests/powerpc/pmu: Fix unsigned function returning negative constant
https://git.kernel.org/powerpc/c/a84ca704d8306a949578d36c028c8e1bab3dcf0b
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-15 10:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH V2] " Haowen Bai
2022-05-15 10:12 ` [PATCH] " Michael Ellerman
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).