Re: [PATCH 1/9] PCI: Add new helper for allocating irq domain for INTx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Shawn,

I love your patch! Yet something to improve:

[auto build test ERROR on pci/next]
[also build test ERROR on v4.17-rc2 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Shawn-Lin/Add-new-helper-to-allocate-irq-domain-for-hosts/20180429-053656
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: i386-alldefconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   In file included from arch/x86//kernel/cpu/mtrr/main.c:46:0:
   include/linux/pci.h: In function 'pci_alloc_intx_irqd':
>> include/linux/pci.h:1510:11: error: implicit declaration of function 'irq_domain_add_linear'; did you mean 'irq_domain_get_of_node'? [-Werror=implicit-function-declaration]
     domain = irq_domain_add_linear(intc, PCI_NUM_INTX,
              ^~~~~~~~~~~~~~~~~~~~~
              irq_domain_get_of_node
>> include/linux/pci.h:1510:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     domain = irq_domain_add_linear(intc, PCI_NUM_INTX,
            ^
   cc1: some warnings being treated as errors

vim +1510 include/linux/pci.h

  1466	
  1467	/**
  1468	 * pci_alloc_intx_irqd() - PCI helper for allocating INTx irq domain
  1469	 * @dev: device associated with the PCI controller.
  1470	 * @host: pointer to host specific data struct
  1471	 * @general_xlate: flag for whether use pci_irqd_intx_xlate() helper
  1472	 * @intx_domain_ops: pointer to driver specific struct irq_domain_ops
  1473	 * @local_intc: pointer to driver specific interrupt controller node
  1474	 *
  1475	 * A simple helper for drivers to allocate irq domain for INTx. If
  1476	 * intx_domain_ops is NULL, use pci_intx_domain_ops by defalut. And if
  1477	 * local_intc is present, then use it firstly, otherwise, fallback to get
  1478	 * interrupt controller node from @dev.
  1479	 *
  1480	 * Returns valid pointer of struct irq_domain on success, or PTR_ERR(-EINVAL)
  1481	 * if failure occurred.
  1482	 */
  1483	static __maybe_unused struct irq_domain *pci_alloc_intx_irqd(struct device *dev,
  1484					void *host, bool general_xlate,
  1485					const struct irq_domain_ops *intx_domain_ops,
  1486					struct device_node *local_intc)
  1487	{
  1488		struct device_node *intc = local_intc;
  1489		struct irq_domain *domain;
  1490		const struct irq_domain_ops *irqd_ops;
  1491		bool need_put = false;
  1492	
  1493		if (!intc) {
  1494			intc = of_get_next_child(dev->of_node, NULL);
  1495			if (!intc) {
  1496				dev_err(dev, "missing child interrupt-controller node\n");
  1497				return ERR_PTR(-EINVAL);
  1498			}
  1499			need_put = true;
  1500		}
  1501	
  1502		if (intx_domain_ops) {
  1503			irqd_ops = intx_domain_ops;
  1504		} else {
  1505			if (general_xlate)
  1506				pci_intx_domain_ops.xlate = &pci_irqd_intx_xlate;
  1507			irqd_ops = &pci_intx_domain_ops;
  1508		}
  1509	
> 1510		domain = irq_domain_add_linear(intc, PCI_NUM_INTX,
  1511					       irqd_ops, host);
  1512		if (!domain) {
  1513			dev_err(dev, "failed to get a INTx IRQ domain\n");
  1514			if (need_put)
  1515				of_node_put(intc);
  1516			return ERR_PTR(-EINVAL);
  1517		}
  1518	
  1519		return domain;
  1520	}
  1521	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux