Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Marc Zyngier <maz@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org
Subject: [arm-platforms:hack/ppi 9/24] drivers/perf/arm_spe_pmu.c:1225:6: warning: variable 'ret' is uninitialized when used here
Date: Tue, 22 Apr 2025 01:26:24 +0800	[thread overview]
Message-ID: <202504220122.xk8VGIkc-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git hack/ppi
head:   2017a5b657d38d470385b73ae1704eefe13bf2a5
commit: c4dc9ff02fe9b78fb6f5cead8defbb4e6d3b632c [9/24] perf: arm_spe_pmu: Convert to new IRQ affinity retrieval API
config: arm64-randconfig-002-20250422 (https://download.01.org/0day-ci/archive/20250422/202504220122.xk8VGIkc-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250422/202504220122.xk8VGIkc-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/202504220122.xk8VGIkc-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/perf/arm_spe_pmu.c:1225:6: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
    1225 |         if (ret) {
         |             ^~~
   drivers/perf/arm_spe_pmu.c:1211:9: note: initialize the variable 'ret' to silence this warning
    1211 |         int ret, irq;
         |                ^
         |                 = 0
   1 warning generated.


vim +/ret +1225 drivers/perf/arm_spe_pmu.c

  1205	
  1206	/* Driver and device probing */
  1207	static int arm_spe_pmu_irq_probe(struct arm_spe_pmu *spe_pmu)
  1208	{
  1209		struct platform_device *pdev = spe_pmu->pdev;
  1210		const struct cpumask *affinity;
  1211		int ret, irq;
  1212	
  1213		irq = platform_get_irq_affinity(pdev, 0, &affinity);
  1214		if (irq < 0)
  1215			return -ENXIO;
  1216	
  1217		if (!irq_is_percpu(irq)) {
  1218			dev_err(&pdev->dev, "expected PPI but got SPI (%d)\n", irq);
  1219			return -EINVAL;
  1220		}
  1221	
  1222		if (!affinity)
  1223			affinity = cpu_possible_mask;
  1224	
> 1225		if (ret) {
  1226			dev_err(&pdev->dev, "failed to get PPI partition (%d)\n", irq);
  1227			return -EINVAL;
  1228		}
  1229	
  1230		cpumask_copy(&spe_pmu->supported_cpus, affinity);
  1231	
  1232		spe_pmu->irq = irq;
  1233		return 0;
  1234	}
  1235	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-04-21 17:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202504220122.xk8VGIkc-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oe-kbuild-all@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