All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/powerpc/sysdev/xive/common.c:1161 xive_request_ipi() warn: unsigned 'xid->irq' is never less than zero.
@ 2021-06-23  6:43 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-06-23  6:43 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: kbuild-all, linux-kernel, Michael Ellerman

[-- Attachment #1: Type: text/plain, Size: 2614 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0c18f29aae7ce3dadd26d8ee3505d07cc982df75
commit: fd6db2892ebaa1383a93b4a609c65b96e615510a powerpc/xive: Modernize XIVE-IPI domain with an 'alloc' handler
date:   2 months ago
config: powerpc64-randconfig-m031-20210622 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

smatch warnings:
arch/powerpc/sysdev/xive/common.c:1161 xive_request_ipi() warn: unsigned 'xid->irq' is never less than zero.

vim +1161 arch/powerpc/sysdev/xive/common.c

  1126	
  1127	static int __init xive_request_ipi(void)
  1128	{
  1129		struct fwnode_handle *fwnode;
  1130		struct irq_domain *ipi_domain;
  1131		unsigned int node;
  1132		int ret = -ENOMEM;
  1133	
  1134		fwnode = irq_domain_alloc_named_fwnode("XIVE-IPI");
  1135		if (!fwnode)
  1136			goto out;
  1137	
  1138		ipi_domain = irq_domain_create_linear(fwnode, nr_node_ids,
  1139						      &xive_ipi_irq_domain_ops, NULL);
  1140		if (!ipi_domain)
  1141			goto out_free_fwnode;
  1142	
  1143		xive_ipis = kcalloc(nr_node_ids, sizeof(*xive_ipis), GFP_KERNEL | __GFP_NOFAIL);
  1144		if (!xive_ipis)
  1145			goto out_free_domain;
  1146	
  1147		for_each_node(node) {
  1148			struct xive_ipi_desc *xid = &xive_ipis[node];
  1149			struct xive_ipi_alloc_info info = { node };
  1150	
  1151			/* Skip nodes without CPUs */
  1152			if (cpumask_empty(cpumask_of_node(node)))
  1153				continue;
  1154	
  1155			/*
  1156			 * Map one IPI interrupt per node for all cpus of that node.
  1157			 * Since the HW interrupt number doesn't have any meaning,
  1158			 * simply use the node number.
  1159			 */
  1160			xid->irq = irq_domain_alloc_irqs(ipi_domain, 1, node, &info);
> 1161			if (xid->irq < 0) {
  1162				ret = xid->irq;
  1163				goto out_free_xive_ipis;
  1164			}
  1165	
  1166			snprintf(xid->name, sizeof(xid->name), "IPI-%d", node);
  1167	
  1168			ret = request_irq(xid->irq, xive_muxed_ipi_action,
  1169					  IRQF_PERCPU | IRQF_NO_THREAD, xid->name, NULL);
  1170	
  1171			WARN(ret < 0, "Failed to request IPI %d: %d\n", xid->irq, ret);
  1172		}
  1173	
  1174		return ret;
  1175	
  1176	out_free_xive_ipis:
  1177		kfree(xive_ipis);
  1178	out_free_domain:
  1179		irq_domain_remove(ipi_domain);
  1180	out_free_fwnode:
  1181		irq_domain_free_fwnode(fwnode);
  1182	out:
  1183		return ret;
  1184	}
  1185	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34027 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* arch/powerpc/sysdev/xive/common.c:1161 xive_request_ipi() warn: unsigned 'xid->irq' is never less than zero.
@ 2021-06-23  6:43 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-06-23  6:43 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2695 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0c18f29aae7ce3dadd26d8ee3505d07cc982df75
commit: fd6db2892ebaa1383a93b4a609c65b96e615510a powerpc/xive: Modernize XIVE-IPI domain with an 'alloc' handler
date:   2 months ago
config: powerpc64-randconfig-m031-20210622 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

smatch warnings:
arch/powerpc/sysdev/xive/common.c:1161 xive_request_ipi() warn: unsigned 'xid->irq' is never less than zero.

vim +1161 arch/powerpc/sysdev/xive/common.c

  1126	
  1127	static int __init xive_request_ipi(void)
  1128	{
  1129		struct fwnode_handle *fwnode;
  1130		struct irq_domain *ipi_domain;
  1131		unsigned int node;
  1132		int ret = -ENOMEM;
  1133	
  1134		fwnode = irq_domain_alloc_named_fwnode("XIVE-IPI");
  1135		if (!fwnode)
  1136			goto out;
  1137	
  1138		ipi_domain = irq_domain_create_linear(fwnode, nr_node_ids,
  1139						      &xive_ipi_irq_domain_ops, NULL);
  1140		if (!ipi_domain)
  1141			goto out_free_fwnode;
  1142	
  1143		xive_ipis = kcalloc(nr_node_ids, sizeof(*xive_ipis), GFP_KERNEL | __GFP_NOFAIL);
  1144		if (!xive_ipis)
  1145			goto out_free_domain;
  1146	
  1147		for_each_node(node) {
  1148			struct xive_ipi_desc *xid = &xive_ipis[node];
  1149			struct xive_ipi_alloc_info info = { node };
  1150	
  1151			/* Skip nodes without CPUs */
  1152			if (cpumask_empty(cpumask_of_node(node)))
  1153				continue;
  1154	
  1155			/*
  1156			 * Map one IPI interrupt per node for all cpus of that node.
  1157			 * Since the HW interrupt number doesn't have any meaning,
  1158			 * simply use the node number.
  1159			 */
  1160			xid->irq = irq_domain_alloc_irqs(ipi_domain, 1, node, &info);
> 1161			if (xid->irq < 0) {
  1162				ret = xid->irq;
  1163				goto out_free_xive_ipis;
  1164			}
  1165	
  1166			snprintf(xid->name, sizeof(xid->name), "IPI-%d", node);
  1167	
  1168			ret = request_irq(xid->irq, xive_muxed_ipi_action,
  1169					  IRQF_PERCPU | IRQF_NO_THREAD, xid->name, NULL);
  1170	
  1171			WARN(ret < 0, "Failed to request IPI %d: %d\n", xid->irq, ret);
  1172		}
  1173	
  1174		return ret;
  1175	
  1176	out_free_xive_ipis:
  1177		kfree(xive_ipis);
  1178	out_free_domain:
  1179		irq_domain_remove(ipi_domain);
  1180	out_free_fwnode:
  1181		irq_domain_free_fwnode(fwnode);
  1182	out:
  1183		return ret;
  1184	}
  1185	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34027 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-23  6:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23  6:43 arch/powerpc/sysdev/xive/common.c:1161 xive_request_ipi() warn: unsigned 'xid->irq' is never less than zero kernel test robot
2021-06-23  6:43 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.