mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [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
@ 2025-08-06 14:07 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-06 14:07 UTC (permalink / raw)
  To: Elad Nachman; +Cc: oe-kbuild-all, linux-kernel, x86, Thomas Gleixner

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-06 14:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-06 14:07 [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 kernel test robot

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®