drivers/pci/controller/pcie-xilinx-dma-pl.c:638 xilinx_pl_dma_pcie_setup_irq() error: uninitialized symbol 'irq'.
From: Dan Carpenter
Date: Tue Dec 12 2023 - 04:54:47 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a39b6ac3781d46ba18193c9dbb2110f31e9bffe9
commit: 8d786149d78c7784144c7179e25134b6530b714b PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver
config: riscv-randconfig-r071-20231211 (https://download.01.org/0day-ci/archive/20231212/202312120248.5DblxkBp-lkp@xxxxxxxxx/config)
compiler: riscv64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231212/202312120248.5DblxkBp-lkp@xxxxxxxxx/reproduce)
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@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202312120248.5DblxkBp-lkp@xxxxxxxxx/
New smatch warnings:
drivers/pci/controller/pcie-xilinx-dma-pl.c:638 xilinx_pl_dma_pcie_setup_irq() error: uninitialized symbol 'irq'.
vim +/irq +638 drivers/pci/controller/pcie-xilinx-dma-pl.c
8d786149d78c77 Thippeswamy Havalige 2023-10-03 596 static int xilinx_pl_dma_pcie_setup_irq(struct pl_dma_pcie *port)
8d786149d78c77 Thippeswamy Havalige 2023-10-03 597 {
8d786149d78c77 Thippeswamy Havalige 2023-10-03 598 struct device *dev = port->dev;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 599 struct platform_device *pdev = to_platform_device(dev);
8d786149d78c77 Thippeswamy Havalige 2023-10-03 600 int i, irq, err;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 601
8d786149d78c77 Thippeswamy Havalige 2023-10-03 602 port->irq = platform_get_irq(pdev, 0);
8d786149d78c77 Thippeswamy Havalige 2023-10-03 603 if (port->irq < 0)
8d786149d78c77 Thippeswamy Havalige 2023-10-03 604 return port->irq;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 605
8d786149d78c77 Thippeswamy Havalige 2023-10-03 606 for (i = 0; i < ARRAY_SIZE(intr_cause); i++) {
8d786149d78c77 Thippeswamy Havalige 2023-10-03 607 int err;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 608
8d786149d78c77 Thippeswamy Havalige 2023-10-03 609 if (!intr_cause[i].str)
8d786149d78c77 Thippeswamy Havalige 2023-10-03 610 continue;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 611
8d786149d78c77 Thippeswamy Havalige 2023-10-03 612 irq = irq_create_mapping(port->pldma_domain, i);
8d786149d78c77 Thippeswamy Havalige 2023-10-03 613 if (!irq) {
8d786149d78c77 Thippeswamy Havalige 2023-10-03 614 dev_err(dev, "Failed to map interrupt\n");
8d786149d78c77 Thippeswamy Havalige 2023-10-03 615 return -ENXIO;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 616 }
8d786149d78c77 Thippeswamy Havalige 2023-10-03 617
8d786149d78c77 Thippeswamy Havalige 2023-10-03 618 err = devm_request_irq(dev, irq,
8d786149d78c77 Thippeswamy Havalige 2023-10-03 619 xilinx_pl_dma_pcie_intr_handler,
8d786149d78c77 Thippeswamy Havalige 2023-10-03 620 IRQF_SHARED | IRQF_NO_THREAD,
8d786149d78c77 Thippeswamy Havalige 2023-10-03 621 intr_cause[i].sym, port);
8d786149d78c77 Thippeswamy Havalige 2023-10-03 622 if (err) {
8d786149d78c77 Thippeswamy Havalige 2023-10-03 623 dev_err(dev, "Failed to request IRQ %d\n", irq);
8d786149d78c77 Thippeswamy Havalige 2023-10-03 624 return err;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 625 }
8d786149d78c77 Thippeswamy Havalige 2023-10-03 626 }
8d786149d78c77 Thippeswamy Havalige 2023-10-03 627
8d786149d78c77 Thippeswamy Havalige 2023-10-03 628 port->intx_irq = irq_create_mapping(port->pldma_domain,
8d786149d78c77 Thippeswamy Havalige 2023-10-03 629 XILINX_PCIE_INTR_INTX);
8d786149d78c77 Thippeswamy Havalige 2023-10-03 630 if (!port->intx_irq) {
8d786149d78c77 Thippeswamy Havalige 2023-10-03 631 dev_err(dev, "Failed to map INTx interrupt\n");
8d786149d78c77 Thippeswamy Havalige 2023-10-03 632 return -ENXIO;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 633 }
8d786149d78c77 Thippeswamy Havalige 2023-10-03 634
8d786149d78c77 Thippeswamy Havalige 2023-10-03 635 err = devm_request_irq(dev, port->intx_irq, xilinx_pl_dma_pcie_intx_flow,
8d786149d78c77 Thippeswamy Havalige 2023-10-03 636 IRQF_SHARED | IRQF_NO_THREAD, NULL, port);
8d786149d78c77 Thippeswamy Havalige 2023-10-03 637 if (err) {
8d786149d78c77 Thippeswamy Havalige 2023-10-03 @638 dev_err(dev, "Failed to request INTx IRQ %d\n", irq);
^^^
s/irq/port->intx_irq/
8d786149d78c77 Thippeswamy Havalige 2023-10-03 639 return err;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 640 }
8d786149d78c77 Thippeswamy Havalige 2023-10-03 641
8d786149d78c77 Thippeswamy Havalige 2023-10-03 642 err = devm_request_irq(dev, port->irq, xilinx_pl_dma_pcie_event_flow,
8d786149d78c77 Thippeswamy Havalige 2023-10-03 643 IRQF_SHARED | IRQF_NO_THREAD, NULL, port);
8d786149d78c77 Thippeswamy Havalige 2023-10-03 644 if (err) {
8d786149d78c77 Thippeswamy Havalige 2023-10-03 645 dev_err(dev, "Failed to request event IRQ %d\n", irq);
^^^
s/irq/port->irq/
8d786149d78c77 Thippeswamy Havalige 2023-10-03 646 return err;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 647 }
8d786149d78c77 Thippeswamy Havalige 2023-10-03 648
8d786149d78c77 Thippeswamy Havalige 2023-10-03 649 return 0;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 650 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki