From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: Ian Rogers <irogers@google.com>
Cc: kan.liang@linux.intel.com, acme@kernel.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf test pmu: Remove unused test_pmus
Date: Mon, 29 Jul 2024 15:07:19 +0000 [thread overview]
Message-ID: <ZqewJ6oIprdRY8C5@gallifrey> (raw)
In-Reply-To: <CAP-5=fW+VbDaFV+YQCMMKYzrraMLLuVqb=BChL0o=-D5Y=4N_w@mail.gmail.com>
* Ian Rogers (irogers@google.com) wrote:
> On Sat, Jul 27, 2024 at 10:59 AM <linux@treblig.org> wrote:
> >
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > Commit aa1551f299ba ("perf test pmu: Refactor format test and exposed
> > test APIs") added the 'test_pmus' list, but didn't use it.
> > (It seems to put them on the other_pmus list?)
> >
> > Remove it.
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>
> Strange that the compiler doesn't warn about unused stuff like this,
> we get unused variables within a function and unused static
> functions...
The problem is that LIST_HEAD initialises the list to point to itself;
so it *is* used - but only in it's own initialiser.
I did file:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115027
> Reviewed-by: Ian Rogers <irogers@google.com>
Thanks,
> Possibly:
> Fixes: aa1551f299ba ("perf test pmu: Refactor format test and exposed
> test APIs")
Given it's got no actual effect other than a few bytes
saved, I'm not sure it's worth the Fixes.
Dave
> Thanks,
> Ian
>
> > ---
> > tools/perf/tests/pmu.c | 3 ---
> > 1 file changed, 3 deletions(-)
> >
> > diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c
> > index 40132655ccd1..0b2f04a55d7b 100644
> > --- a/tools/perf/tests/pmu.c
> > +++ b/tools/perf/tests/pmu.c
> > @@ -18,9 +18,6 @@
> > #include <sys/stat.h>
> > #include <sys/types.h>
> >
> > -/* Fake PMUs created in temp directory. */
> > -static LIST_HEAD(test_pmus);
> > -
> > /* Cleanup test PMU directory. */
> > static int test_pmu_put(const char *dir, struct perf_pmu *pmu)
> > {
> > --
> > 2.45.2
> >
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
next prev parent reply other threads:[~2024-07-29 15:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-27 17:59 [PATCH] perf test pmu: Remove unused test_pmus linux
2024-07-29 14:52 ` Ian Rogers
2024-07-29 15:07 ` Dr. David Alan Gilbert [this message]
2024-07-29 15:53 ` Ian Rogers
2024-07-30 18:59 ` Arnaldo Carvalho de Melo
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=ZqewJ6oIprdRY8C5@gallifrey \
--to=linux@treblig.org \
--cc=acme@kernel.org \
--cc=irogers@google.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.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).