From: kernel test robot <lkp@intel.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, Marc Zyngier <maz@kernel.org>
Subject: drivers/perf/apple_m1_cpu_pmu.c:404:7: warning: variable 'user' set but not used
Date: Fri, 12 Dec 2025 22:21:07 +0800 [thread overview]
Message-ID: <202512122259.IXHvifS1-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 187d0801404f415f22c0b31531982c7ea97fa341
commit: 75ecffc361bbc85696c084f3d3c73eb207386e3f drivers/perf: apple_m1: Refactor event select/filter configuration
date: 9 months ago
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20251212/202512122259.IXHvifS1-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251212/202512122259.IXHvifS1-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512122259.IXHvifS1-lkp@intel.com/
All warnings (new ones prefixed by >>):
| ^~~~~~~~~~~~~
include/linux/bits.h:34:2: note: expanded from macro 'GENMASK'
34 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:162:35: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
162 | [M1_PMU_PERFCTR_UNKNOWN_f7] = ONLY_2_4_6,
| ^~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:27:22: note: expanded from macro 'ONLY_2_4_6'
27 | #define ONLY_2_4_6 (BIT(2) | BIT(4) | BIT(6))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:132:35: note: previous initialization is here
132 | [0 ... M1_PMU_PERFCTR_LAST] = ANY_BUT_0_1,
| ^~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:25:23: note: expanded from macro 'ANY_BUT_0_1'
25 | #define ANY_BUT_0_1 GENMASK(9, 2)
| ^~~~~~~~~~~~~
include/linux/bits.h:34:2: note: expanded from macro 'GENMASK'
34 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:163:35: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
163 | [M1_PMU_PERFCTR_UNKNOWN_f8] = ONLY_2_TO_7,
| ^~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:26:23: note: expanded from macro 'ONLY_2_TO_7'
26 | #define ONLY_2_TO_7 GENMASK(7, 2)
| ^~~~~~~~~~~~~
include/linux/bits.h:34:2: note: expanded from macro 'GENMASK'
34 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:132:35: note: previous initialization is here
132 | [0 ... M1_PMU_PERFCTR_LAST] = ANY_BUT_0_1,
| ^~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:25:23: note: expanded from macro 'ANY_BUT_0_1'
25 | #define ANY_BUT_0_1 GENMASK(9, 2)
| ^~~~~~~~~~~~~
include/linux/bits.h:34:2: note: expanded from macro 'GENMASK'
34 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:164:35: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
164 | [M1_PMU_PERFCTR_UNKNOWN_fd] = ONLY_2_4_6,
| ^~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:27:22: note: expanded from macro 'ONLY_2_4_6'
27 | #define ONLY_2_4_6 (BIT(2) | BIT(4) | BIT(6))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:132:35: note: previous initialization is here
132 | [0 ... M1_PMU_PERFCTR_LAST] = ANY_BUT_0_1,
| ^~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:25:23: note: expanded from macro 'ANY_BUT_0_1'
25 | #define ANY_BUT_0_1 GENMASK(9, 2)
| ^~~~~~~~~~~~~
include/linux/bits.h:34:2: note: expanded from macro 'GENMASK'
34 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:169:32: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
169 | [PERF_COUNT_HW_CPU_CYCLES] = M1_PMU_PERFCTR_CORE_ACTIVE_CYCLE,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:168:2: note: previous initialization is here
168 | PERF_MAP_ALL_UNSUPPORTED,
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/perf/arm_pmu.h:44:34: note: expanded from macro 'PERF_MAP_ALL_UNSUPPORTED'
44 | [0 ... PERF_COUNT_HW_MAX - 1] = HW_OP_UNSUPPORTED
| ^~~~~~~~~~~~~~~~~
include/linux/perf/arm_pmu.h:39:28: note: expanded from macro 'HW_OP_UNSUPPORTED'
39 | #define HW_OP_UNSUPPORTED 0xFFFF
| ^~~~~~
drivers/perf/apple_m1_cpu_pmu.c:170:34: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
170 | [PERF_COUNT_HW_INSTRUCTIONS] = M1_PMU_PERFCTR_INST_ALL,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:168:2: note: previous initialization is here
168 | PERF_MAP_ALL_UNSUPPORTED,
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/perf/arm_pmu.h:44:34: note: expanded from macro 'PERF_MAP_ALL_UNSUPPORTED'
44 | [0 ... PERF_COUNT_HW_MAX - 1] = HW_OP_UNSUPPORTED
| ^~~~~~~~~~~~~~~~~
include/linux/perf/arm_pmu.h:39:28: note: expanded from macro 'HW_OP_UNSUPPORTED'
39 | #define HW_OP_UNSUPPORTED 0xFFFF
| ^~~~~~
drivers/perf/apple_m1_cpu_pmu.c:171:40: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
171 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = M1_PMU_PERFCTR_INST_BRANCH,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:168:2: note: previous initialization is here
168 | PERF_MAP_ALL_UNSUPPORTED,
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/perf/arm_pmu.h:44:34: note: expanded from macro 'PERF_MAP_ALL_UNSUPPORTED'
44 | [0 ... PERF_COUNT_HW_MAX - 1] = HW_OP_UNSUPPORTED
| ^~~~~~~~~~~~~~~~~
include/linux/perf/arm_pmu.h:39:28: note: expanded from macro 'HW_OP_UNSUPPORTED'
39 | #define HW_OP_UNSUPPORTED 0xFFFF
| ^~~~~~
drivers/perf/apple_m1_cpu_pmu.c:172:35: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
172 | [PERF_COUNT_HW_BRANCH_MISSES] = M1_PMU_PERFCTR_BRANCH_MISPRED_NONSPEC,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/apple_m1_cpu_pmu.c:168:2: note: previous initialization is here
168 | PERF_MAP_ALL_UNSUPPORTED,
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/perf/arm_pmu.h:44:34: note: expanded from macro 'PERF_MAP_ALL_UNSUPPORTED'
44 | [0 ... PERF_COUNT_HW_MAX - 1] = HW_OP_UNSUPPORTED
| ^~~~~~~~~~~~~~~~~
include/linux/perf/arm_pmu.h:39:28: note: expanded from macro 'HW_OP_UNSUPPORTED'
39 | #define HW_OP_UNSUPPORTED 0xFFFF
| ^~~~~~
>> drivers/perf/apple_m1_cpu_pmu.c:404:7: warning: variable 'user' set but not used [-Wunused-but-set-variable]
404 | bool user, kernel;
| ^
drivers/perf/apple_m1_cpu_pmu.c:404:13: warning: variable 'kernel' set but not used [-Wunused-but-set-variable]
404 | bool user, kernel;
| ^
drivers/perf/apple_m1_cpu_pmu.c:405:5: warning: variable 'evt' set but not used [-Wunused-but-set-variable]
405 | u8 evt;
| ^
39 warnings generated.
vim +/user +404 drivers/perf/apple_m1_cpu_pmu.c
75ecffc361bbc8 Oliver Upton 2025-03-05 400
a639027a1be1d6 Marc Zyngier 2022-02-08 401 /* arm_pmu backend */
a639027a1be1d6 Marc Zyngier 2022-02-08 402 static void m1_pmu_enable_event(struct perf_event *event)
a639027a1be1d6 Marc Zyngier 2022-02-08 403 {
a639027a1be1d6 Marc Zyngier 2022-02-08 @404 bool user, kernel;
a639027a1be1d6 Marc Zyngier 2022-02-08 405 u8 evt;
a639027a1be1d6 Marc Zyngier 2022-02-08 406
a639027a1be1d6 Marc Zyngier 2022-02-08 407 evt = event->hw.config_base & M1_PMU_CFG_EVENT;
a639027a1be1d6 Marc Zyngier 2022-02-08 408 user = event->hw.config_base & M1_PMU_CFG_COUNT_USER;
a639027a1be1d6 Marc Zyngier 2022-02-08 409 kernel = event->hw.config_base & M1_PMU_CFG_COUNT_KERNEL;
a639027a1be1d6 Marc Zyngier 2022-02-08 410
a639027a1be1d6 Marc Zyngier 2022-02-08 411 m1_pmu_disable_counter_interrupt(event->hw.idx);
a639027a1be1d6 Marc Zyngier 2022-02-08 412 m1_pmu_disable_counter(event->hw.idx);
a639027a1be1d6 Marc Zyngier 2022-02-08 413 isb();
a639027a1be1d6 Marc Zyngier 2022-02-08 414
75ecffc361bbc8 Oliver Upton 2025-03-05 415 m1_pmu_configure_counter(event->hw.idx, event->hw.config_base);
a639027a1be1d6 Marc Zyngier 2022-02-08 416 m1_pmu_enable_counter(event->hw.idx);
a639027a1be1d6 Marc Zyngier 2022-02-08 417 m1_pmu_enable_counter_interrupt(event->hw.idx);
a639027a1be1d6 Marc Zyngier 2022-02-08 418 isb();
a639027a1be1d6 Marc Zyngier 2022-02-08 419 }
a639027a1be1d6 Marc Zyngier 2022-02-08 420
:::::: The code at line 404 was first introduced by commit
:::::: a639027a1be1d68437e1c2cac6ed16306c84ab3c drivers/perf: Add Apple icestorm/firestorm CPU PMU driver
:::::: TO: Marc Zyngier <maz@kernel.org>
:::::: CC: Will Deacon <will@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-12-12 14:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-12 14:21 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-06-27 1:07 drivers/perf/apple_m1_cpu_pmu.c:404:7: warning: variable 'user' set but not used kernel test robot
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=202512122259.IXHvifS1-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oliver.upton@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.