Linux USB
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Pan Chuang <panchuang@vivo.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-usb@vger.kernel.org,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [westeri-thunderbolt:next 7/7] drivers/thunderbolt/pci.c:115:24: warning: unused variable 'dev'
Date: Mon, 27 Jul 2026 18:42:32 +0200	[thread overview]
Message-ID: <202607271811.1izFG7s9-lkp@intel.com> (raw)

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/202607271811.1izFG7s9-lkp@intel.com/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/202607271811.1izFG7s9-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607271811.1izFG7s9-lkp@intel.com/

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 <konrad.dybcio@oss.qualcomm.com>
:::::: CC: Mika Westerberg <mika.westerberg@linux.intel.com>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-07-27 16:43 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=202607271811.1izFG7s9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=panchuang@vivo.com \
    /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