mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: arch/powerpc/sysdev/xive/common.c:1161 xive_request_ipi() warn: unsigned 'xid->irq' is never less than zero.
Date: Wed, 23 Jun 2021 14:43:58 +0800	[thread overview]
Message-ID: <202106231454.ZsB1h5uY-lkp@intel.com> (raw)

[-- 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 --]

                 reply	other threads:[~2021-06-23  6:45 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=202106231454.ZsB1h5uY-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clg@kaod.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    /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®