2022-09-29 14:09:52

by Jiri Olsa

[permalink] [raw]
Subject: [PATCH 2/2] perf tools: Remove unused variable in tests/test-basic.c

The clang 15 build reveal several unused-but-set variables,
removing the 'foo' variable in tests/mmap-basic.o object.

Signed-off-by: Jiri Olsa <[email protected]>
---
tools/perf/tests/mmap-basic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index 21b5e68179d7..8322fc2295fa 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -112,8 +112,7 @@ static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest

for (i = 0; i < nsyscalls; ++i)
for (j = 0; j < expected_nr_events[i]; ++j) {
- int foo = syscalls[i]();
- ++foo;
+ syscalls[i]();
}

md = &evlist->mmap[0];
--
2.37.3


2022-09-29 18:15:26

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf tools: Remove unused variable in tests/test-basic.c

Em Thu, Sep 29, 2022 at 04:05:14PM +0200, Jiri Olsa escreveu:
> The clang 15 build reveal several unused-but-set variables,
> removing the 'foo' variable in tests/mmap-basic.o object.



Thanks, applied.

- Arnaldo


> Signed-off-by: Jiri Olsa <[email protected]>
> ---
> tools/perf/tests/mmap-basic.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
> index 21b5e68179d7..8322fc2295fa 100644
> --- a/tools/perf/tests/mmap-basic.c
> +++ b/tools/perf/tests/mmap-basic.c
> @@ -112,8 +112,7 @@ static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest
>
> for (i = 0; i < nsyscalls; ++i)
> for (j = 0; j < expected_nr_events[i]; ++j) {
> - int foo = syscalls[i]();
> - ++foo;
> + syscalls[i]();
> }
>
> md = &evlist->mmap[0];
> --
> 2.37.3

--

- Arnaldo