* [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first
@ 2025-11-04 9:43 kernel test robot
2025-11-04 12:35 ` Will Deacon
0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2025-11-04 9:43 UTC (permalink / raw)
To: Robin Murphy; +Cc: llvm, oe-kbuild-all, Will Deacon
tree: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf
head: 989b40b7578a2be7b0388522d33d751b257d59d9
commit: 8fa08f8835e57e1fd5e2994c9cf76c84dadc1235 [6/8] perf/arm-ni: Add NoC S3 support
config: sparc64-randconfig-002-20251104 (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-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/202511041749.ok8zDP6u-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]
432 | hw->event_base = (unsigned long)cd->pmu_base +
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L;
| ~~~~~~ ^
drivers/perf/arm-ni.c:433:13: note: place parentheses around the '+' expression to silence this warning
432 | hw->event_base = (unsigned long)cd->pmu_base +
| (
433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L;
| ^
| )
drivers/perf/arm-ni.c:433:13: note: place parentheses around the '?:' expression to evaluate it first
433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L;
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/arm-ni.c:446:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]
445 | hw->event_base = (unsigned long)cd->pmu_base +
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
446 | is_7xx ? NI700_PMEVCNTR(hw->idx) : NI_PMEVCNTR(hw->idx);
| ~~~~~~ ^
drivers/perf/arm-ni.c:446:13: note: place parentheses around the '+' expression to silence this warning
445 | hw->event_base = (unsigned long)cd->pmu_base +
| (
446 | is_7xx ? NI700_PMEVCNTR(hw->idx) : NI_PMEVCNTR(hw->idx);
| ^
| )
drivers/perf/arm-ni.c:446:13: note: place parentheses around the '?:' expression to evaluate it first
446 | is_7xx ? NI700_PMEVCNTR(hw->idx) : NI_PMEVCNTR(hw->idx);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
vim +433 drivers/perf/arm-ni.c
418
419 static int arm_ni_event_add(struct perf_event *event, int flags)
420 {
421 struct arm_ni_cd *cd = pmu_to_cd(event->pmu);
422 struct hw_perf_event *hw = &event->hw;
423 struct arm_ni_unit *unit;
424 enum ni_node_type type = NI_EVENT_TYPE(event);
425 bool is_7xx = arm_ni_is_7xx(cd_to_ni(cd));
426 u32 reg;
427
428 if (type == NI_PMU) {
429 if (cd->ccnt)
430 return -ENOSPC;
431 hw->idx = NI_CCNT_IDX;
432 hw->event_base = (unsigned long)cd->pmu_base +
> 433 is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L;
434 cd->ccnt = event;
435 arm_ni_init_ccnt(hw);
436 } else {
437 hw->idx = 0;
438 while (cd->evcnt[hw->idx]) {
439 if (++hw->idx == NI_NUM_COUNTERS)
440 return -ENOSPC;
441 }
442 cd->evcnt[hw->idx] = event;
443 unit = (void *)hw->config_base;
444 unit->event[hw->idx] = NI_EVENT_EVENTID(event);
445 hw->event_base = (unsigned long)cd->pmu_base +
446 is_7xx ? NI700_PMEVCNTR(hw->idx) : NI_PMEVCNTR(hw->idx);
447 arm_ni_init_evcnt(hw);
448 lo_hi_writeq_relaxed(le64_to_cpu(unit->pmusel), unit->pmusela);
449
450 reg = FIELD_PREP(NI_PMEVTYPER_NODE_TYPE, type) |
451 FIELD_PREP(NI_PMEVTYPER_NODE_ID, NI_EVENT_NODEID(event));
452 writel_relaxed(reg, cd->pmu_base + NI_PMEVTYPER(hw->idx));
453 }
454 if (flags & PERF_EF_START)
455 arm_ni_event_start(event, 0);
456 return 0;
457 }
458
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first 2025-11-04 9:43 [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first kernel test robot @ 2025-11-04 12:35 ` Will Deacon 2025-11-04 13:26 ` Robin Murphy 0 siblings, 1 reply; 7+ messages in thread From: Will Deacon @ 2025-11-04 12:35 UTC (permalink / raw) To: kernel test robot; +Cc: Robin Murphy, llvm, oe-kbuild-all On Tue, Nov 04, 2025 at 05:43:40PM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf > head: 989b40b7578a2be7b0388522d33d751b257d59d9 > commit: 8fa08f8835e57e1fd5e2994c9cf76c84dadc1235 [6/8] perf/arm-ni: Add NoC S3 support > config: sparc64-randconfig-002-20251104 (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-lkp@intel.com/config) > compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b) > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-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/202511041749.ok8zDP6u-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > > >> drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses] > 432 | hw->event_base = (unsigned long)cd->pmu_base + > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; > | ~~~~~~ ^ > drivers/perf/arm-ni.c:433:13: note: place parentheses around the '+' expression to silence this warning > 432 | hw->event_base = (unsigned long)cd->pmu_base + > | ( > 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; > | ^ > | ) Hrm. Doesn't that mean this is completely broken or am I misreading the report? Will ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first 2025-11-04 12:35 ` Will Deacon @ 2025-11-04 13:26 ` Robin Murphy 2025-11-04 13:32 ` Will Deacon 0 siblings, 1 reply; 7+ messages in thread From: Robin Murphy @ 2025-11-04 13:26 UTC (permalink / raw) To: Will Deacon, kernel test robot; +Cc: llvm, oe-kbuild-all, nd On 2025-11-04 12:35 pm, Will Deacon wrote: > On Tue, Nov 04, 2025 at 05:43:40PM +0800, kernel test robot wrote: >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf >> head: 989b40b7578a2be7b0388522d33d751b257d59d9 >> commit: 8fa08f8835e57e1fd5e2994c9cf76c84dadc1235 [6/8] perf/arm-ni: Add NoC S3 support >> config: sparc64-randconfig-002-20251104 (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-lkp@intel.com/config) >> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b) >> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-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/202511041749.ok8zDP6u-lkp@intel.com/ >> >> All warnings (new ones prefixed by >>): >> >>>> drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses] >> 432 | hw->event_base = (unsigned long)cd->pmu_base + >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; >> | ~~~~~~ ^ >> drivers/perf/arm-ni.c:433:13: note: place parentheses around the '+' expression to silence this warning >> 432 | hw->event_base = (unsigned long)cd->pmu_base + >> | ( >> 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; >> | ^ >> | ) > > Hrm. Doesn't that mean this is completely broken or am I misreading the > report? Bah, my arm64 W=1 build (which I did do in the hope of catching any such sillies...) fails to flag that :( Truth is this is a fresh refactoring of the mess I originally wrote that got tested by someone else 18 months ago, and I don't have any hardware to functionally test it myself. Feel free to drop it and I'll send a complete v2, or I can do an incremental fix if you prefer (I already realised I could have streamlined the version check to a one-off in event_init as well.) Cheers, Robin. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first 2025-11-04 13:26 ` Robin Murphy @ 2025-11-04 13:32 ` Will Deacon 2025-11-04 14:04 ` Robin Murphy 0 siblings, 1 reply; 7+ messages in thread From: Will Deacon @ 2025-11-04 13:32 UTC (permalink / raw) To: Robin Murphy; +Cc: kernel test robot, llvm, oe-kbuild-all, nd On Tue, Nov 04, 2025 at 01:26:11PM +0000, Robin Murphy wrote: > On 2025-11-04 12:35 pm, Will Deacon wrote: > > On Tue, Nov 04, 2025 at 05:43:40PM +0800, kernel test robot wrote: > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf > > > head: 989b40b7578a2be7b0388522d33d751b257d59d9 > > > commit: 8fa08f8835e57e1fd5e2994c9cf76c84dadc1235 [6/8] perf/arm-ni: Add NoC S3 support > > > config: sparc64-randconfig-002-20251104 (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-lkp@intel.com/config) > > > compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b) > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-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/202511041749.ok8zDP6u-lkp@intel.com/ > > > > > > All warnings (new ones prefixed by >>): > > > > > > > > drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses] > > > 432 | hw->event_base = (unsigned long)cd->pmu_base + > > > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; > > > | ~~~~~~ ^ > > > drivers/perf/arm-ni.c:433:13: note: place parentheses around the '+' expression to silence this warning > > > 432 | hw->event_base = (unsigned long)cd->pmu_base + > > > | ( > > > 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; > > > | ^ > > > | ) > > > > Hrm. Doesn't that mean this is completely broken or am I misreading the > > report? > > Bah, my arm64 W=1 build (which I did do in the hope of catching any such > sillies...) fails to flag that :( > > Truth is this is a fresh refactoring of the mess I originally wrote that got > tested by someone else 18 months ago, and I don't have any hardware to > functionally test it myself. Feel free to drop it and I'll send a complete > v2, or I can do an incremental fix if you prefer (I already realised I could > have streamlined the version check to a one-off in event_init as well.) Damn, it's not ideal that we don't have any test coverage for this. The patch is buried under some others now, so I can either revert it or take fixes on top. Up to you. Will ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first 2025-11-04 13:32 ` Will Deacon @ 2025-11-04 14:04 ` Robin Murphy 2025-11-04 18:24 ` Will Deacon 0 siblings, 1 reply; 7+ messages in thread From: Robin Murphy @ 2025-11-04 14:04 UTC (permalink / raw) To: Will Deacon; +Cc: kernel test robot, llvm, oe-kbuild-all, nd On 2025-11-04 1:32 pm, Will Deacon wrote: > On Tue, Nov 04, 2025 at 01:26:11PM +0000, Robin Murphy wrote: >> On 2025-11-04 12:35 pm, Will Deacon wrote: >>> On Tue, Nov 04, 2025 at 05:43:40PM +0800, kernel test robot wrote: >>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf >>>> head: 989b40b7578a2be7b0388522d33d751b257d59d9 >>>> commit: 8fa08f8835e57e1fd5e2994c9cf76c84dadc1235 [6/8] perf/arm-ni: Add NoC S3 support >>>> config: sparc64-randconfig-002-20251104 (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-lkp@intel.com/config) >>>> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b) >>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-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/202511041749.ok8zDP6u-lkp@intel.com/ >>>> >>>> All warnings (new ones prefixed by >>): >>>> >>>>>> drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses] >>>> 432 | hw->event_base = (unsigned long)cd->pmu_base + >>>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; >>>> | ~~~~~~ ^ >>>> drivers/perf/arm-ni.c:433:13: note: place parentheses around the '+' expression to silence this warning >>>> 432 | hw->event_base = (unsigned long)cd->pmu_base + >>>> | ( >>>> 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; >>>> | ^ >>>> | ) >>> >>> Hrm. Doesn't that mean this is completely broken or am I misreading the >>> report? >> >> Bah, my arm64 W=1 build (which I did do in the hope of catching any such >> sillies...) fails to flag that :( >> >> Truth is this is a fresh refactoring of the mess I originally wrote that got >> tested by someone else 18 months ago, and I don't have any hardware to >> functionally test it myself. Feel free to drop it and I'll send a complete >> v2, or I can do an incremental fix if you prefer (I already realised I could >> have streamlined the version check to a one-off in event_init as well.) > > Damn, it's not ideal that we don't have any test coverage for this. > > The patch is buried under some others now, so I can either revert it or > take fixes on top. Up to you. I've managed to break my git-send-email setup at the moment, so I hope an inline patch is OK! Cheers, Robin. ----->8----- Subject: [PATCH] perf/arm-ni: Fix and optimise register offset calculation LKP points out an operator precedence oversight in the new NoC S3 support that, annoyingly, my local W=1 build didn't flag. In fixing that, we can also take the similarly-missed opportunity to cache the version check itself at event_init time. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202511041749.ok8zDP6u-lkp@intel.com/ Signed-off-by: Robin Murphy <robin.murphy@arm.com> --- drivers/perf/arm-ni.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c index aa824abc629e..66858c65215d 100644 --- a/drivers/perf/arm-ni.c +++ b/drivers/perf/arm-ni.c @@ -323,9 +323,15 @@ static int arm_ni_validate_group(struct perf_event *event) return 0; } +static bool arm_ni_is_7xx(const struct arm_ni *ni) +{ + return ni->part == PART_NI_700 || ni->part == PART_NI_710AE; +} + static int arm_ni_event_init(struct perf_event *event) { struct arm_ni_cd *cd = pmu_to_cd(event->pmu); + struct arm_ni *ni; if (event->attr.type != event->pmu->type) return -ENOENT; @@ -333,7 +339,10 @@ static int arm_ni_event_init(struct perf_event *event) if (is_sampling_event(event)) return -EINVAL; - event->cpu = cd_to_ni(cd)->cpu; + ni = cd_to_ni(cd); + event->cpu = ni->cpu; + event->hw.flags = arm_ni_is_7xx(ni); + if (NI_EVENT_TYPE(event) == NI_PMU) return arm_ni_validate_group(event); @@ -411,18 +420,12 @@ static void arm_ni_init_evcnt(struct hw_perf_event *hw) writel_relaxed(S32_MIN, (void __iomem *)hw->event_base); } -static bool arm_ni_is_7xx(const struct arm_ni *ni) -{ - return ni->part == PART_NI_700 || ni->part == PART_NI_710AE; -} - static int arm_ni_event_add(struct perf_event *event, int flags) { struct arm_ni_cd *cd = pmu_to_cd(event->pmu); struct hw_perf_event *hw = &event->hw; struct arm_ni_unit *unit; enum ni_node_type type = NI_EVENT_TYPE(event); - bool is_7xx = arm_ni_is_7xx(cd_to_ni(cd)); u32 reg; if (type == NI_PMU) { @@ -430,7 +433,7 @@ static int arm_ni_event_add(struct perf_event *event, int flags) return -ENOSPC; hw->idx = NI_CCNT_IDX; hw->event_base = (unsigned long)cd->pmu_base + - is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; + (hw->flags ? NI700_PMCCNTR_L : NI_PMCCNTR_L); cd->ccnt = event; arm_ni_init_ccnt(hw); } else { @@ -443,7 +446,7 @@ static int arm_ni_event_add(struct perf_event *event, int flags) unit = (void *)hw->config_base; unit->event[hw->idx] = NI_EVENT_EVENTID(event); hw->event_base = (unsigned long)cd->pmu_base + - is_7xx ? NI700_PMEVCNTR(hw->idx) : NI_PMEVCNTR(hw->idx); + (hw->flags ? NI700_PMEVCNTR(hw->idx) : NI_PMEVCNTR(hw->idx)); arm_ni_init_evcnt(hw); lo_hi_writeq_relaxed(le64_to_cpu(unit->pmusel), unit->pmusela); -- 2.34.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first 2025-11-04 14:04 ` Robin Murphy @ 2025-11-04 18:24 ` Will Deacon 2025-11-04 18:36 ` Robin Murphy 0 siblings, 1 reply; 7+ messages in thread From: Will Deacon @ 2025-11-04 18:24 UTC (permalink / raw) To: Robin Murphy; +Cc: kernel test robot, llvm, oe-kbuild-all, nd On Tue, Nov 04, 2025 at 02:04:57PM +0000, Robin Murphy wrote: > On 2025-11-04 1:32 pm, Will Deacon wrote: > > On Tue, Nov 04, 2025 at 01:26:11PM +0000, Robin Murphy wrote: > > > On 2025-11-04 12:35 pm, Will Deacon wrote: > > > > On Tue, Nov 04, 2025 at 05:43:40PM +0800, kernel test robot wrote: > > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf > > > > > head: 989b40b7578a2be7b0388522d33d751b257d59d9 > > > > > commit: 8fa08f8835e57e1fd5e2994c9cf76c84dadc1235 [6/8] perf/arm-ni: Add NoC S3 support > > > > > config: sparc64-randconfig-002-20251104 (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-lkp@intel.com/config) > > > > > compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b) > > > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-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/202511041749.ok8zDP6u-lkp@intel.com/ > > > > > > > > > > All warnings (new ones prefixed by >>): > > > > > > > > > > > > drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses] > > > > > 432 | hw->event_base = (unsigned long)cd->pmu_base + > > > > > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; > > > > > | ~~~~~~ ^ > > > > > drivers/perf/arm-ni.c:433:13: note: place parentheses around the '+' expression to silence this warning > > > > > 432 | hw->event_base = (unsigned long)cd->pmu_base + > > > > > | ( > > > > > 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; > > > > > | ^ > > > > > | ) > > > > > > > > Hrm. Doesn't that mean this is completely broken or am I misreading the > > > > report? > > > > > > Bah, my arm64 W=1 build (which I did do in the hope of catching any such > > > sillies...) fails to flag that :( > > > > > > Truth is this is a fresh refactoring of the mess I originally wrote that got > > > tested by someone else 18 months ago, and I don't have any hardware to > > > functionally test it myself. Feel free to drop it and I'll send a complete > > > v2, or I can do an incremental fix if you prefer (I already realised I could > > > have streamlined the version check to a one-off in event_init as well.) > > > > Damn, it's not ideal that we don't have any test coverage for this. > > > > The patch is buried under some others now, so I can either revert it or > > take fixes on top. Up to you. > > I've managed to break my git-send-email setup at the moment, so I hope > an inline patch is OK! Sadly, this appears to be whitespace corrupted in a very strange way. The version I see in mutt is different to the version on lore, which itself renders differently when viewed as "raw". None of them apply :( Will ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first 2025-11-04 18:24 ` Will Deacon @ 2025-11-04 18:36 ` Robin Murphy 0 siblings, 0 replies; 7+ messages in thread From: Robin Murphy @ 2025-11-04 18:36 UTC (permalink / raw) To: Will Deacon; +Cc: kernel test robot, llvm, oe-kbuild-all On 2025-11-04 6:24 pm, Will Deacon wrote: > On Tue, Nov 04, 2025 at 02:04:57PM +0000, Robin Murphy wrote: >> On 2025-11-04 1:32 pm, Will Deacon wrote: >>> On Tue, Nov 04, 2025 at 01:26:11PM +0000, Robin Murphy wrote: >>>> On 2025-11-04 12:35 pm, Will Deacon wrote: >>>>> On Tue, Nov 04, 2025 at 05:43:40PM +0800, kernel test robot wrote: >>>>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf >>>>>> head: 989b40b7578a2be7b0388522d33d751b257d59d9 >>>>>> commit: 8fa08f8835e57e1fd5e2994c9cf76c84dadc1235 [6/8] perf/arm-ni: Add NoC S3 support >>>>>> config: sparc64-randconfig-002-20251104 (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-lkp@intel.com/config) >>>>>> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b) >>>>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511041749.ok8zDP6u-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/202511041749.ok8zDP6u-lkp@intel.com/ >>>>>> >>>>>> All warnings (new ones prefixed by >>): >>>>>> >>>>>>>> drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses] >>>>>> 432 | hw->event_base = (unsigned long)cd->pmu_base + >>>>>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>>> 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; >>>>>> | ~~~~~~ ^ >>>>>> drivers/perf/arm-ni.c:433:13: note: place parentheses around the '+' expression to silence this warning >>>>>> 432 | hw->event_base = (unsigned long)cd->pmu_base + >>>>>> | ( >>>>>> 433 | is_7xx ? NI700_PMCCNTR_L : NI_PMCCNTR_L; >>>>>> | ^ >>>>>> | ) >>>>> >>>>> Hrm. Doesn't that mean this is completely broken or am I misreading the >>>>> report? >>>> >>>> Bah, my arm64 W=1 build (which I did do in the hope of catching any such >>>> sillies...) fails to flag that :( >>>> >>>> Truth is this is a fresh refactoring of the mess I originally wrote that got >>>> tested by someone else 18 months ago, and I don't have any hardware to >>>> functionally test it myself. Feel free to drop it and I'll send a complete >>>> v2, or I can do an incremental fix if you prefer (I already realised I could >>>> have streamlined the version check to a one-off in event_init as well.) >>> >>> Damn, it's not ideal that we don't have any test coverage for this. >>> >>> The patch is buried under some others now, so I can either revert it or >>> take fixes on top. Up to you. >> >> I've managed to break my git-send-email setup at the moment, so I hope >> an inline patch is OK! > > Sadly, this appears to be whitespace corrupted in a very strange way. The > version I see in mutt is different to the version on lore, which itself > renders differently when viewed as "raw". None of them apply :( Hooray for Office 365 and its liberal approximation of IMAP... Anyway, I have now managed to sort out the machine that was keeping me out of my other account, so you should have a properly-sent version now. Cheers, Robin. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-11-04 18:36 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-11-04 9:43 [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first kernel test robot 2025-11-04 12:35 ` Will Deacon 2025-11-04 13:26 ` Robin Murphy 2025-11-04 13:32 ` Will Deacon 2025-11-04 14:04 ` Robin Murphy 2025-11-04 18:24 ` Will Deacon 2025-11-04 18:36 ` Robin Murphy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox