tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 31421c83a2aaf8ecc1d8f377ea9e7e7a37cdb2bf commit: 7e9f220b20b856cefc3290400637c00da0b224c3 [12720/30000] vdpa: set the virtqueue num during register config: x86_64-randconfig-161-20241012 (https://download.01.org/0day-ci/archive/20241023/202410230108.FVEbypBJ-lkp@i...) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
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/202410230108.FVEbypBJ-lkp@intel.com/
smatch warnings: drivers/vdpa/virtio_pci/vp_vdpa.c:168 vp_vdpa_request_irq() warn: inconsistent indenting
vim +168 drivers/vdpa/virtio_pci/vp_vdpa.c
b66082483c7e22 Jason Wang 2021-02-23 124 b66082483c7e22 Jason Wang 2021-02-23 125 static int vp_vdpa_request_irq(struct vp_vdpa *vp_vdpa) b66082483c7e22 Jason Wang 2021-02-23 126 { b66082483c7e22 Jason Wang 2021-02-23 127 struct virtio_pci_modern_device *mdev = &vp_vdpa->mdev; b66082483c7e22 Jason Wang 2021-02-23 128 struct pci_dev *pdev = mdev->pci_dev; b66082483c7e22 Jason Wang 2021-02-23 129 int i, ret, irq; b66082483c7e22 Jason Wang 2021-02-23 130 int queues = vp_vdpa->queues; b66082483c7e22 Jason Wang 2021-02-23 131 int vectors = queues + 1; b66082483c7e22 Jason Wang 2021-02-23 132 b66082483c7e22 Jason Wang 2021-02-23 133 ret = pci_alloc_irq_vectors(pdev, vectors, vectors, PCI_IRQ_MSIX); b66082483c7e22 Jason Wang 2021-02-23 134 if (ret != vectors) { b66082483c7e22 Jason Wang 2021-02-23 135 dev_err(&pdev->dev, b66082483c7e22 Jason Wang 2021-02-23 136 "vp_vdpa: fail to allocate irq vectors want %d but %d\n", b66082483c7e22 Jason Wang 2021-02-23 137 vectors, ret); b66082483c7e22 Jason Wang 2021-02-23 138 return ret; b66082483c7e22 Jason Wang 2021-02-23 139 } b66082483c7e22 Jason Wang 2021-02-23 140 b66082483c7e22 Jason Wang 2021-02-23 141 vp_vdpa->vectors = vectors; b66082483c7e22 Jason Wang 2021-02-23 142 b66082483c7e22 Jason Wang 2021-02-23 143 for (i = 0; i < queues; i++) { b66082483c7e22 Jason Wang 2021-02-23 144 snprintf(vp_vdpa->vring[i].msix_name, VP_VDPA_NAME_SIZE, b66082483c7e22 Jason Wang 2021-02-23 145 "vp-vdpa[%s]-%d\n", pci_name(pdev), i); b66082483c7e22 Jason Wang 2021-02-23 146 irq = pci_irq_vector(pdev, i); b66082483c7e22 Jason Wang 2021-02-23 147 ret = devm_request_irq(&pdev->dev, irq, b66082483c7e22 Jason Wang 2021-02-23 148 vp_vdpa_vq_handler, b66082483c7e22 Jason Wang 2021-02-23 149 0, vp_vdpa->vring[i].msix_name, b66082483c7e22 Jason Wang 2021-02-23 150 &vp_vdpa->vring[i]); b66082483c7e22 Jason Wang 2021-02-23 151 if (ret) { b66082483c7e22 Jason Wang 2021-02-23 152 dev_err(&pdev->dev, b66082483c7e22 Jason Wang 2021-02-23 153 "vp_vdpa: fail to request irq for vq %d\n", i); b66082483c7e22 Jason Wang 2021-02-23 154 goto err; b66082483c7e22 Jason Wang 2021-02-23 155 } b66082483c7e22 Jason Wang 2021-02-23 156 vp_modern_queue_vector(mdev, i, i); b66082483c7e22 Jason Wang 2021-02-23 157 vp_vdpa->vring[i].irq = irq; b66082483c7e22 Jason Wang 2021-02-23 158 } b66082483c7e22 Jason Wang 2021-02-23 159 b66082483c7e22 Jason Wang 2021-02-23 160 snprintf(vp_vdpa->msix_name, VP_VDPA_NAME_SIZE, "vp-vdpa[%s]-config\n", b66082483c7e22 Jason Wang 2021-02-23 161 pci_name(pdev)); b66082483c7e22 Jason Wang 2021-02-23 162 irq = pci_irq_vector(pdev, queues); b66082483c7e22 Jason Wang 2021-02-23 163 ret = devm_request_irq(&pdev->dev, irq, vp_vdpa_config_handler, 0, b66082483c7e22 Jason Wang 2021-02-23 164 vp_vdpa->msix_name, vp_vdpa); b66082483c7e22 Jason Wang 2021-02-23 165 if (ret) { b66082483c7e22 Jason Wang 2021-02-23 166 dev_err(&pdev->dev, b66082483c7e22 Jason Wang 2021-02-23 167 "vp_vdpa: fail to request irq for vq %d\n", i); b66082483c7e22 Jason Wang 2021-02-23 @168 goto err; b66082483c7e22 Jason Wang 2021-02-23 169 } b66082483c7e22 Jason Wang 2021-02-23 170 vp_modern_config_vector(mdev, queues); b66082483c7e22 Jason Wang 2021-02-23 171 vp_vdpa->config_irq = irq; b66082483c7e22 Jason Wang 2021-02-23 172 b66082483c7e22 Jason Wang 2021-02-23 173 return 0; b66082483c7e22 Jason Wang 2021-02-23 174 err: b66082483c7e22 Jason Wang 2021-02-23 175 vp_vdpa_free_irq(vp_vdpa); b66082483c7e22 Jason Wang 2021-02-23 176 return ret; b66082483c7e22 Jason Wang 2021-02-23 177 } b66082483c7e22 Jason Wang 2021-02-23 178
:::::: The code at line 168 was first introduced by commit :::::: b66082483c7e223dd0cbf81b454ca85013446a2b vdpa: introduce virtio pci driver
:::::: TO: Jason Wang jasowang@redhat.com :::::: CC: Pengyuan Zhao zhaopengyuan@hisilicon.com