mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Elad Nachman <enachman@marvell.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: [tip:irq/urgent 3/7] drivers/irqchip/irq-mvebu-gicp.c:240:45-48: WARNING: Suspicious code. resource_size is maybe missing with gicp -> res
Date: Wed, 6 Aug 2025 22:07:38 +0800	[thread overview]
Message-ID: <202508062150.mtFQMTXc-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/urgent
head:   3b6a18f0da8720d612d8a682ea5c55870da068e0
commit: 3c3d7dbab2c70a4bca47634d564bf659351c05ca [3/7] irqchip/mvebu-gicp: Clear pending interrupts on init
config: arm64-randconfig-r052-20250806 (https://download.01.org/0day-ci/archive/20250806/202508062150.mtFQMTXc-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0

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/202508062150.mtFQMTXc-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/irqchip/irq-mvebu-gicp.c:240:45-48: WARNING: Suspicious code. resource_size is maybe missing with gicp -> res

vim +240 drivers/irqchip/irq-mvebu-gicp.c

   170	
   171	static int mvebu_gicp_probe(struct platform_device *pdev)
   172	{
   173		struct device_node *node = pdev->dev.of_node;
   174		struct device_node *irq_parent_dn;
   175		struct irq_domain_info info = {
   176			.fwnode	= of_fwnode_handle(node),
   177			.ops	= &gicp_domain_ops,
   178		};
   179		struct mvebu_gicp *gicp;
   180		void __iomem *base;
   181		int ret, i;
   182	
   183		gicp = devm_kzalloc(&pdev->dev, sizeof(*gicp), GFP_KERNEL);
   184		if (!gicp)
   185			return -ENOMEM;
   186	
   187		gicp->dev = &pdev->dev;
   188		spin_lock_init(&gicp->spi_lock);
   189	
   190		gicp->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   191		if (!gicp->res)
   192			return -ENODEV;
   193	
   194		ret = of_property_count_u32_elems(node, "marvell,spi-ranges");
   195		if (ret < 0)
   196			return ret;
   197	
   198		gicp->spi_ranges_cnt = ret / 2;
   199	
   200		gicp->spi_ranges =
   201			devm_kcalloc(&pdev->dev,
   202				     gicp->spi_ranges_cnt,
   203				     sizeof(struct mvebu_gicp_spi_range),
   204				     GFP_KERNEL);
   205		if (!gicp->spi_ranges)
   206			return -ENOMEM;
   207	
   208		for (i = 0; i < gicp->spi_ranges_cnt; i++) {
   209			of_property_read_u32_index(node, "marvell,spi-ranges",
   210						   i * 2,
   211						   &gicp->spi_ranges[i].start);
   212	
   213			of_property_read_u32_index(node, "marvell,spi-ranges",
   214						   i * 2 + 1,
   215						   &gicp->spi_ranges[i].count);
   216	
   217			gicp->spi_cnt += gicp->spi_ranges[i].count;
   218		}
   219	
   220		gicp->spi_bitmap = devm_bitmap_zalloc(&pdev->dev, gicp->spi_cnt, GFP_KERNEL);
   221		if (!gicp->spi_bitmap)
   222			return -ENOMEM;
   223	
   224		info.size = gicp->spi_cnt;
   225		info.host_data = gicp;
   226	
   227		irq_parent_dn = of_irq_find_parent(node);
   228		if (!irq_parent_dn) {
   229			dev_err(&pdev->dev, "failed to find parent IRQ node\n");
   230			return -ENODEV;
   231		}
   232	
   233		info.parent = irq_find_host(irq_parent_dn);
   234		of_node_put(irq_parent_dn);
   235		if (!info.parent) {
   236			dev_err(&pdev->dev, "failed to find parent IRQ domain\n");
   237			return -ENODEV;
   238		}
   239	
 > 240		base = ioremap(gicp->res->start, gicp->res->end - gicp->res->start);
   241		if (IS_ERR(base)) {
   242			dev_err(&pdev->dev, "ioremap() failed. Unable to clear pending interrupts.\n");
   243		} else {
   244			for (i = 0; i < 64; i++)
   245				writel(i, base + GICP_CLRSPI_NSR_OFFSET);
   246			iounmap(base);
   247		}
   248	
   249		return msi_create_parent_irq_domain(&info, &gicp_msi_parent_ops) ? 0 : -ENOMEM;
   250	}
   251	

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

                 reply	other threads:[~2025-08-06 14:08 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=202508062150.mtFQMTXc-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=enachman@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=tglx@linutronix.de \
    --cc=x86@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

all inboxes | Powered by JetHome®