From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf: arm_v7_pmu: suppress -Winitializer-overrides for perf maps
Date: Wed, 11 Nov 2026 02:58:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-208141@kernel.org> (raw)
In-Reply-To: <20261111023326.70922-1-rosenp@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] perf: arm_v7_pmu: Clang-only -Winitializer-overrides breaks GCC
builds
--
commit 56df4775a501226704b362f4cef9ce6d443becbf
Author: Rosen Penev <rosenp@gmail.com>
perf: arm_v7_pmu: suppress -Winitializer-overrides for perf maps
This commit wraps the perf_map and cache_map array definitions in
drivers/perf/arm_v7_pmu.c with __diag_push(), __diag_ignore_all(), and
__diag_pop() to suppress designated initializer override warnings.
> diff --git a/drivers/perf/arm_v7_pmu.c b/drivers/perf/arm_v7_pmu.c
> index a1e438101114a..9ac28c8adf801 100644
> --- a/drivers/perf/arm_v7_pmu.c
> +++ b/drivers/perf/arm_v7_pmu.c
> @@ -146,6 +146,15 @@
>
> #define SCORPION_ITLB_MISS 0x12021
>
> +/*
> + * The perf_map and cache_map arrays use range initializers to fill all
> + * entries with HW_OP_UNSUPPORTED / CACHE_OP_UNSUPPORTED, then override
> + * specific entries with supported event codes. This is valid C99 but
> + * triggers Clang's -Winitializer-overrides.
> + */
> +__diag_push();
> +__diag_ignore_all("-Winitializer-overrides", "");
[Severity: High]
Does passing "-Winitializer-overrides" to __diag_ignore_all() break GCC
builds with CONFIG_WERROR=y?
__diag_ignore_all() expands on both Clang and GCC, producing a
"#pragma GCC diagnostic ignored" directive on GCC. Because
-Winitializer-overrides is a Clang-specific flag name, GCC rejects the
pragma with a -Wpragmas warning and leaves its own -Woverride-init warning
unsuppressed in W=1 builds. Using "-Woverride-init" (with a non-empty
comment argument) works on both compilers since Clang supports it as an
alias for -Winitializer-overrides.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261111023326.70922-1-rosenp@gmail.com?part=1
prev parent reply other threads:[~2026-11-11 2:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 2:33 [PATCH] perf: arm_v7_pmu: suppress -Winitializer-overrides for perf maps Rosen Penev
2026-11-11 2:58 ` sashiko-bot [this message]
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=sashiko-outbox-208141@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=rosenp@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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