]> git.ipfire.org Git - thirdparty/linux.git/commit
perf tests sw-clock: Mark the volatile tmp variable as __maybe_unused
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Jan 2026 20:47:09 +0000 (17:47 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Jan 2026 23:49:53 +0000 (20:49 -0300)
commit01ea38942bdcd28a7962d49d6f3a602979b81009
tree0061ad39baaa22734ddb5da83039c2d0218a9067
parent3d020f2e3baea49f68c71f73ebb947da8e6fedc5
perf tests sw-clock: Mark the volatile tmp variable as __maybe_unused

As it is just used to waste some cycles, not being used as all, to
silence some compilers.

Noticed with gcc version 16.0.1 20260115 on fedora 44:

    tests/sw-clock.c: In function '__test__sw_clock_freq':
    tests/sw-clock.c:31:22: error: variable 'tmp' set but not used [-Werror=unused-but-set-variable=]
       31 |         volatile int tmp = 0;
          |                      ^~~

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/sw-clock.c