Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Will Deacon <will@kernel.org>
Subject: [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first
Date: Tue, 4 Nov 2025 17:43:40 +0800	[thread overview]
Message-ID: <202511041749.ok8zDP6u-lkp@intel.com> (raw)

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

             reply	other threads:[~2025-11-04  9:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04  9:43 kernel test robot [this message]
2025-11-04 12:35 ` [arm-perf:for-next/perf 6/8] drivers/perf/arm-ni.c:433:13: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first 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

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=202511041749.ok8zDP6u-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robin.murphy@arm.com \
    --cc=will@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