[westeri-thunderbolt:next 7/7] drivers/thunderbolt/pci.c:115:24: warning: unused variable 'dev'

kernel test robot <[email protected]>
Newsgroups org.kernel.vger.linux-usb,dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git next
head:   eef9f6d8c36f7610b5f837e196692ec34842a400
commit: eef9f6d8c36f7610b5f837e196692ec34842a400 [7/7] thunderbolt: Remove redundant dev_err_probe()
config: x86_64-rhel-9.4-bpf (https://download.01.org/0day-ci/archive/20260727/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260727/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   drivers/thunderbolt/pci.c: In function 'nhi_pci_init_msi':
>> drivers/thunderbolt/pci.c:115:24: warning: unused variable 'dev' [-Wunused-variable]
     115 |         struct device *dev = &pdev->dev;
         |                        ^~~


vim +/dev +115 drivers/thunderbolt/pci.c

e241d98e04ef05 Konrad Dybcio 2026-05-21  110  
e241d98e04ef05 Konrad Dybcio 2026-05-21  111  static int nhi_pci_init_msi(struct tb_nhi *nhi)
e241d98e04ef05 Konrad Dybcio 2026-05-21  112  {
e241d98e04ef05 Konrad Dybcio 2026-05-21  113  	struct tb_nhi_pci *nhi_pci = nhi_to_pci(nhi);
e241d98e04ef05 Konrad Dybcio 2026-05-21  114  	struct pci_dev *pdev = to_pci_dev(nhi->dev);
e241d98e04ef05 Konrad Dybcio 2026-05-21 @115  	struct device *dev = &pdev->dev;
e241d98e04ef05 Konrad Dybcio 2026-05-21  116  	int res, irq, nvec;
e241d98e04ef05 Konrad Dybcio 2026-05-21  117  
e241d98e04ef05 Konrad Dybcio 2026-05-21  118  	ida_init(&nhi_pci->msix_ida);
e241d98e04ef05 Konrad Dybcio 2026-05-21  119  
e241d98e04ef05 Konrad Dybcio 2026-05-21  120  	/*
e241d98e04ef05 Konrad Dybcio 2026-05-21  121  	 * The NHI has 16 MSI-X vectors or a single MSI. We first try to
e241d98e04ef05 Konrad Dybcio 2026-05-21  122  	 * get all MSI-X vectors and if we succeed, each ring will have
e241d98e04ef05 Konrad Dybcio 2026-05-21  123  	 * one MSI-X. If for some reason that does not work out, we
e241d98e04ef05 Konrad Dybcio 2026-05-21  124  	 * fallback to a single MSI.
e241d98e04ef05 Konrad Dybcio 2026-05-21  125  	 */
e241d98e04ef05 Konrad Dybcio 2026-05-21  126  	nvec = pci_alloc_irq_vectors(pdev, MSIX_MIN_VECS, MSIX_MAX_VECS,
e241d98e04ef05 Konrad Dybcio 2026-05-21  127  				     PCI_IRQ_MSIX);
e241d98e04ef05 Konrad Dybcio 2026-05-21  128  	if (nvec < 0) {
e241d98e04ef05 Konrad Dybcio 2026-05-21  129  		nvec = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
e241d98e04ef05 Konrad Dybcio 2026-05-21  130  		if (nvec < 0)
e241d98e04ef05 Konrad Dybcio 2026-05-21  131  			return nvec;
e241d98e04ef05 Konrad Dybcio 2026-05-21  132  
e241d98e04ef05 Konrad Dybcio 2026-05-21  133  		INIT_WORK(&nhi->interrupt_work, nhi_interrupt_work);
e241d98e04ef05 Konrad Dybcio 2026-05-21  134  
e241d98e04ef05 Konrad Dybcio 2026-05-21  135  		irq = pci_irq_vector(pdev, 0);
e241d98e04ef05 Konrad Dybcio 2026-05-21  136  		if (irq < 0)
e241d98e04ef05 Konrad Dybcio 2026-05-21  137  			return irq;
e241d98e04ef05 Konrad Dybcio 2026-05-21  138  
e241d98e04ef05 Konrad Dybcio 2026-05-21  139  		res = devm_request_irq(&pdev->dev, irq, nhi_msi,
e241d98e04ef05 Konrad Dybcio 2026-05-21  140  				       IRQF_NO_SUSPEND, "thunderbolt", nhi);
e241d98e04ef05 Konrad Dybcio 2026-05-21  141  		if (res)
eef9f6d8c36f76 Pan Chuang    2026-07-16  142  			return res;
e241d98e04ef05 Konrad Dybcio 2026-05-21  143  	}
e241d98e04ef05 Konrad Dybcio 2026-05-21  144  
e241d98e04ef05 Konrad Dybcio 2026-05-21  145  	return 0;
e241d98e04ef05 Konrad Dybcio 2026-05-21  146  }
e241d98e04ef05 Konrad Dybcio 2026-05-21  147  

:::::: The code at line 115 was first introduced by commit
:::::: e241d98e04ef0513b78de2d87d8d1eb2993d9d34 thunderbolt: Separate out common NHI bits

:::::: TO: Konrad Dybcio <[email protected]>
:::::: CC: Mika Westerberg <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.